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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.