ABHIONLINUX
Site useful for linux administration and web hosting

2013/09/13

MySQL server has gone away or MySQL: got a packet bigger than ‘max_allowed_packet’ bytes

While restoring mysql database, you may get this error.

MySQL server has gone away
or
MySQL: got a packet bigger than ‘max_allowed_packet’ bytes

Fix:
You need to increase mysql variables  max_allowed_packet and global net_buffer_length in mysql database


Login is root and set this.

mysql> set global max_allowed_packet=2000000000;
mysql> set global net_buffer_length=2000000;

2013/07/25

iptables rules migration

We have situations where we need to migrate the complete rules in iptables/csf from the old server to the new server. In this case, we can use the command iptables-save

root@help2linux [~]# iptables-save >  iptables_rules_back

This command will write the complete backup of the iptables rules to the file   iptables_rules_back
Now we need to import these rules in to our new server. This can be done using the command
iptables-restore

root@new-help2linux [~]# iptables-restore <  iptables_rules_back