MySQL server has gone away error fix for Magento

Today I wanted to test a tiny shell script, that didn’t do such magic stuff. It only generates a few websites, stores and storeviews and associates approximately 200 products to 4 websites. When I ran it locally I had no problems at all. But on the staging server I got the following error message when running the shell script. That’s why I had to fix this “MySQL server has gone away” – Error:

The solution for the “MySQL server has gone away” – error

To solve the problem, I had to change the following value in my MySQL configuration file (/etc/my.cnf)

This sets the allowed message package size to 32 MB.

Afterwards I had to restart the MySQL demon:

On some systems it can also be done via phpMyAdmin.

Further information

You can find more information about this MySQL setting on:

http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_allowed_packet

and

http://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.