首页 > 代码库 > mysql5.5与5.5版本关于修改字符集的方法
mysql5.5与5.5版本关于修改字符集的方法
mysql5.5与5.5版本关于修改字符集的方法
# vi /etc/my.cnf
mysql5.5以下:
在[mysqld]下添加
default-character-set=utf8
在[client]下添加
default-character-set=utf8
mysql 5.5 改为:
[client]
default-character-set = utf8
[mysqld]
character-set-server = utf8
然后重启mysql,验证:
mysql> show variables like ‘%char%‘;
+--------------------------+---------------------------------------------------------+
| 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 | /usr/local/mysql-5.5.38-linux2.6-x86_64/share/charsets/ |
+--------------------------+---------------------------------------------------------+
8 rows in set (0.00 sec)
本文出自 “webseven” 博客,请务必保留此出处http://webseven.blog.51cto.com/4388012/1538092