Got a packet bigger than 'max_allowed_packet'bytesMySQL 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 on my Fedora Core 12 system. 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 = 500M

Then on your console, restart the mysql service :-

[root@fedora12server html]# service mysqld restart


To check :-

[root@fedora12server html]# mysql

mysql> SHOW GLOBAL VARIABLES LIKE 'max_allowed_packet';

+--------------------+------------+
| Variable_name | Value |
+--------------------+------------+
| max_allowed_packet | 1048576000 |
+--------------------+------------+
1 row in set (0.00 sec)

mysql> exit
Bye
[root@fedora12server html]#

Cheers ... !!!!

No comments

Powered by Blogger.