How to solve Local WP’s “Error in query (1153): Got a packet bigger than ‘max_allowed_packet’ bytes”

I was trying to import a 115MB database via Local WP’s Adminer tool, and I kept getting the following error:

Error in query (1153): Got a packet bigger than 'max_allowed_packet' bytes

After a lot of trial and error, the solution was to:

  1. Update the “max_allowed_packet” variable in Local Sites->[site name]->conf->mysql->my.cnf.hbs to max_allowed_packet = 1000M
  2. Add/update the “max_allowed_packet” variable in Local Sites->[site name]->conf->php->php.ini.hbs to max_allowed_packet = 1000M
  3. In Local WP, click “Stop Site” then “Start Site”

That’s it!

Posted in ,

Toby Cryns

Toby Cryns is a freelance CTO, expert WordPress consultant, and teacher.

He offers free advice to improve your freelance biz.

He also publishes small droppings every now and then to twitter.com/tobycryns and twitter.com/themightymo

Follow Toby's contributions on Github and WP.org.