The follow error : 2013 Lost connection to MySQL server during query " is returned by MySQL because the server timed out and closed.
Solution : Increase the mysql variables.
connect_timeout
interactive_timeout
net_read_timeout
net_write_timeout
slave_net_timeout
wait_timeout
max_connections
max_user_connections
Also you can check the mysql documentation error :
http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
Regards,
Peter