Bug #78981 [Com]: Can't connect to MySQL 8 if server's auth plugin does not match user's one

From: Date: Thu, 19 Dec 2019 15:38:25 +0000
Subject: Bug #78981 [Com]: Can't connect to MySQL 8 if server's auth plugin does not match user's one
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224424@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78981&edit=1 ID: 78981 Comment by: txigreman at hotmail dot com Reported by: txigreman at hotmail dot com Summary: Can't connect to MySQL 8 if server's auth plugin does not match user's one Status: Open Type: Bug Package: MySQL related Operating System: Docker php:7.4-fpm image PHP Version: 7.4.0 Block user comment: N Private report: N New Comment: Yeah, as I stated in the description it does work if both the server and the user authentication plugin match. You could also make it work changing the server config the variable "default_authentication_plugin" from "caching_sha2_password" to "mysql_native_password" and restarting the server. But it's just a workaround. PHP should be using the authentication plugin configured for the user instead of the server's default one. Previous Comments: ------------------------------------------------------------------------ [2019-12-19 11:40:23] drtechno at mail dot com Well, That entry is within Mysql to set what type.for your user, you would change ​”mysql_native_password” to “caching_sha2_password“ for example, to change the user , "username" to a caching sha2 password using "YOUR_PASSWORD" as the new password you would pass this SQL statement: ALTER USER username IDENTIFIED WITH caching_sha2_password BY 'YOUR_PASSWORD'; ------------------------------------------------------------------------ [2019-12-17 17:34:03] txigreman at hotmail dot com Description: ------------ I have a MySQL 8 server configured to use caching_sha2_password as default authentication plugin, but it's overrode for a specific user with mysql_native_password. When I try to open a connection to the database, using mysqli or pdo, I get this error: Unexpected server response while doing caching_sha2 auth: 109 It does work if I change the server and/or user configuration to make them match. I think PHP should query the user's authentication plugin instead of using the server's default one. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78981&edit=1

« previous php.bugs (#224424) next »