I got MySQL error 2006: MySQL server has gone away when I was importing my big database. This error is caused by low default setting of max_allowed_packet. The solution is raising this value in mysql configuration file.
- If you use xampp in windows, the configuration file is
- If you use linux, the configuration file is
[mysqld] section and change max_allowed_packet to bigger value.
[mysqld] max_allowed_packet = 256M
After you change the value, restart your mysql. It must work now.