I'm using cPanel server and I'm getting this error.
Lost connection to MySQL server at 'reading initial communication packet', system error: 0
Although i read his question Lost connection to MySQL server at 'reading initial communication packet', system error: 0 , I still didn't get the solution. when i run my php code, it returns
"Connection successfulLost connection to MySQL server at 'reading initial communication packet', system error: 0"
here's the code:
$con = mysql_connect('mysite.com:2082', '[email protected]', 'passwordhere', 'dbname');
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
else
{
echo "Connection successful";
}
if ($selected = mysql_select_db("dbname",$con) or die(mysql_error())){
echo "Your database name is dbname";
}
mysqli_close($con);
thanks for answering.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…