为什么Mysql会down掉,请各位帮帮忙?
0):
list($password)=mysql_fetch_row($result);
echo "password:".$password;
endif;
?>
朋友们,上面的代码是在php+mysql+apache+linux下的,
其中连接Mysql用php的mysql_pconnect('localhost','root','')函数,
本来想让它长时间连接,每次进去还是用这个连接,
但是实际上好像不会这样,它每次都重新建立一个新的连接,
所以多次后,会使Mysql再也打不开,要shut down后重开。
不知这是什么原因,
因为我看书上说 mysql_pconnect 与 mysql_connect 函数的区别
就是建立一个Persistent link,当脚本结束后,Link不会断开,
所以想用msyql_pconnect就不用总是去建连接,那样网页会快点,
但结果不一样,请大家发表一下意见……
谢谢了……
\---------------------------------------------------------------
mysql_pconnect()是php以apache方式按装才有用。否则和php_connect()一样。Published At