Mysql – Got a packet bigger than ‘max_allowed_packet’ bytes

Friday, 12. August 2011

If you have been restoring a database backup via a command line utility and came across this type of error, this command my help you out if you give it a try!

It allows you to set up the max packet limitations only for this command run

mysql --max_allowed_packet=200M -uroot -p mydb < mydump.sql

If you want to alter you entire server configurations, you will need to do the following:

1) Locate your my.cnf or my.cnf file
2) Locate the section [mysqld] and somewhere underneath you can change/add this line:

max_allowed_packet = YOUR_VALUE

You can now change YOUR_VALUE to your new preferred limit.

You can also use command line facility to execute the following commands on your machine/server:

set global net_buffer_length=SOME_BIG_VALUE;  (i.e 1000000)
set global max_allowed_packet=SOME_BIG_VALUE; (i.e. 1000000000;

Leave a Reply

You must be logged in to post a comment.