MySQL Error 1153 – Got a packet bigger than ‘max_allowed_packet’ bytes

This one can be fixed by add some line in my.cnf.

Usually MySQL config file is located in etc/my.cnf.

Open it and add two line like this:

It gives 100M.

Check here for more: http://stackoverflow.com/questions/93128/mysql-error-1153-got-a-packet-bigger-than-max-allowed-packet-bytes

 

 

 

MySQL Import Error: #2006 – mysql server has gone away phpmyadmin import

When I try to import a big db file using phpMyAdmin. MySQL failed with a error:

#2006 – mysql server has gone away phpmyadmin import

After search, looks there two reason for this:

  1. check that wait_timeout variable in your mysqld’s my.cnf configuration file is large enough. On Debian: sudo nano /etc/mysql/my.cnf, set wait_timeout = 600 seconds (you can tweak/decrease this value when error 2006 is gone), then sudo /etc/init.d/mysql restart. I didn’t check, but the default value for wait_timeout might be around 28800 seconds (8 hours).
  2. Server dropped an incorrect or too large packet. If mysqld gets a packet that is too large or incorrect, it assumes that something has gone wrong with the client and closes the connection. You can increase the maximal packet size limit by increasing the value of max_allowed_packet in my.cnf file. On Debian: sudo nano /etc/mysql/my.cnf, set max_allowed_packet = 64M (you can tweak/decrease this value when error 2006 is gone), then sudo /etc/init.d/mysql restart.

I tried the second option and fixed it perfectly. I’m using Xampp on Windows. So the my.cnf is located in the xampp fold, xampp\mysql\bin