我在通过mysqli_connect连接到远程数据库时遇到警告..它在与SQLYog连接时正在工作
Warning: mysqli_connect(): (HY000/2002): A connection attempt failed because
the connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond.
in C:\xampp\htdocs\connect\connect.php on line 9
代码::
$hostname="xxx.xx.xx.xx";
$username="xxxx";
$password="xxxx";
$database="xxxx";
$port = 3306;
$link = mysqli_connect($hostname, $username, $password, $database, $port);
if (!$link) {
die('Connection failed');
}