Skip to main content

max_allowed_packet

(4 February 2013)

Problem

When doing an import, I get the error:

ERROR 1153 (08S01) at line 96: Got a packet bigger than 'max_allowed_packet' bytes
Solution

Open a terminal and run this:

$ mysql -u root -p
mysql> set global net_buffer_length=1000000;
mysql> set global max_allowed_packet=1000000000;
mysql>

Keep the mysql session open, and run your import in another window. If you still get the error, feed the option --max_allowed_packet= to the import attempt:

$ mysql -u root -p --max_allowed_packet=100M < import.sql

If you keep getting this as a chronic condition, consider updating the mysql.cnf file with the increased values.