Activities

June 2010
M T W T F S S
« May   Jul »
 123456
78910111213
14151617181920
21222324252627
282930  

MySQL ERROR : Got a packet bigger than ‘max_allowed_packet’ bytes

Here I got an error when I am trying to restore a table which having large binary data stored in it. MySQL default limit for the allowed packet is set to 16M. if you need to insert the record which is larger than 16MB in size you have to modify the mysql global variable accordingly.

Permanent fix is,
edit/create a file in /etc/my.cnf and added the following lines,

[mysqld]
max_allowed_packet = 30M

[root@rc-128 ~]#

vi /etc/my.cnf
[root@rc-128 ~]# service mysql restart

Shutting down MySQL….. [ OK ]
Starting MySQL. [ OK ]

[root@rc-128 ~]# mysql

Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.0.82-community MySQL Community Edition (GPL)

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input statement.

mysql> SHOW GLOBAL  VARIABLES LIKE 'max_allowed_packet';

+——————–+———–+
| Variable_name | Value |
+——————–+———–+
| max_allowed_packet | 31057600 |
+——————–+———–+
1 row in set (0.00 sec)
mysql> exit

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>