Unable to connect to mysql database

$conn = mysqli_connect("sql109.epizy.com", "epiz_31265295", "******", "epiz_31265295_sevensports");
if ($conn->connect_error) {

  die("Connection failed: " . $conn->connect_error);

}

echo "Connected successfully";

?>

i am very sure that the data to connect mysql database is correct there is no credential mistake
my error:

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 D:\xampp\htdocs\php programs\file_selector\connection.php on line 9

Make sure all your file paths are correct. xampp is not used here.

4 Likes

How local files can get access?
Host files using ftp…then change file URL in ur script

1 Like

Please note that our database servers are only accessible from within our hosting accounts. It’s not possible to connect to our database servers through code running on your own computer.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.