Friday, March 12, 2010

system error: 111 + MySQL

While making the db connection from php to mysql, this error normally pops out.
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in ..

Basically, the server host name we need to keep it as the localhost.
if you have made the connection like this : 

mysql_connect("aaa", "root", "bbb") or die(mysql_error()); 

Change it into :

mysql_connect("localhost", "root", "bbb") or die(mysql_error()); 

No comments:

Post a Comment