假设我们服务器的 ip 是 55.555.555.55。还可以说我们有一个 mysql 用户'user'@'localhost'
那么,为什么这会返回权限错误
$mysql_server = "55.555.555.55";
$mysql_user = "";
$mysql_password = "";
$mysql_db = "";
$mysqli = new mysqli($mysql_server, $mysql_user, $mysql_password, $mysql_db);
if ($mysqli->connect_errno) {
printf("Connection failed: %s \n", $mysqli->connect_error);
exit();
}
$mysqli->set_charset("utf8");
但这并不
$mysql_server = "localhost";
$mysql_user = "";
$mysql_password = "";
$mysql_db = "";
$mysqli = new mysqli($mysql_server, $mysql_user, $mysql_password, $mysql_db);
if ($mysqli->connect_errno) {
printf("Connection failed: %s \n", $mysqli->connect_error);
exit();
}
$mysqli->set_charset("utf8");
55.555.555.55 和 localhost 不是一回事吗?这不应该是一个问题。