Need help? Call us on 1300 789 260

MySQL Error when importing database

Difficulty: Advanced

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? Yes No
👥

Having trouble? We’re here to help!

We’ve built our company with a serious focus on quality service. Feel free to give us a call!

1300 789 260