4
Answers
Vote up!
0
Vote down!

What does it mean that the MySQL server has gone away?

I tried to add a catalog category in Commerce Kickstart 2.x and got the following error:

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {commerce_flat_rate_service}; Array ( ) in commerce_flat_rate_commerce_shipping_service_info() (line 120 of /Applications/lamp/apache2/htdocs/fluxcart/profiles/commerce_kickstart/modules/contrib/commerce_flat_rate/commerce_flat_rate.module).

Asked by: jayesh
on October 6, 2012

4 Answers

Vote up!
2
Vote down!

Usually this means that your 'max_allowed_packet' setting my.cnf is too small.

Answer by: Anonymous (not verified)
Posted: Oct 8, 2012
Vote up!
1
Vote down!

When you get this error, it means you have either insufficient memory on your server or a MySQL configuration that is incompatible with a large Drupal code base. This is quite common for a variety of modules on drupal.org, though I'm not sure if there is currently a single resource page that works through all potential leads.

Your best bet is to Google the following:

site:drupal.org "Mysql server has gone away"

Ryan Szrama
Answer by: Ryan Szrama
Posted: Oct 6, 2012
Vote up!
1
Vote down!

I'm running the Bitnami drupal stack.This is what worked for me:

First, definitely try restarting mysql. If that doesn't work...

I changed mysql/my.ini from max_allowed_packet=1M to max_allowed_packet=4M and restarted mysql. That seemed to fix it!

Answer by: Anonymous (not verified)
Posted: Nov 13, 2012
Vote up!
1
Vote down!

I can verify this works.
I increased max_allowed_packet to 16M and it cleared this error.
Thank you, CC

Answer by: cstachris
Posted: Nov 18, 2012

Comments

I am getting this exact same error. And I have increase max_allowed_packet=196M, based on recommendation on another site. Even this is not enough. There must be some other parameter that is causing this specific error for this operation on this database:

Configuration is using MAMP on MacOS 10.8.4. PHP config is File (php.ini) Path /Applications/MAMP/bin/php/php5.4.10

That function I am using to cause the error is "Add Taxonomy"

Any other suggestions to fix my problem?

Thanks for you help.

- basscleff94010 on September 16, 2013