UnixServerAdmin

Server Administration & Management

MySQL: max_allowed_packet

Some times, when you backup or restore your database table with huge binary data, you will get max_allowed_packet error.

By default MySQL set the max_allowed_packet to 10M.

# mysqladmin variable | grep max_allowed_packet

| max_allowed_packet                      | 10485760

To fix it, change your MySQL global variable as step below.

1. Open /etc/my.cnf file.

# vi /etc/my.cnf

2. Insert the value as below.

=======================
[mysqld]
max_allowed_packet = 64M
=======================

3. Save it and restart the MySQL services.

# /etc/init.d/mysql stop

# /etc/init.d/mysql start

Advertisements

April 2, 2011 Posted by | MySQL | | 2 Comments