wowphp Posted February 25, 2007 Share Posted February 25, 2007 $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 https://forums.phpfreaks.com/topic/39999-solved-mysql_connect-using-it-on-different-server/ Share on other sites More sharing options...
btherl Posted February 25, 2007 Share Posted February 25, 2007 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 https://forums.phpfreaks.com/topic/39999-solved-mysql_connect-using-it-on-different-server/#findComment-193446 Share on other sites More sharing options...
wowphp Posted February 25, 2007 Author Share Posted February 25, 2007 I had to let the user use any host. Link to comment https://forums.phpfreaks.com/topic/39999-solved-mysql_connect-using-it-on-different-server/#findComment-193464 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.