added support for reconnecting to MySQL after it goes away