[Err] 2006 – MySQL server has gone away Navicat/WordPress [solved]

Recently I tried upgrading to the latest version of the WordPress Download Monitor plugin. It did not go well 🙁

Thus, I tried to revert from a backup made using Navicat. Unfortunately, the restore would fail every time while trying to import my wp_posts table (a pretty important table!) I tried exporting the backup to a SQL dump and importing that. No luck.

Finally, I tried resolving the actual ‘MySQL server has gone away’ issue itself and I had success. This tip is the one that was most helpful:

You should increase the ‘max_allowed_packet’ and ‘wait_timeout’ values for your target server.
In menu, choose Tools > Server Monitor
1. check the box for the target server which you employ data transfer
2. click the tab “Variables”
3. scroll down and find the variable ‘max_allowed_packet’ and ‘wait_timeout’
4. click the “…” button
5. enter a larger value as variable value and press OK

Source: https://community.navicat.com/forum/navicat-product/navicat-for-mysql/141-data-transfer-error-mysql-server-has-gone-away

After adjusting the  ‘max_allowed_packet’ and ‘wait_timeout’ settings I was able to restore my backup, woot! 🙂

Screenshot showing the wait_timeout variable in Navicat Server Monitor

Screenshot showing the wait_timeout variable in Navicat Server Monitor

More links on the ‘MySQL server has gone away’ topic:

Data Transfer error - MySQL server has gone away - Navicat Community

Data Transfer error – MySQL server has gone away – Navicat Communityhttps://community.navicat.com/forum/navicat-product/navicat-for-mysql/141-data-transfer-error-mysql-server-has-gone-awayI have two machines. MySQL 5.6.8 installed on Windows 7 and MySQL 5.5.10 installed on Windows 8. I want to transfer a database from Windows 8 to Windows 7. I get the following error. [Err] [Dtf]…
Error 2006 – Navicat Wikihttp://wiki.navicat.com/wiki/index.php/Error_2006The most common reason for the MySQL server has gone away error is that the server timed out and closed the connection.
MySQL :: MySQL 5.5 Reference Manual :: C.5.2.9 MySQL server has gone away

MySQL :: MySQL 5.5 Reference Manual :: C.5.2.9 MySQL server has gone awayhttp://dev.mysql.com/doc/refman/5.5/en/gone-away.htmlBy default, the server closes the connection after eight hours if nothing has happened. You can change the time limit by setting the wait_timeout variable when you start mysqld. See Section 5.1.4,…

 

Leave a Reply

Your email address will not be published.