How to update the max allowed packet variable in MySQL?

khaled —  February 20, 2012 — Leave a comment

Sometimes, while trying to run a query that contains large data size in MySQL, you will receive the following error: “Got packet bigger than ‘max_allowed_packet’ bytes”. This error is very common when dumping, restoring or inserting content that contains blob or large strings of data.

In order to resolve this error, all you need to do is to locate the used my.cnf and increase the max_allowed_packet variable. It is generally recommended to set it to 32M.

On Debian distributions, the cnf file is generally located at /etc/mysql/my.cnf.

khaled

Posts

No Comments

Be the first to start the conversation.

Leave a Reply