python提取mysql中中文数据,显示乱码

db = MySQLdb.connect(host = '***',user = '***',passwd = '***', charset = 'utf8')
 
 
把最后一个参数加上就搞定了!

猜你喜欢

转载自blog.csdn.net/ljyt2/article/details/78271250