Edit the php file “wp-db.php” (in the “wp-include/” folder of your WordPress installation) and add
$this->query(“set session wait_timeout=600”);
somewhere in the function “___construct” after the $this->dbhost = $dbhost; and before the $this->dv_connect()
statement.
Reference this link if you need more:
http://dev.mysql.com/doc/refman/5.0/en/gone-away.html