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?