I am trying to connect to MySQL database which is on another server using PHP connection. I am getting the following error and can not figure it out.
This is the error when I include the port:
Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'xxxxxx.db.0000095.hostedresource.com:3306' (25) in /home/xxxxxx/public_html/tools/include/db_connect.php on line 3 Failed to connect to MySQL: Unknown MySQL server host 'xxxxxxxx.db.0000095.hostedresource.com:3306' (25)
This is my error when not using the port:
Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2003): Unknown MySQL server host 'xxxxxx.db.0000095.hostedresource.com' (110) in /home/xxxxxx/public_html/tools/include/db_connect.php on line 3 Failed to connect to MySQL: Unknown MySQL server host 'xxxxxxxx.db.0000095.hostedresource.com' (110)
This is my db_connect file:
<?
$con=mysqli_connect("xxxxxx.db.0000095.hostedresource.com","xxcorrectxx","xxcorrectxx",
"xxcorrectxx");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>
Is this a possible firewall issue on the server I have the include file on? This db connect file is working fine on other domains I have. Please tell me if you can see a fix for this. Thank you.