Change MySQLdb to pymysql