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

[root@localhost ~]# 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

[root@lK~]# service mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
[root@K~]#

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

Possibly Related Posts:


1 comment to Linux : Error: mysql: Got a packet bigger than ‘max_allowed_packet’ bytes

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=""> <strike> <strong>