【发布时间】:2019-07-18 07:12:20
【问题描述】:
正在尝试连接到本地 Mysqli DB。
数据库连接:
<?php $con= new mysqli("localhost","Kobe24","Kobei987","Bkn_Data");
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
返回:
Warning: mysqli::__construct(): (HY000/2054): The server requested authentication method unknown to the client in C:\Apache24\htdocs\poc\practice_project\database_connection.php on line 1
Connection failed: The server requested authentication method unknown to the client
任何反馈都会有所帮助。一直在研究这个问题,但没有明确的解决方案。
【问题讨论】:
-
如果您可以提供有关您使用的用户的更多信息,这将很有用。您能否以 root 身份登录 mysql(例如从控制台或 phpmyadmin)并发布
select * from mysql.user where User = YOURUSERNAME的输出 -
尝试像这里stackoverflow.com/questions/44946270/…这样更改MySQL Auth方法