Linux : Error: mysql: Got a packet bigger than 'max_allowed_packet' bytes

I a small user on mysql Database .Today i have to restore the Data only DB from old server to new server . i faced aerror

Error: mysql: Got a packet bigger than ‘max_allowed_packet’ bytes

Here is the way to fix this issue .

I am using CentOS

/etc/my.cnf Default file

[mysqld] datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

[mysqld_safe] log-error=/var/log/mysqld.log[mysqld] datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

[mysqld_safe] log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[[email protected] ~]# nano /etc/my.cnf

I added two line on/etc/my.cnf   .Altered file below

[mysqld] datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

[mysqld_safe] log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

set global net_buffer_length=1000000;
set global max_allowed_packet=1000000000;

So now we are done and need to restart teh mysqld service tacking this modification changes

[[email protected]~]# service mysqld restart
Stopping MySQL: [ OK ] Starting MySQL: [ OK ] [[email protected]~]#

After this changes all goes well .. HOpw it will help some time for you 🙂

One thought on “Linux : Error: mysql: Got a packet bigger than 'max_allowed_packet' bytes

  1. Pingback: Linux : Error: mysql: Got a packet bigger than ‘max_allowed_packet’ bytes | CyberTechBlog.Com

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.