wp code snippet

WordPress, PHP quick help codes

#1153 – Got a packet bigger than “max_allowed_packet’ bytes

I got an error saying “#1153 – Got a packet bigger than “max_allowed_packet’ bytes” while uploading larger than 1M sql dump file. I found that by default configuration max_allowed_packet is 1M. You need to increase the value for from 1M to whatever you want like 32M.

Solution:
——————

Login to mysql on your server.
#mysql -u root -p

Edit /etc/my.cnf
#vi /etc/my.cnf

Add max_allowed_packet=32M under [mysqld] section

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
max_allowed_packet=32M      #Added line
Save the file.

Esc w Enter or Esc x Enter

Restart the mysqld server
#service restart mysqld

Enjoy!

Categories: Linux

Leave a Reply

%d bloggers like this: