php mysqli_connect: authentication method unknown to the client [caching_sha2_password]
1 min readAug 30, 2021
I am trying to login mysql by myphpadmin but it failed and show the error message as following.
php mysqli_connect: authentication method unknown to the client [caching_sha2_password]
I found the solution as following. Thanks for author.
If you’re on Windows and it’s not possible to use caching_sha2_password
at all, you can do the following:
- rerun the MySQL Installer
- select “Reconfigure” next to MySQL Server (the top item)
- click “Next” until you get to “Authentication Method”
- change “Use Strong Password Encryption for Authentication (RECOMMENDED)” to “Use Legacy Authentication Method (Retain MySQL 5.X Compatibility)
- click “Next”
- enter your Root Account Password in Accounts and Roles, and click “Check”
- click “Next”
- keep clicking “Next” until you get to “Apply Configuration”
- click “Execute”
The Installer will make all the configuration changes needed for you.