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

前端 未结 11 2229
遥遥无期
遥遥无期 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:57

    Like many many people, I have had the same problem. Although the user is set to use mysql_native_password, and I can connect from the command line, the only way I could get mysqli() to connect is to add

    default-authentication-plugin=mysql_native_password

    to the [mysqld] section of, in my setup on ubuntu 19.10, /etc/mysql/mysql.conf.d/mysqld.cnf

提交回复
热议问题