Today I imported the MySQL database and I got the following error:
# mysql -u root -p db_test < test.db Enter password: ERROR 2006 (HY000) at line XX: MySQL server has gone away
It is because the data (SQL query) is too large to imported. To solve this problem, simply edit the MySQL configuration files: /etc/my.cnf
Replace the following from:
max_allowed_packet = 1M
max_allowed_packet = 16M
Or something higher.
Restart the MySQL server again and the problem will be gone.