unidox Posted January 1, 2009 Share Posted January 1, 2009 I have this domain: http://daskeet.com/, and I am trying to have it remotely connect to a sql db on the deviantgaming.net server. I have this code: <?php mysql_connect("deviantgaming.net", "username", "password") or die(mysql_error()); mysql_select_db("table") or die(mysql_error()); ?> But I am getting the error: Can't connect to MySQL server on 'deviantgaming.net' (10060) On cpanel for deviantgaming.net I added both the domain and domain ip to the remote sql allowable ips. Any ideas? Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted January 1, 2009 Share Posted January 1, 2009 Some hosts will force intranet IP's for their SQL server and most of the time the SQL server does not share the same Host address as the server itself this is really common among shared hosting providers. I can't really tell you because I don't know how your hosting is set up. I think I remember this being true with 1and1 hosting. and it is probably true among other shared hosting providers. Quote Link to comment Share on other sites More sharing options...
unidox Posted January 1, 2009 Author Share Posted January 1, 2009 So how do I fix it? Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted January 1, 2009 Share Posted January 1, 2009 That's just the point some hosting providers do this to prevent people from connecting to their SQL servers from domains that they do not host. Quote Link to comment Share on other sites More sharing options...
revraz Posted January 2, 2009 Share Posted January 2, 2009 Use the host that has the database to put your code on. So how do I fix it? Quote Link to comment Share on other sites More sharing options...
trq Posted January 2, 2009 Share Posted January 2, 2009 Provided you have enough permission you could add a new user to your database allowing the remote connection. eg; GRANT ALL PRIVILEGES ON *.* TO 'foo'@'remotehostiporhostname' IDENTIFIED BY 'pass' WITH GRANT OPTION; 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.