WordPress database error MySQL server has gone away for query


Staff member
I get this error so frequently that the php_error log file increases 1MB every 2 seconds.
and the site is very slow.

I have tried to add this line to wp-db.php

$this->query("set session wait_timeout=600" );

but it did not help.

The web server is IIS 7, latest version of mysql and wordpress