Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem installing Ghost with docker-compose #232

Closed
Encang-Cutbray opened this issue Sep 20, 2020 · 4 comments
Closed

Problem installing Ghost with docker-compose #232

Encang-Cutbray opened this issue Sep 20, 2020 · 4 comments

Comments

@Encang-Cutbray
Copy link

Hai, i have a problem to install ghost with docker-compose
the problem is
ERROR ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
"Unknown database error"
Error ID:
500
Error Code:
ER_NOT_SUPPORTED_AUTH_MODE

my docker-compose

version: "3.1"
services:
ghost:
image: ghost:latest
restart: always
networks:
- ghost-lover
ports:
- 8080:2368
environment:
database__client: mysql
database__connection__host: db
database__connection__user: root
database__connection__password: example
database__connection__database: ghost
url: http://localhost:8080

db:
image: mysql:latest
networks:
- ghost-lover
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
volumes:
- mysql-lover:/var/lib/mysql

volumes:
mysql-lover:
networks:
ghost-lover:

can do you help me? thank

@acburdine
Copy link
Collaborator

@Encang-Cutbray the reason this is occurring I think is because mysql:latest installs MySQL version 8, which currently has a couple of known incompatibilities with the nodejs MySQL driver.

To fix this, try updating your db image to mysql:5.7 instead.

@Encang-Cutbray
Copy link
Author

Encang-Cutbray commented Sep 22, 2020

@acburdine yes, I used mysql:latest for my database, and i changed to mysql:5.7, it is working now, thanks for information about known incompatibilities mysql 8.0 thank you very much

@heng1025
Copy link

heng1025 commented Aug 8, 2021

@acburdine ghost 4+ has supported mysql 8.0,maybe you need open mysql_native_password.
Here is the example:

  • Run a container independently
    docker run --name db -e MYSQL_ROOT_PASSWORD=example -d mysql --default-authentication-plugin=mysql_native_password

  • docker-compose.yml

version: '3.8'
services:
  ghost:
    image: ghost:alpine
    restart: always
    ports:
      - 8080:2368
    environment:
      # see https://ghost.org/docs/config/#configuration-options
      database__client: mysql
      database__connection__host: db
      database__connection__user: root
      database__connection__password: example
      database__connection__database: ghost
      # this url value is just an example, and is likely wrong for your environment!
      url: http://localhost:8080
      # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
      #NODE_ENV: development

  db:
    image: mysql:latest
    restart: always
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_ROOT_PASSWORD: example

@dnsmichi
Copy link

dnsmichi commented Dec 1, 2021

@heng1025 Thanks a lot for sharing, it helped my upgrade to v4 and MySQL 8 :-)

I've created a summary blog for everyone looking into the same: https://dnsmichi.at/2021/11/30/upgrade-to-ghost-v4-with-docker-compose/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants