MySQL ERROR 1153: Got a packet bigger than 'max_allowed_packet'

If you come across this error while, for example, restoring a database from an sql file from the command line, remember that both the MySQL client and server have their own max_allowed_packet variables. Changing the client's max_allowed_packet variable on the command line may not help you with clearing the error.

To change the server side max_allowed_packet variable you can edit the my.cnf file (located at /etc/my.cnf on CentOS). The default value of max_allowed_packet is 1MB. To set it to 16MB make sure that there is the following line in the configurations file in the [mysqld] section:

max_allowed_packet=16M

After restarting te server,

/etc/init.d/mysqld restart

and logging into mysql you can check the curent value by running the following:

show variables like 'max_allowed_packet';

Comments

Good, for posting this type

Good, for posting this type of blog!!

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.

More information about formatting options

2 + 10 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.