由于要做动态网站,所以要测试是否能连接MySQL。
防火墙已经允许MySQL通信、MySQL已经授权允许远程访问。
操!连不了!
<?php
$host="我家域名";
$user="账号";
$password="密码";
$conn=mysqli_connect($host,$user,$password);
if (!$conn)
echo "连接失败!";
else
echo "连接成功!";
?>求大神救救我!
防火墙已经允许MySQL通信、MySQL已经授权允许远程访问。
操!连不了!
<?php
$host="我家域名";
$user="账号";
$password="密码";
$conn=mysqli_connect($host,$user,$password);
if (!$conn)
echo "连接失败!";
else
echo "连接成功!";
?>求大神救救我!
Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in D:\Apache\htdocs\main\test.php on line 2Warning: mysqli_connect(): (HY000/2054): The server requested authentication method unknown to the client in D:\Apache\htdocs\main\test.php on line 2