mikelegg

Well-Known Member
Mar 29, 2005
330
3
166
I'm trying to remotely access a mysql database on server 111.111.111.111 from server 222.222.222.222.

I've logged into the cPanel account on server 111.111.111.111 and added 222.222.222.222 to the Remote Database Access Hosts. (As well as %.domain.com where domain .com.is the actual domain on 222.222.222.222 that will be accessing the database)

I'm using the same username/password that I use to access the database locally on 111.111.111.111. (without any problems)

But when It try to access the database from the remote server via PHP using -
mysql_connect('111.111.111.111', 'username', 'password');

I get the error -
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 111.111.111.111 (4)

I know the database is running fine and I've read every post I can find on this subject, but I can't get it to work.

I'd appreciate any suggestions.
 

jayh38

Well-Known Member
Mar 3, 2006
1,213
0
166
Since you aren't seeing the server at all according to your error message, your host is most likely running a firewall and blocking port 3306 from the open public.

They would probably grant access through the firewall if you explain your situation. If not, seek another host. I do not publicly open 3306 either but I do facilitate active client connections.

Good luck