📅  最后修改于: 2023-12-03 15:17:49.015000             🧑  作者: Mango
这个异常通常出现在尝试连接 MySQL 数据库的时候,表示连接的数据访问权限有问题。
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";
// 创建连接
$conn = mysqli_connect($servername, $username, $password, $dbname);
// 检查连接是否有效
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
?>