How do I fix the error: Mysql Server has gone away?

When looking at the mail log of the server you see this log entry from Amavis:

Aug  3 01:00:20 el7p17 amavis[114160]: (114160-02) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 130) line 173.

Amavis tries to use a persistent connection to mariadb but the server has dropped the mariadb connection so Amavis has to try again to re-establish the connection.

How to Fix:

Check that wait_timeout mysql variable in your /etc/my.cnf configuration file is large enough (don't forget to also check for the value in your /etc/my.cnf.d/ directory overriding the default). It is recommended that you set the variable to its default value within the [mysqld] section:

wait_timeout = 28800

Restart MariaDB:

systemctl restart mariadb

Once you’ve made these changes, and restarted your MariaDB server, the issue should be fixed.

  • mysql
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What changes does Warden make to the postfix configuration files to enable Amavis?

Important Warden will configure postfix differently depending if you selected to install the...

How hard is it to uninstall if I do not require Warden Anti-spam and Virus Protection any more?

Uninstalling Warden is as easy as going to Extensions -> My Extensions -> Warden Anti-spam...

How can I fix the error: host[] said: 552 5.3.4 Declared message size (1208029 B) exceeds size limit for recipient?

You can set the message size limit for Amavis under Settings -> Policy Settings -> Misc...

How do I fix the error: Unit is masked. when trying to start SpamAssassin?

You should not try to start the SpamAssassin service. Warden disables (masks) the SpamAssassin...

What network ports are used by Warden and need to be opened on the firewall?

All of the network based tests (Razor, Pyzor, DCC) that Warden uses must be opened on the...