squiblo Posted January 18, 2012 Share Posted January 18, 2012 All my web pages connect to MySQL before the html tag by including a php file like so... <?php session_start(); require_once "php/connections/dbconnect.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" id="#top"> <head> All pages connect successfully apart from one, that does not manage to connect about 1 in 5 times. This is the error that I am getting... Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connecti (trying to connect via tcp://46.183.8.87:3306) in C:\xampp\htdocs\socialnews\php\connections\dbconnect.php on line 3 Warning: mysql_connect() [function.mysql-connect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\xampp\htdocs\socialnews\php\connections\dbconnect.php on line 3 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. And this is the contents on the dbconnect.php... <?php //CONNECT TO DATABASE $connect = mysql_connect("*****", "*****", "*****") or die(mysql_error()); $db = mysql_select_db("*****", $connect) or die(mysql_error()); ?> I have no idea where to start looking because it's such a strange problem. Any idea of what I need to check? Any tips will be appreciated! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/255287-a-connection-attempt-failed/ Share on other sites More sharing options...
dzelenika Posted January 18, 2012 Share Posted January 18, 2012 There is not server at this address / port try to telnet from your web server to db by typing: telnet 46.183.8.87 3306 and you'll see Quote Link to comment https://forums.phpfreaks.com/topic/255287-a-connection-attempt-failed/#findComment-1308889 Share on other sites More sharing options...
squiblo Posted January 18, 2012 Author Share Posted January 18, 2012 I'm current running on a windows machine, telnet is not recognized. Quote Link to comment https://forums.phpfreaks.com/topic/255287-a-connection-attempt-failed/#findComment-1308894 Share on other sites More sharing options...
dzelenika Posted January 18, 2012 Share Posted January 18, 2012 you can install it on turn windows/features on/off Quote Link to comment https://forums.phpfreaks.com/topic/255287-a-connection-attempt-failed/#findComment-1308902 Share on other sites More sharing options...
squiblo Posted January 18, 2012 Author Share Posted January 18, 2012 This is what I got from telnet 8 5.1.56-log-oÞ"5%YpGP?%=E!r=xdo!S^??Got packets out of order Connection to host lost. EDIT: After a few more tests "Got packets out of order" does not appear Quote Link to comment https://forums.phpfreaks.com/topic/255287-a-connection-attempt-failed/#findComment-1308909 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.