Python2.7.12 + MySql-python1.2.4 插入数据报错。
代码:
MySQLdb.connect(host=’localhost’,user=’root’,passwd=’123456’,db=’testdb’)
缺少:charset=’utf8’,添加即可。如下:
MySQLdb.connect(host=’localhost’,user=’root’,passwd=’123456’,db=’testdb’,charset=’utf8’)
Python2.7.12 + MySql-python1.2.4 插入数据报错。
代码:
MySQLdb.connect(host=’localhost’,user=’root’,passwd=’123456’,db=’testdb’)
缺少:charset=’utf8’,添加即可。如下:
MySQLdb.connect(host=’localhost’,user=’root’,passwd=’123456’,db=’testdb’,charset=’utf8’)