php mysqli_connect: authentication method unknown to the client [caching_sha2_password]

胡家維 Hu Kenneth
1 min readAug 30, 2021

--

source : https://stackoverflow.com/questions/50026939/php-mysqli-connect-authentication-method-unknown-to-the-client-caching-sha2-pa

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:

  1. rerun the MySQL Installer
  2. select “Reconfigure” next to MySQL Server (the top item)
  3. click “Next” until you get to “Authentication Method”
  4. change “Use Strong Password Encryption for Authentication (RECOMMENDED)” to “Use Legacy Authentication Method (Retain MySQL 5.X Compatibility)
  5. click “Next”
  6. enter your Root Account Password in Accounts and Roles, and click “Check”
  7. click “Next”
  8. keep clicking “Next” until you get to “Apply Configuration”
  9. click “Execute”

The Installer will make all the configuration changes needed for you.

--

--

胡家維 Hu Kenneth
胡家維 Hu Kenneth

Written by 胡家維 Hu Kenneth

撰寫任何事情,O型水瓶混魔羯,咖啡愛好者,Full stack/blockchain Web3 developer,Founder of Blockchain&Dapps meetup ,Udemy teacher。 My Linktree: https://linktr.ee/kennethhutw

No responses yet