PHP Lamp错误,本地服务器的连接被拒绝

时间:2019-11-10 04:16:43

标签: php mysql database mysqli lamp

请问有关通过mysqli连接到mysql的php LAMP的帮助,

<?php
$servername = "192.168.30.145";
$username = "root";
$password = "NOYB-2020";

// Create connection
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>

这是php test.php

的错误
PHP Warning:  mysqli::__construct(): (HY000/2002): Connection refused in /var/www/html/portfolio-designer/signup.php on line 7
Connection failed: Connection refused

0 个答案:

没有答案