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

Set better defaults for mysql 8 auth plugin #2135

Closed
ericpugh opened this issue Apr 6, 2020 · 3 comments
Closed

Set better defaults for mysql 8 auth plugin #2135

ericpugh opened this issue Apr 6, 2020 · 3 comments
Assignees
Labels
bug Something aint working right!
Milestone

Comments

@ericpugh
Copy link

ericpugh commented Apr 6, 2020

System: Mac OSX - Mojave 10.14.6
Docker Desktop: 2.2.0.4
Lando: v3.0.0-rrc.2

I'm using the Drupal 8 recipe with MySQL 8:

name: example
recipe: drupal8
config:
  webroot: web
  php: '7.3'
  via: nginx
  database: mysql:8.0
  drush: "*"
  xdebug: false

I'm having issues connecting to MySQL. For example, trying to install a site with lando drush site:install --existing-config --yes I get the following error:

 [warning] Failed to drop or create the database. Do it yourself before installing. ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib/x86_64-linux-gnu/mariadb18/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

It seems that MySQL 8 changed the default auth plugin to "caching_sha2_password", so maybe a solution is to set "MYSQL_AUTHENTICATION_PLUGIN" to "mysql_native_password" like this bitnami example?

@ericpugh ericpugh added the bug Something aint working right! label Apr 6, 2020
@ericpugh
Copy link
Author

ericpugh commented Apr 6, 2020

I seemed to be able to get around this by updating my landoFile:

name: example
recipe: drupal8
config:
  webroot: web
  php: '7.3'
  via: nginx
  drush: "*"
  xdebug: false
services:
  database:
    type: mysql:8.0
    config:
      database: etc/config/mysql.cnf

and adding a custom configuration at etc/config/mysql.cnf that looks like this:

[mysqld]
max_allowed_packet=32M
default-authentication-plugin=mysql_native_password

@pirog pirog added this to the 3.0.0-rrc.5 milestone Apr 6, 2020
@pirog pirog self-assigned this Apr 6, 2020
@pirog pirog changed the title Unable to connect to MySQL 8.0 in Drupal8 recipe Set better defaults for mysql 8 auth plugin Apr 6, 2020
@pirog
Copy link
Sponsor Member

pirog commented Apr 6, 2020

@ericpugh we actually use that bitnami image under the hood so should be pretty easy to implement this. I'm going to increase the scope of this issue so its generic to the mysql:8 service. I think what we want to do is

  • Have the authentication plugin be configurable
  • Set a sane default for this given the context eg use mysql_native_password for Drupal/WordPress etc.

@pirog
Copy link
Sponsor Member

pirog commented Apr 7, 2020

Alright @ericpugh this will be fixed in the next edge release! Even updated our Drupal 8 test to verify this.
https://github.com/lando/lando/tree/master/examples/drupal8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something aint working right!
Projects
None yet
Development

No branches or pull requests

2 participants