Importing 1GO SQL File => ERROR 2013 (HY000) at line 23: Lost connection to MySQL server during query

SoCkEt7 picture SoCkEt7 · May 18, 2012 · Viewed 38.1k times · Source

Ive got to import 1go of sql data, i raised up the max_allowed_packet to 1100M to be sure.

So i use :

My query

mysql -u root -p -D mainbase < GeoPC_WO.sql

But 1 minute later it stops during the process and i get this error :

**ERROR 2013 (HY000) at line 23: Lost connection to MySQL server during query
**Lost connection to MySQL server during query****

Answer

Adrian Cornish picture Adrian Cornish · May 18, 2012

Possible that you have some large insert statements that are bigger than you max size. Check your /etc/mysql/my.cnf file or wherever it is. Cannot remember what the default is - but setting it to something large like below may help.

This is one option

[mysqld]
max_allowed_packet = 16M

And maybe the other way

[mysqldump]
max_allowed_packet = 16M