MySQL – MySQL server has gone away

When i try to import a database, the following error is thrown and the import fails.

  • Warning: MySQL server has gone away query: INSERT xxx…


 

The problematic INSERT SQL contains a 1.5MB BLOB object which is larger than the default MySQL max_allowed_packet system variable (Default is 1MB).

To solve the problem, modify the max_allowed_packet variable in /etc/my.cnf and restart the MySQL server.

[mysqld]
max_allowed_packet=8M

 

Actually there are other reasons which lead to this MySQL server has gone away error. For more information, please refer to MySQL Server Documentation.

Done =)

Reference:

2 thoughts on “MySQL – MySQL server has gone away”

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.