I got this error:
PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]
I know that MySQL changed their authentication method in version 8, but how should I update to the latest driver and connect with it in doctrine (Symfony 4)?
The answer of 黃皓哲 on this post helped me out: php mysqli_connect: authentication method unknown to the client [caching_sha2_password]
What it says is that the authentication system has changed on the last versions of MySQL, so when you install it it might ask you to chose if you want to use the old system or the new one, if you chose the new one you need to specify for the moment that the user for Doctrine has to use the old system. To do so you need to do the following:
ALTER USER 'mysqlUsername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mysqlUsernamePassword';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With