在cmd里运行mysql,显示中文乱码 20
在cmd,下运行mysql,显示中文乱码,cmd代码页是utf8,mysql用showvariableslike'char%';查询的如下图所示,都是utf8的,但是显示...
在cmd,下运行mysql,显示中文乱码,cmd代码页是utf8,mysql用show variables like 'char%';查询的如下图所示,都是utf8的,但是显示中文还是乱码,并且还还不能对齐。求大神解答,怎么改。
展开
2017-08-19
展开全部
charset gbk;
使用charset命令即可,
mysql> charset utf8;
Charset changed
mysql> select * from tb_ddz;
+-----------+-----------------+------+---------------------------+------+------+-------+
| ip | nick | sex | imgsrc | win | lose | score |
+-----------+-----------------+------+---------------------------+------+------+-------+
| 127.0.0.1 | 鐢?鐢? | man | img/DMPhotoBk.png | 0 | 0 | 100 |
| 127.0.0.2 | 姝﹁棨娓告垙 | man | photo/姝﹁棨娓告垙.png | 0 | 0 | 100 |
| 127.0.0.3 | 娴烽┈璧栦汉 | man | photo/娴烽┈璧栦汉.png | 0 | 0 | 100 |
| 127.0.0.4 | 鍩庝箣鍐呭厕涔? | man | photo/鍩庝箣鍐呭厕涔?png | 0 | 0 | 100 |
+-----------+-----------------+------+---------------------------+------+------+-------+
4 rows in set (0.06 sec)
mysql> charset gbk;
Charset changed
mysql> select * from tb_ddz;
+-----------+------------+------+----------------------+------+------+-------+
| ip | nick | sex | imgsrc | win | lose | score |
+-----------+------------+------+----------------------+------+------+-------+
| 127.0.0.1 | 男 生 | man | img/DMPhotoBk.png | 0 | 0 | 100 |
| 127.0.0.2 | 武藤游戏 | man | photo/武藤游戏.png | 0 | 0 | 100 |
| 127.0.0.3 | 海马赖人 | man | photo/海马赖人.png | 0 | 0 | 100 |
| 127.0.0.4 | 城之内克也 | man | photo/城之内克也.png | 0 | 0 | 100 |
+-----------+------------+------+----------------------+------+------+-------+
4 rows in set (0.00 sec)
mysql>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |