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

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

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



        
11条回答
  •  天命终不由人
    2020-11-22 04:08

    It's working for me (PHP 5.6 + PDO / MySQL Server 8.0 / Windows 7 64bits)

    Edit the file C:\ProgramData\MySQL\MySQL Server 8.0\my.ini:

    default_authentication_plugin=mysql_native_password
    

    Reset MySQL service on Windows, and in the MySQL Shell...

    ALTER USER my_user@'%' IDENTIFIED WITH mysql_native_password BY 'password';
    

提交回复
热议问题