日期:2014-05-16  浏览次数:20792 次

如何查看修改mysql编码格式


mysql> show Variables like 'char%';

可以查看mysql的编码格式:


| Variable_name??????????? | Value?????????????????????????????????????????????????? |
+--------------------------+---------------------+
| character_set_client???? | utf8??????????????????????????????????????????????????? |
| character_set_connection | utf8??????????????????????????????????????????????????? |
| character_set_database?? | utf8??????????????????????????????????????????????????? |
| character_set_filesystem | binary????????????????????????????????????????????????? |
| character_set_results??? | utf8??????????????????????????????????????????????????? |
| character_set_server???? | utf8??????????????????????????????????????????????????? |
| character_set_system???? | utf8??????????????????????????????????????????????????? |
| character_sets_dir?????? | C:\Program Files\MySQL\MySQL Server 5.0\share\charsets\ |

?

?

这样就完成了对你的mysql里的编码格式的查看了,如果你想修改,继续执行下面的步骤:

打开mysql安装目录,里面有个my.ini文件,打开这个文件,里面有两处字符集的设置,默认是拉丁,建议你所想改的,如:utf8或gbk

然后启动mysql服务,以后创建的数据库默认字符集就是ok了