MySQL Server has Gone Away in Drupal 7

2020-03-10 05:38发布

In my form field type, i edit the file menu these error will appear,

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in D:\wamp\www\cms_development\includes\database\database.inc on line 2168 ( ! ) PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in D:\wamp\www\cms_development\includes\database\database.inc on line 2168

Anybody Know how to rectify this error...

标签: mysql drupal
3条回答
欢心
2楼-- · 2020-03-10 06:09

This may be because of max_allowed_packet

Change in the my.ini/my.cnf file. Include the single line under [mysqld] in your file

max_allowed_packet=500M

now restart the MySQL service once you are done. You can see it's curent value in mysql like this:

SHOW VARIABLES LIKE 'max_allowed_packet'

You can read about it here http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html

查看更多
趁早两清
3楼-- · 2020-03-10 06:16

This is for Linux Users.In terminal,
Step 1:

locate my.cnf

And you copy the Path

Step 2:

sudo gedit "Paste the path"

Step 4: Changed "max_allowed_packet" from "1m" to "32m" and saved my.cnf

 sudo "path" restart

(or) Do Normal System Restart

查看更多
贪生不怕死
4楼-- · 2020-03-10 06:19

I had a similar problem. mysql would crash while drupal8 was going through install process. restarting mysql would eliminate the "mysql has gone away ..." error but drupal install would never finish. the following combination of mysql and apache configs provided a stable digitalocean droplet for me: https://www.digitalocean.com/community/questions/mysql-server-keeps-stopping-unexpectedly?answer=26016

查看更多
登录 后发表回答