> Not garbled thinking process
(1) Linux
#修改linux系统字符集
# vi/etc/sysconfig/i18n
Lang= "ZH_CN. UTF-8 "
(2) Mysql
#临时设置字符集 (Method i)
mysql> set names UTF8;
#临时设置字符集 (Method Two)
# mysql-uroot-p--default-character-set=utf8
#永久设置字符集
# VI/ETC/MY.CNF
[Client] {Client, connection,results}
Default-character-set=utf8
[Mysqld] {Database,server}
Default-character-set=utf8
Mysql> Show variables like ' character_set% ';
+--------------------------+-------------------------------------------+
| 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 | /application/mysql-5.5.32/share/charsets/|
+--------------------------+-------------------------------------------+
(3) Mysql Library table
#创建指定字符集数据库
mysql> CREATE Database oldboy_gbk DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;
MySQL not garbled thinking process