WordPress数据库错误MySQL服务器已经停止查询 [英] WordPress database error MySQL server has gone away for query

查看:135
本文介绍了WordPress数据库错误MySQL服务器已经停止查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个错误这么频繁,php_error日志文件增加1MB每2秒。
,网站很慢。

I get this error so frequently that the php_error log file increases 1MB every 2 seconds. and the site is very slow.

我试图将这一行添加到wp-db.php

I have tried to add this line to wp-db.php

$this->query("set session wait_timeout=600" );

但没有帮助。

web服务器是IIS 7,最新版本的mysql和wordpress

The web server is IIS 7, latest version of mysql and wordpress

推荐答案

这个技巧将适用于所有的WordPress版本。打开Wordpress目录。该目录将包含以下文件夹:

This trick will work for all WordPress versions. Open your Wordpress directory. The directory will contain the folders :

wp-admin
wp-content
wp-includes

打开wp-includes。搜索wp-db.php文件。如果您找到该文件,请使用文本编辑器打开它。使用文本编辑器的搜索工具,搜索:

Open wp-includes. Search for the wp-db.php file. If you found the file, open it using a text editor. Using the text editor's search tool, search for :

$this->ready = true;

找到该行后,在找到的行后面添加以下行:

Once you found the line, add the following lines just after the found line :

//WP Query Gone Away Error Fix
$this->query("set session wait_timeout=600");

您也可以按 https://subinsb.com/fix-wordpress-error-mysql-server-has-gone-away 链接查看更多detials。

You can also follow https://subinsb.com/fix-wordpress-error-mysql-server-has-gone-away link to view in more detials.

这篇关于WordPress数据库错误MySQL服务器已经停止查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆