我试图连接到我的mysql版本8.0.11数据库在zend服务器版本7.2.10使用php,但我无法连接它
Warning: mysqli::__construct(): Unexpected server respose while doing caching_sha2 auth: 109 in C:\Program Files (x86)\Zend\Apache24\htdocs\connectdatabase.php on line 7
Warning: mysqli::__construct(): MySQL server has gone away in C:\Program Files (x86)\Zend\Apache24\htdocs\connectdatabase.php on line 7
Warning: mysqli::__construct(): (HY000/2006): MySQL server has gone away in C:\Program Files (x86)\Zend\Apache24\htdocs\connectdatabase.php on line 7
Connection failed :MySQL server has gone away
当我尝试运行代码时,收到以下警告。
我找了又试 ALTER USER 'username'@'hostname' IDENTIFIED WITH mysql_native_password BY "userpassword"
但对我不起作用
<?php
$servername = "localhost";
$username = "root";
$password = "hello";
$conn = new mysqli($servername,$username,$password);
if(mysqli_connect_error())
{
die("Connection failed :" . mysqli_connect_error());
}
echo "CONNECTED SUCCESSFULLY";
?>
1条答案
按热度按时间8yparm6h1#
尝试缓存\u sha2 \u密码: