【问题标题】:MySQL Server keeps shutting downMySQL 服务器不断关闭
【发布时间】:2013-04-25 19:35:57
【问题描述】:

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

[Wed May 01 17:36:00 2013] [error] [client 24.118.238.85] WordPress 数据库错误 MySQL server has away for query 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, referer: http://www.hugoautoparts.com/wp-admin/post.php?post=1767&action=edit

[Wed May 01 17:36:00 2013] [error] [client 24.118.238.85] WordPress 数据库错误 MySQL server has away for query 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 网站时,错误仍在发生。

【问题讨论】:

  • 定义“被关闭”。得到“连接数据库时出错”,对吧?

标签: mysql wordpress


【解决方案1】:

查看mysql的错误日志,根据你提供的信息,实在无法给出好的建议。

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

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

【讨论】:

    【解决方案2】:

    这里有一个很好的解释:

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

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

    '希望有帮助..

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-03
      • 2011-05-13
      • 2021-11-13
      • 2014-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多