This forum is no longer active. Please post your questions to our new community site

Forums MAMPStack

Mamp Stack - Connect to remote mysql issue

Subscribe to Mamp Stack - Connect to remote mysql issue 2 post(s), 1 voice

 
Avatar DLo 8 post(s)

I have not changed any configuration, but it seems that all of a sudden I cannot connect to remote databases via php using FQDN urls for the db host. However, the IP still works. This issue is recent only a couple of days. I am not sure if an upgrade on the remote servers is the cause of if it is my mamp stack.

This does not work:

$link = mysql_connect($fqdn_host, $user, $pass);
if (!$link) {
die(‘Could not connect: ’ . mysql_error());
}
echo ’Connected successfully’;
mysql_close($link);

This however, works:

$link = mysql_connect($ipaddress_host, $user, $pass);
if (!$link) {
die(‘Could not connect: ’ . mysql_error());
}
echo ’Connected successfully’;
mysql_close($link);

Weird thing is that from other linux and windows machines the FQDN works

 
Avatar DLo 8 post(s)

Also to confirm this is a PHP specific issue:

~$ mysql -h somehost.net -u myuser -pSomePass -e “show databases”

This totally works.

Forums MAMPStack