aspendigital / docker-octobercms

Dockerized October CMS: PHP, Composer, October core and dependencies
MIT License
150 stars 54 forks source link

MySQL install results in unknown athentication method? #15

Closed nurikabe closed 5 years ago

nurikabe commented 5 years ago

docker-compose exec web php artisan october:up

[Illuminate\Database\QueryException]
  SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema =
  octobercms and table_name = migrations)

Am I doing something wrong?

petehalverson commented 5 years ago

I'm curious if there may be a race condition on the availability of the mysql service. Assuming you're using the database example for mysql docker-compose.yml, the mysql container will create a new octobercms database each time it starts up.

You must wait for that process to complete before running docker-compose exec web php artisan october:up

Watch the output of the mysql container logs docker-compose logs -f. Once you see 'ready for connections' in the logs, try the october:up cmd.

petehalverson commented 5 years ago

Also, if you'd like the database to persist, you can add a bind mount volume for /var/lib/mysql to the mysql service in your docker-compose.yml

   volumes:
      - ./db:/var/lib/mysql
nurikabe commented 5 years ago

Ah, it looks like the server is asking the client to use some kind of newer caching_sha2_password auth protocol. PHP mysqli doesn't seem to support this yet. (And neither do DbVis nor HeidiSQL as far as I can tell.)

Some details: https://stackoverflow.com/questions/49194719/authentication-plugin-caching-sha2-password-cannot-be-loaded

Going back to image: mysql:5.7 seems to work.

petehalverson commented 5 years ago

Thanks for the heads up.