charset gbk
使用charset命令即可,
mysql> charset utf8Charset 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>
mysql数据乱码问题可能有以下三种原因: 1.server本身设定问题,例如还停留在latin1版本2.table的语系设定问题(包含character与collation)3.客户端程式(例如php,java)的连线语系设定问题建议使用utf8!!!! 想要避免mysql的中文乱码问题,可以欢迎分享,转载请注明来源:内存溢出
评论列表(0条)