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

Unable to log in with MySQL 8.0.11; caching_sha2_password authentication method unknown to the client #14220

Open
ibennetch opened this Issue Apr 21, 2018 · 20 comments

Comments

Projects
None yet
@ibennetch
Copy link
Member

ibennetch commented Apr 21, 2018

With MySQL 8.0.11 I'm unable to log in with users that had been working fine under previous versions (at least 8.0.0, perhaps even more recent than that).

mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]

mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client

See also https://dev.mysql.com/doc/refman/8.0/en/authentication-plugins.html

I'm using QA_4_8.

@ibennetch

This comment has been minimized.

Copy link
Member Author

ibennetch commented Apr 21, 2018

@ibennetch

This comment has been minimized.

Copy link
Member Author

ibennetch commented Apr 21, 2018

Possibly related: #14217

@ibennetch ibennetch added this to the 4.8.1 milestone Apr 21, 2018

@ibennetch

This comment has been minimized.

Copy link
Member Author

ibennetch commented Apr 21, 2018

A point release seems like a bad time to make changes to the authentication protocols. I've been testing with 8.0.4-rc which works fine, and now that 8.0.11 is out it causes problems.

@Gemorroj

This comment has been minimized.

Copy link
Contributor

Gemorroj commented Apr 21, 2018

@ozeer

This comment has been minimized.

Copy link

ozeer commented Apr 30, 2018

I met this issue a few days before, is there anyone who solve this problem? thanks a lot~

@ibennetch ibennetch changed the title Unable to log in with MySQL 8.0.11 Unable to log in with MySQL 8.0.11; caching_sha2_password authentication method unknown to the client May 10, 2018

@mauriciofauth

This comment has been minimized.

Copy link
Member

mauriciofauth commented May 10, 2018

There is not much we can do about it right now, as apparently PHP still does not support the caching_sha2_password authentication method.

However, I was able to connect successfully using other authentication methods such as mysql_native_password and sha256_password.

@mauriciofauth

This comment has been minimized.

Copy link
Member

mauriciofauth commented Jun 14, 2018

PHP developers started adding caching_sha2_password support. Once a version of PHP with this support is released, we can add support for caching_sha2_password on our side as well.

@ibennetch ibennetch modified the milestones: 4.8.2, 4.8.3 Jun 22, 2018

@rmanibus

This comment has been minimized.

Copy link

rmanibus commented Jun 22, 2018

Upgrading to PHP7.2.7 solved the issue for me.

@donpaul120

This comment has been minimized.

Copy link

donpaul120 commented Jul 13, 2018

@rmanibus i have php 7.2.7 and mysql Ver 8.0.11 but im wondering why it doesn't work still.

@Apollo725

This comment has been minimized.

Copy link

Apollo725 commented Aug 14, 2018

I expired root user and reinstall all of the mysql workspace, then I got this error.
Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in /Volumes/Workspace/workspace/test/php_test/Simple-PHP-Login/add.php on line 3

I was using mac and didn't use xampp.

@ibennetch ibennetch modified the milestones: 4.8.3, 4.8.4 Aug 22, 2018

@hkrware

This comment has been minimized.

Copy link

hkrware commented Oct 20, 2018

php-fpm 7.2.11 and mysql 8.0.12 both on centos 7.5.1804 x64 and not working with phpmyadmin 4.8.3

@mauriciofauth

This comment has been minimized.

Copy link
Member

mauriciofauth commented Oct 24, 2018

As mentioned earlier, there is not much we can do about it at this time.
The mysqlnd library does not support the caching_sha2_password authentication method yet.
An alternative would be to use the libmysqlclient library, however PHP does not support the libmysqlclient library of MySQL 8 yet.

So the real alternative, for now, is to use another authentication method other than caching_sha2_password.

@SugarD-x

This comment has been minimized.

Copy link

SugarD-x commented Oct 29, 2018

I'm not sure if this helps anything, but on MySQL Server 8.0.12, I'm getting this error ONLY when upgrading to PHP 7.2.11. (It doesn't just affect PHPMyAdmin). When I revert back to PHP 7.2.8, I have no problems. Seems a bit odd that a newer version of PHP would cause this.

I know downgrading PHP is probably not the greatest idea, but if this helps anyone as a temporary solution, it is there.

@mauriciofauth

This comment has been minimized.

Copy link
Member

mauriciofauth commented Oct 30, 2018

@SugarD-x This is related to commit php/php-src@d6e81f0 which was later reverted by php/php-src@03740ef.

@SugarD-x

This comment has been minimized.

Copy link

SugarD-x commented Oct 30, 2018

@mauriciofauth Thank you! That definitely explains my issue.

@doveraudio

This comment has been minimized.

Copy link

doveraudio commented Dec 27, 2018

I used this to get it back when I started a new dev server with mysql 8 and php 7.3
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY 'PASSWORD';

it seems to be working ok so far.

@SugarD-x

This comment has been minimized.

Copy link

SugarD-x commented Dec 27, 2018

@doveraudio That is the workaround, not an actual fix. That just updates your root database login to use the old password authentication method, rather than this new one.

@p8ul

This comment has been minimized.

Copy link

p8ul commented Jan 3, 2019

https://stackoverflow.com/questions/49948350/phpmyadmin-on-mysql-8-0

I was able to connect successfully using other authentication methods such as mysql_native_password
By running this command on mysql on the terminal.
cd /usr/local/mysql/bin
./mysql -u root -p
Run command below on msql terminal
CREATE USER sky@localhost IDENTIFIED WITH mysql_native_password BY 'password'

@SugarD-x

This comment has been minimized.

Copy link

SugarD-x commented Jan 3, 2019

As I just said previously:

That is the workaround, not an actual fix. That just updates your root database login to use the old password authentication method, rather than this new one.

@ibennetch ibennetch modified the milestones: 4.8.5, 4.8.6 Jan 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment