Import mysql:ERROR 2006 (HY000) at line 1197: MySQL server has gone away

1. Symptom

when import large file database into mysql you get follow error:

ERROR 2006 (HY000) at line 1197: MySQL server has gone away

2. Cause

You get above error cause mysql terminal connection between mysql client and mysql server cause reach to limit handle data transmission

3. Solution

Find mysql configuration file add and increase below parameter in [mysqld] section and restart mysql server:
max_allowed_packet

For example: my.cnf

[mysqld]

max_allowed_packet=40M

Leave a Reply