I'm trying to connect to a remote MySQL database. My "local" server is my employer’s server that doesn't have MySQL installed, but does have PHP installed with superglobal arrays enabled. My remote server is my personal server with PHP and MySQL installed. I've never had a problem connecting to "localhost" on my personal server and I've never attempted a remote connection. Here's the connection part of my script:
$db = mysql_pconnect ("123.123.123.123", "user", "pass");
I've also tried using the domain name, and adding the MySQL port to both IP and domain name.
When I access the script it takes forever before it finally informs me that it couldn't connect. Here's the error:
Warning: Can't connect to MySQL server on '123.123.123.123' (78) in /path/index.php on line 13
To complicate matters I tried moving the script to my personal server leaving the host as the IP address and it too didn't work. I even tried domain names of other virtual hosts on the same server thinking it didn't like a "remote" connection from within the domain (confused?).
I'm also using PHPMyAdmin to manage MySQL. One question I had was regarding the user accounts. One of the options for Users is to enter a value for "Host". I've always kept user account hosts as "localhost". I set the user host value for the account that accesses the new database to "%" which I believe will accept a connection from any host. That also didn't work. I guess my question is, if that's the problem, what should the host value be?
There may be a firewall issue here at my work. Unfortunately, trying to find out anything helpful is impossible.
Any tips on troubleshooting this would be great!
Thanks - jon