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.
Actually there are other reasons which lead to this MySQL server has gone away error. For more information, please refer to MySQL Server Documentation.
- MySQL Server Documentation – C.5.2.10. Packet too large
- MySQL Server Documentation – C.5.2.9. MySQL server has gone away