PHP MySQLi_Connect: Authentication Method Unknown to the Client [Caching_Sha2_Password]

php mysqli_connect: authentication method unknown to the client [caching_sha2_password]

As of PHP 7.4, this is no longer an issue. Support for caching_sha2 authentication method has been added to mysqlnd.


Currently, PHP mysqli extension do not support new caching_sha2 authentication feature.
You have to wait until they release an update.

Check related post from MySQL developers: https://mysqlserverteam.com/upgrading-to-mysql-8-0-default-authentication-plugin-considerations/

They didn't mention PDO, maybe you should try to connect with PDO.

PHPMyAdmin authentication method

PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client
Try the second answer above. (Change the default authentication method on your MySQL installation).

Or... update PHP (this is the real source of the problem.) Your version of PHP has an old client library that can't connect to mysql using the latest default authentication method. That's only mildly surprising with stretch which is 3 years old.

Why I can't connect to a MySQL 5.3.36 shared server using mysqli_connect and PHP 7.4, but it will work using php 7.1?

After using mysql in terminal, I reviewed my user passwords and I got a "password needs to be 41 character hash" error message. I simply changed my passwords and it is now working. It seems that something has changed in how passwords are stored or the bug was fixed. Thanks.



Related Topics



Leave a reply



Submit