I moved my site to godaddy server, but the SQL connection is not working even with adequate changes which was working perfectly fine before
<?php
$link = mysql_connect('www.xxxxx.com', 'phpadminusername', 'phpadminpasswor');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
/*echo 'Connected successfully';*/
echo "DB CONNECTION :<font color='green'>ACTIVE</font>";
?>
It is showing an error
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /home/content/58/9508458/html/psychiatric/private.php on line 196 Could not connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 111
fixed by updating to hostname in account manager specifically given by godaddy.com .. not just the domain name
That probably means mySQL is configured to only listed to requests from a particular hosts (or hosts). You can tell MySQL to only accept packets from particular IP addresses (usually localhost, but it may be wider on GoDaddy - not sure as I don't use them).
Check your connection string - specifically the 'www.xxxxx.com' bit. This might need to be 'localhost' or a specific IP address.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With