7

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)?

1 Answer 1

5

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';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.