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

Docker mysql:latest keep mysql2 to authenticate with root user #777

Closed
pierre-aurele-martin opened this issue Apr 25, 2018 · 6 comments
Closed

Comments

@pierre-aurele-martin
Copy link

Hello,

I've noticed that this commit on docker mysql image made all my tests failed :

-			SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ;
+			ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ;

I was using Gitlab CI with mysql:latest and got this error :

Client does not support authentication protocol requested by server; consider upgrading MySQL client

Everything ok with older version of mysql image. This happened with mysql2:1.5.3 (latest)

Might help other people understanding why CI tests are suddenly failing :)

@sidorares
Copy link
Owner

can you check what auth method is used for that user?

Also what is the mysql server version when you pull mysql:latest ?

@sidorares
Copy link
Owner

might be related to #30 if that's insecure auth protocol
or to mysqljs/mysql#1962 if that's because of new mysql 8 auth

You might work around this by providing auth switch handler

@pierre-aurele-martin
Copy link
Author

Previous version, where auth was working (mysql:latest built 6 weeks ago) :

root@e7373c02f2da:/# mysql --version
mysql  Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using  EditLine wrapper
mysqld  Ver 5.7.21 for Linux on x86_64 (MySQL Community Server (GPL))

None working auth (mysql:latest built today) ;

mysql  Ver 8.0.11 for Linux on x86_64 (MySQL Community Server - GPL)
/usr/sbin/mysqld  Ver 8.0.11 for Linux on x86_64 (MySQL Community Server - GPL)

Auth method is the default one set up by Sequelize which I don't believe has anything special. No SSL here.

I had no trouble connecting otherwise so I do believe it's a client related issue.

@sidorares
Copy link
Owner

Ver 8.0.11

likely it's changes in mysql 8

from mysqljs/mysql#1962 :

First of all, MySQL 8.0.4 introduces a new default authentication plugin - caching_sha2_pasword. This is a breaking change and it will affect the entire handshake process, which currently does not work for new user accounts created using this plugin or, most importantly, not using a specific plugin at all (since it's now the default option). User accounts created with the mysql_native_password plugin will still work though.

If you can convert your user to mysql_native_password that might be the easiest way, otherwise you'll need to wait until mysqljs/mysql#1962 lands in mysqljs/mysql or somebody add implementation of caching_sha2_pasword here

@pierre-aurele-martin
Copy link
Author

Ok, thanks :)

@esakkik
Copy link

esakkik commented Jan 23, 2019

@sidorares It seems like the mysqljs/mysql#1962 still open and no resolution has been reached yet. Any updates ?

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

3 participants