MySQL database restoration process failed with a error message while restoring a large backup file. I got the below message. After reading about this problem i found that this is not with size of backup, this problem occurred when a single package size is greater than allowed packet size.

Advertisement
rahul@tecadmin:~$ mysql -p mydb < mydb.sql

Enter password:
ERROR 2006 (HY000) at line 122732: MySQL server has gone away

Solution:

To solve this problem increase max_allowed_packet size in your mysql configuration. Edit configuration file my.cnf and add following value under [mysql] section.

  max_allowed_packet=64M

Set the value as per your requirement and restart MySQL service.

Share.

Leave A Reply