Fix autoreconnect for MySQL databases