Added autoreconnect support for mysql database.