4

I was having this issue on my symfony3 project:

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

which is quite well-known: issue, issue, issue etc. It is even document on the PHP website there:

When running a PHP version before 7.1.16, or PHP 7.2 before 7.2.4, set MySQL 8 Server's default password plugin to mysql_native_password

That's why I went into the trouble of installing phpbrew, install php-7.3.4 through it, make it my default. However when I run php -r 'phpinfo();' | grep auth_. I see this result:

Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password

The PDO::__construct() error has not changed of course. I don't know why caching_sha2_password. So why did installing php-7.3.4 did not change anything?

Dharman
  • 30,962
  • 25
  • 85
  • 135
onda47
  • 615
  • 2
  • 6
  • 21
  • The [PHP mysqli requirements page](https://www.php.net/manual/en/mysqli.requirements.php) still says _caching_sha2_password plugin will be supported in a future PHP release_, so no PHP version seems to support _caching_sha2_password_. Obviously, short of providing an appropriate patch to PHP, you are not the only one to eventually switch back to 'mysql_native_password' auth strategy on your DB server. – code-kobold Apr 27 '19 at 12:17
  • 5
    I just can't believe that this is such an old issue but it hasn't been solved by PHP yet... – onda47 Jun 01 '19 at 13:18

0 Answers0