Admin-Ahead Community

General Category => General Discussion => Topic started by: joseletk on July 07, 2018, 04:50:16 pm

Title: ERROR 2006 (HY000) at line XXX: MySQL server has gone away
Post by: joseletk on July 07, 2018, 04:50:16 pm
MySQL database restoration process failed with an 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 the size of the backup, this problem occurred when a single package size is greater than allowed packet size.

Code: [Select]
user@vps:~$ 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.

Code: [Select]
  max_allowed_packet=64M
Set the value as per your requirement and restart MySQL service.
===================================================================