PHP With MySQL 8.0+ Error: the Server Requested Authentication Method Unknown to the Client

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.

PHP 7.2.2 + mysql 8.0 PDO gives: authentication method unknown to the client [caching_sha2_password]

If you want to use MySQL >= 8 and you don't care about caching_sha2_password, just select the second option when you install.

Sample Image



Related Topics



Leave a reply



Submit