【发布时间】:2018-10-09 17:15:12
【问题描述】:
我正在运行 php 7.3。在运行以下代码时:
$conn = mysqli_connect($servername, $username, $hashed_password);
if(!$conn){
die("Connection failed: " . mysqli_connect_error());
}
我得到的输出是:
Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in C:\localhost\mysql.php on line x
Warning: mysqli_connect(): (HY000/2054): The server requested authentication method unknown to the client in C:\localhost\mysql.php on line x
Connection failed: The server requested authentication method unknown to the client.
修复?
【问题讨论】:
-
MySQL remote connection fails with “unknown authentication method” 可能重复。还要弄清楚具体的mysql客户端库和服务器版本; PHP 8 还不存在。