命令行解决mysql中文乱码
Posted Hong_Jerry
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了命令行解决mysql中文乱码相关的知识,希望对你有一定的参考价值。
修改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中文乱码的主要内容,如果未能解决你的问题,请参考以下文章