Replace MySQLDb by pure sql library PyMySQL