标签:text blog fetch exec utf8 color col img nec
背景:db = MySQLdb.connect(host=‘127.0.0.1‘,
db=‘tmp_db‘,
user=‘root‘,
password=‘123456‘,
charset=‘utf8‘,
)
cursor = db.cursor()
sql = """select country from country_code limit 10;
"""
cursor.execute(sql)
cursor.fetchall()
输出结果
标签:text blog fetch exec utf8 color col img nec
原文地址:https://blog.51cto.com/maoxiaoxiong/2378455