有一个表格,是在utf8状态下,写入的汉字字段,可以用python读出出来。
>>>
>>> cur=con.cursor()
>>> cur.execute('use mytest31;')
0
>>> cur.execute('show columns from stock;')
1
>>> con.commit()
>>> x=cur.fetchall()
>>> print(x)
(('上市_第一次', 'text', 'YES', '', None, ''),)
>>>
我在mysql命令行下面就无法读取。
1.我已经chcp 65001
2.我的mysql设置是utf-8
mysql> show columns from stock;
+------------------+------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------+------+------+-----+---------+-------+
| | text | YES | | NULL | |
+------------------+------+------+-----+---------+-------+
1 row in set (0.02 sec)