Implemented MySQL reconnect