klpang Posted February 22, 2008 Share Posted February 22, 2008 Dear All, I have a website need to connect a database in other webserver. In the scirpt, i put $sql = mysql_connect("xxx.xxx.xxx.xxx", "root", "xyzpassword") or die(mysql_error()) and the result is Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10061). The webserver is in linux platfrom, at first i taught that is block by firewall. when i stop firewall service, the progarm still prompt same result. please advise. Quote Link to comment Share on other sites More sharing options...
fenway Posted February 22, 2008 Share Posted February 22, 2008 Your user may not have access from this domain... or from any domain, for that matter. Quote Link to comment Share on other sites More sharing options...
aschk Posted February 22, 2008 Share Posted February 22, 2008 MySQL is probably rejecting external connections. This is something you will have to modify with the MySQL installation. Alternatively if this isn't the problem it's probably the MySQL user you have created. GRANT ALL ON *.* FOR 'root'@'%' HOWEVER, this is a warning, you are allowing external access to MySQL from the root user, this user has privileges to EVERYTHING, and thus is not a very clever nor secure thing to do. Quote Link to comment Share on other sites More sharing options...
fenway Posted February 22, 2008 Share Posted February 22, 2008 There's a --skip-networking option in the my.cnf file too -- in which case the grant won't help, AFAIK.... but you can troubleshoot by allowing *, but without ALL. Select privileges alone will allow you to log the IP. Quote Link to comment Share on other sites More sharing options...
klpang Posted February 25, 2008 Author Share Posted February 25, 2008 Thanks a lot. But still can't connect to database. already add port 3306 (tcp/udp) in iptables, still the same result. Is there any way to connect. For example mysql_connect(publicaddress/domainname, "root", "password"); Result Can't connect to MySQL server on 'publicaddress/domainname' (10061) Please advise. Quote Link to comment Share on other sites More sharing options...
fenway Posted February 25, 2008 Share Posted February 25, 2008 And you check the my.cnf file as well as the grants table? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.