MySQL Error 2006: MySQL Server Has Gone Away

Posted on

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.

Then find [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.

Good luck!