码迷,mamicode.com
首页 > 数据库 > 详细

命令行解决mysql中文乱码

时间:2016-03-09 20:45:38      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:

修改my.ini文件中的

[mysql]

default-character-set=gbk

 

[mysqld]

# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8

 

修改后,重启mysql。结果:

mysql> show variables like ‘character_set%‘;
+--------------------------+-------------------------------------------+
| Variable_name | Value |
+--------------------------+-------------------------------------------+
| character_set_client | gbk |
| character_set_connection | gbk |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | gbk |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | D:\MySQL\MySQL Server 5.5\share\charsets\ |
+--------------------------+-------------------------------------------+

即使再次打开mysql还是这样的。

 

命令行解决mysql中文乱码

标签:

原文地址:http://www.cnblogs.com/hjy9420/p/5259505.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!