Jump to content

[SOLVED] mysql_connect? using it on different server?


wowphp

Recommended Posts

$link = mysql_connect('127.0.0.1:3307', 'mysql_user', 'mysql_password');
if (!$link) {
   die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);

 

this works but when i use my real ip: 65.28.243.16 it won't work, I have set up my routor. Then I tired my lan ip, no work

ERROR: Can't connect to MySQL server on '198.168.123.112' (10061)

so do i have to enable it in mysql to aloud it to work?

It may also be your firewall preventing access.  If you have any firewall software installed, try disabling it for a moment to test it (or enabling access to port 3307).

 

Another thing to try is running "telnet 198.168.123.112 3307" from the command prompt (that's Start -> Run in XP).  If the connection fails, then either it is being blocked, or the server is configured not to accept connections on that IP.

 

Unfortunately I can't help with getting the server to accept connections if it doesn't, since I'm not that familiar with mysql.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.