在使用国外空间或者服务器不稳定时,MySQL总是链接超时。出现:ECSHOP info: Can’t Connect MySQL Server(localhost:3306)!

我们可把ECshop这个出错提示语句
换成“服务器繁忙,请刷新重试!”
这样可以友好提示,提高用户体验。

办法如下:

找到include/cls_mysql.php 代码

function ErrorMsg($message = ”, $sql = ”)
{
if ($message)
{
echo “<b>ECSHOP info</b>: $messagenn<br /><br />”;
//print(‘<a href=”http://faq.comsenz.com/?type=mysql&dberrno=2003&dberror=Can%27t%20connect%20to%20MySQL%20server%20on” target=”_blank”>http://faq.comsenz.com/</a>’);
}
else
{
echo “<b>MySQL server error report:”;
print_r($this->error_message);
//echo “<br /><br /><a href=’http://faq.comsenz.com/?type=mysql&dberrno=” . $this->error_message[3][‘errno’] . “&dberror=” . urlencode($this->error_message[2][‘error’]) . “‘ target=’_blank’>http://faq.comsenz.com/</a>”;
}
exit;
}

把ECSHOP info后面的 $messagenn 改成:服务器繁忙,请刷新重试!