MySQL Server has Gone Away in Drupal 7
Asked Answered
M

3

12

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

Millburn answered 24/9, 2013 at 12:27 Comment(0)
B
27

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

Bigotry answered 24/9, 2013 at 13:51 Comment(1)
If you have Super privileges with MySQL, you can run this query: SET GLOBAL max_allowed_packet = 1024 * 1024 * 500;Yorgen
C
0

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

Candida answered 25/11, 2015 at 8:37 Comment(0)
S
0

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

Sphalerite answered 27/9, 2017 at 23:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.