Possible Duplicate:
Solving “MySQL server has gone away”, mysql error 2006

My website is moved from localhost to virtual hosting and after 1 week I receive an error 2006 2006 MySQL server has gone away. Now I can create/edit content but not content types and cannot clear the cache, I see white screen in this case. My hoster said that the max_allowed_packed size is only 1M and I cannot change it.

Is there a way to fix this error?

I deleted content types I don't use now and the problem has gone away... And now I can also clear the cache and edit other content types. What it was I cannot understand, it's beyond me

  • Thats just a band aid fix. It will hurt when it rips off.
    – GoodSp33d
    Commented Dec 4, 2012 at 13:09

1 Answer 1


Culprit may be max_allowed_packet which is too little. Drupal Requirements page suggests 16M, but it depends on your site. If you are not able to get sufficient memory allocated, better change host.

When using Drupal 5.x or later, particularly with contributed modules, it may be necessary to set the system variable max_allowed_packet to at least 16M. Some inexpensive hosting plans set this value too low (the MySQL default is only 1M). In that case, you may need to choose a better hosting plan. A value of 1M may be sufficient for 5.x.

  • Yes, I have had the same problem a couple of times and I solved it by increasing the max_allowed_packet using SET GLOBAL max_allowed_packet = <NEW_VALUE>. Changing the value like this will only affect the current session, but you could set it in your mysql config file instead. Commented Dec 4, 2012 at 11:46
  • thank you for your advices, guys. May be I will try to move to another hosting though I have another website (D6) but it has not any similar problems on the same hosting
    – moto
    Commented Dec 4, 2012 at 13:12
  • I have the same problem with max_allowed_packet. in my shared server it is set to 1M. I have contacted to my hosting provider but he doesn't accept to increase it. is there any programming way to solve this issue?
    – Mehrdad201
    Commented Mar 12, 2014 at 16:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.