Auto-reconnect to MySQL when connection is lost.

Hopefully, this will fix the MySQL "Lost connection" error.