One of those very helpful error messages. I got this error when importing a large database, and it was caused by some insert statements exceeding the configured max_allowed_packet size (manual). According to this bug entry, the error message should actually say
Got a packet bigger than 'max_allowed_packet' bytes
but that doesn’t seem to fixed to this day. To fix the error, simply increase max_allowed_packet in your my.cnf file, under the [mysqld] section, e.g.
[mysqld]
max_allowed_packet = 16M
max_allowed_packet = 16M
Thanks! That did the trick to do an import of a 5GB SQL file.
Hi Hay, How many MB did you set to make it work with 5GB sql file?
As far as I know, you can’t judge the max_allowed_packet directly from the size of the SQL file, given that the largest query in that SQL file dictates the max_allowed_packet value. In other words, packet size of 1M might be enough for an SQL file of 10GB, if that file only contains small queries. You should simply try doubling the max_allowed_packet value if your MySQL server still “goes away”, and if it doesn’t work after 5 or so iterations (starting at 16M), the problem probably lies somewhere else.