我的网站需要10分钟才能加载

时间:2013-04-13 15:57:36

标签: php mysql

我的网站需要很长时间才能加载,并出现以下错误:

Warning: mysql_connect(): MySQL server has gone away in C:\xampp\htdocs\test\inc\scripts\mysql_connect.inc.php on line 9

Warning: mysql_connect(): Error while reading greeting packet. PID=2256 in C:\xampp\htdocs\test\inc\scripts\mysql_connect.inc.php on line 9

Warning: mysql_connect(): MySQL server has gone away in C:\xampp\htdocs\test\inc\scripts\mysql_connect.inc.php on line 9

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\test\inc\scripts\mysql_connect.inc.php on line 9

我正在使用的代码:

<?php
$conn_error = 'Colud not connect.';

$mysql_host = "localhost:8080";
$mysql_user = "Harry";
$mysql_pass = "";

$mysql_db = 'testsite' ;
mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die("Couldn't Connect") ;
mysql_select_db($mysql_db) or die($conn_error);

echo 'Connected!' ;

?>

知道为什么会这样吗?

1 个答案:

答案 0 :(得分:1)

只是意味着您的网站无法访问MySQL服务器。也许它没有开始,或者如果它没有正确工作或无法达到。

Doc:http://dev.mysql.com/doc/refman/5.0/en/gone-away.html