if __name__ == '__main__':
    connect = MySQLdb.connect(host='localhost', port=3306, user='xxx',
        passwd='xxx', db='xxx', charset='utf8')
cursor = connect.cursor()
Python MYSQL update statement