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[root@localhost ~]# nano /etc/my.cnf
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;
[mysqld_safe] log-error=/var/log/mysqld.log[mysqld] datadir=/var/lib/mysql
# to do so, uncomment this line:
# symbolic-links=0
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;
[mysqld_safe] log-error=/var/log/mysqld.log
# to do so, uncomment this line:
# symbolic-links=0
pid-file=/var/run/mysqld/mysqld.pid
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 restartStopping MySQL: [ OK ] Starting MySQL: [ OK ] [root@K~]#
After this changes all goes well .. HOpw it will help some time for you 🙂
Pingback: Linux : Error: mysql: Got a packet bigger than ‘max_allowed_packet’ bytes | CyberTechBlog.Com