Failed to connect to MySQL: No such file or directory

MySQL is unable to connect, can I please have some pointers so where I’m going wrong? the error is as follows;

Failed to connect to MySQL: No such file or directory

and my code is;
// Create Connection
$con=mysqli_connect(“localhost”,“epiz_24053078”,“HiddenByMOD”,“epiz_24053078_Loyalty”);
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

the code seems right and the connection details seem to be right too. Thank you!

The host is not localhost, and should look like sql123.epizy.com.
Don’t post your hosting account password on this forum! Change it to another one because the one you posted is not secure anymore.

1 Like

I reset your hosting account password. Feel free to change it again, but do not use the password you just shared publicly on here.

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