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:

About these ads

2 thoughts on “MySQL – MySQL server has gone away

    1. ykyuen Post author

      I hope the databases which i am working will not crash =P.
      Thanks for the link. =D

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s