[英]getaddrinfo failed: No such host is known
I tried to connect to phpMyAdmin database but encounter an error Warning: mysqli::mysqli(): php_network_getaddresses: getaddrinfo failed: No such host is known . 我尝试连接到phpMyAdmin数据库,但遇到错误警告:mysqli :: mysqli():php_network_getaddresses:getaddrinfo失败:此类主机未知 。 Below coding is the one that I currently use.
下面的编码是我当前使用的编码。
$servername = "http://localhost:8080";
$username = "root";
$password = "";
$db = "dbLogin";
$conn = new mysqli($servername, $username, $password, $db);
if ($conn->connect_error) {
die("Connection failed: ".$conn->connect_error);
}
else {
echo "Connection success!";
}
When I run my system, It will still show the message connection success! 当我运行系统时,它将仍然显示消息连接成功! but together with the error I mentioned.
但连同我提到的错误。
replace server name from 从替换服务器名称
$servername = "http://localhost:8080";
to 至
$servername = "localhost";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.