Implemented MySQL connection and disconnection.