Discuss / SQL / win10 中文专业版,中文显示还是不行

win10 中文专业版,中文显示还是不行

Topic source

ywjco_567

#1 Created at ... [Delete] [Delete and Lock User]

修改my.ini文件,[client]和[mysql]部分增加default-character-set=utf8

mysql> SELECT * FROM students;
+----+----------+--------+--------+-------+
| id | class_id | name   | gender | score |
+----+----------+--------+--------+-------+
|  1 |        1 | 灏忔槑   | M      |    90 |
|  2 |        1 | 灏忕孩   | F      |    95 |
|  3 |        1 | 灏忓啗   | M      |    88 |
|  4 |        1 | 灏忕背   | F      |    73 |
|  5 |        2 | 灏忕櫧   | F      |    81 |
|  6 |        2 | 灏忓叺   | M      |    55 |
|  7 |        2 | 灏忔灄   | M      |    85 |
|  8 |        3 | 灏忔柊   | F      |    91 |
|  9 |        3 | 灏忕帇   | M      |    89 |
| 10 |        3 | 灏忎附   | F      |    85 |
+----+----------+--------+--------+-------+
10 rows in set (0.00 sec)

90松松豆5

#2 Created at ... [Delete] [Delete and Lock User]

改为GBK试试

-一世欢颜

#3 Created at ... [Delete] [Delete and Lock User]

用GBK就行了!set names GBK;

做两件事可以把.txt文件保存为GBK编码:

1. 内容替换:把文件里的charset=utf-8字样改为charset=gb2312

2. 编码转换:把记事本中:格式-字体 保存成gb2312,文件保存时设置成ansi的编码方式。


  • 1

Reply