def clear_overdue_user_flow(self,port): conn = cymysql.connect(host=Config.MYSQL_HOST, port=Config.MYSQL_PORT, user=Config.MYSQL_USER, passwd=Config.MYSQL_PASS, db=Config.MYSQL_DB, charset='utf8') cur = conn.cursor() print port print type(port) cur.execute('UPDATE user SET passwd="dfa123" WHERE port = "' + str(port) +'"') cur.close() conn.close() 但是老是报错 那个 where port 那里 但是就是找不出是什么问题