WordPress数据库错误MySQL服务器已经离开查询(WordPress database error MySQL server has gone away for query)

编程入门 行业动态 更新时间:2024-10-24 17:22:46
WordPress数据库错误MySQL服务器已经离开查询(WordPress database error MySQL server has gone away for query)

我经常得到这个错误,php_error日志文件每2秒增加1MB。 而且网站很慢。

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

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

但它没有帮助。

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

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

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

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

but it did not help.

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

最满意答案

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

wp-admin wp-content wp-includes

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

$this->ready = true;

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

//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。

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

wp-admin wp-content wp-includes

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");

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

更多推荐

本文发布于:2023-07-05 08:58:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1035475.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   数据库   服务器   MySQL   WordPress

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!