Got a packet bigger than 'max_allowed_packet' bytes

Submit to reddit

I got this on a newly installed server when I tried to import a database:

1
2
3
[root@host ~]# mysql -u user -pPassword database < database.sql
Enter password:
ERROR 1153 (08S01) at line 53: Got a packet bigger than 'max_allowed_packet' bytes

It’s easily fixable. The default is probably 16M, I added the following in /etc/my.cnf

max_allowed_packet=32M

And restarted mysql (depending on your distro you will do this differently):

service mysqld restart