1

我最近在共享主机上使用我拥有的备用域名开发了一个 WordPress 站点。我已经将该站点移至所有者的家庭服务器,现在当他们尝试编辑该站点时,正在生成以下错误日志(以及其他类似的日志),导致 MySQL 服务器被关闭。

[2013 年 5 月 1 日星期三 17:36:00] [错误] [客户端 24.118.238.85] WordPress 数据库错误 MySQL 服务器已离开查询 SELECT wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND ( wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 10 由 require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include( '/themes/vanguard/404.php'), the_widget, WP_Widget_Recent_Posts->widget, WP_Query->__construct, WP_Query->query, WP_Query->get_posts, 参考:http ://www.hugoautoparts.com/wp-admin/ post.php?post=1767&action=edit

[2013 年 5 月 1 日星期三 17:36:00] [错误] [客户端 24.118.238.85] WordPress 数据库错误 MySQL 服务器已离开查询 SELECT t。, tt。FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category') ORDER BY tt.count DESC 由 require('wp-blog-header.php'), require_once( 'wp-includes/template-loader.php'), include('/themes/vanguard/404.php'), wp_list_categories, get_categories, get_terms, referer: http://www.hugoautoparts.com/wp-admin/post .php?post=1767&action=edit

到目前为止我做了什么:

  1. 编辑 wp-db.php 文件以添加 $this->query("set session wait_timeout=600" );
  2. 验证了 phpMyAdmin 中的 wait_timeout 变量 - 它设置为 28,800

当所有者尝试更新 WordPress 站点时,错误仍在发生。

4

2 回答 2

1

检查mysql的错误日志,根据您提供的信息,实际上不可能给出任何好的建议。

在大多数 linux 安装中,它位于 /var/log/mysql/error.log 或 /var/log/mysql.err 中。

我的猜测是mysql安装有问题,然后你应该重新安装它,或者服务器存在硬件错误导致mysql服务器崩溃。

于 2013-05-01T18:53:07.690 回答
1

这是一个很好的解释:

“Wait_timeout”当然值得一看,但这不是全部。

看起来您还需要一些代码来检查“陈旧连接”并尝试重新连接。更多链接:

'希望有帮助..

于 2013-05-01T18:54:28.980 回答