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

前端 未结 11 2258
遥遥无期
遥遥无期 2020-11-22 03:40

I am using php mysqli_connect for login to a MySQL database (all on localhost)



        
11条回答
  •  花落未央
    2020-11-22 03:54

    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.

提交回复
热议问题