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...

shareimprove this questionedited Sep 24 '13 at 12:29peterm67.3k88696asked Sep 24 '13 at 12:27user28019365517

3 Answers 正确答案

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

shareimprove this answeranswered Sep 24 '13 at 13:51Sathish D3,5311937

   Thank u its work fine... – user2801936 Sep 24 '13 at 14:00   @user2801936 Your welcome :) – Sathish D Sep 24 '13 at 14:06   Thanks @SathishD :-) – Brylie Christopher Oxley Nov 18 '14 at 21:361 If you have Super privileges with MySQL, you can run this query: SET GLOBAL max_allowed_packet = 1024 * 1024 * 500; – shasi kanth Mar 8 '16 at 7:55

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

shareimprove this answeranswered Nov 25 '15 at 8:37Arulan Pari314

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

shareimprove this answeranswered Sep 27 at 23:18Casey Carnnia92

来自 https://stackoverflow.com/questions/18981618/mysql-server-has-gone-away-in-drupal-7