#!/usr/bin/python # -*- coding: UTF-8 -*- import MySQLdb # 打开数据库连接 db = MySQLdb.connect("xxx","xxx","xxx","db_backup",charset='utf8')