Overview

When moving between servers, sometimes the large database sizes can cause issues with a standard MySQL / MariaDB configuration. If you see the following when importing:

MySQL Error 2006 (HY000) at line XX: MySQL server has gone away

This means that the maximum allowed packet size is larger than what MySQL allows. This is common when there are thousands of rows and they're not in an individual INSERT statement. The client simply disconnects from the server with the error message above.

To correct this issue, edit the /etc/my.cnf file and add the following in the [mysqld] area:

max_allowed_packet=64M

Restart MySQL and import again. If the error still occurs, you may need a larger value for max_allowed_packet.

Was this article helpful?

Related Articles