如何查看修改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了

 

转载自:http://hybxiaodao.iteye.com/blog/939350

posted @ 2013-03-09 20:06  beanmoon  阅读(537)  评论(0编辑  收藏  举报