MYSQL 的默认字符集不对。(modify mysql encoding)

访问量: 486

refer to: http://stackoverflow.com/a/3513812/445908


1. $ mysql -u root
> status

Server characterset: utf8 # 如果这里不是utf8,就可以用下面的办法
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8

2. 修改 /etc/mysql/my.cnf , 在对应的 代码段中加入下面内容
[client]
default-character-set=utf8

[mysql]
default-character-set=utf8


[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

订阅/RSS Feed

Subscribe

分类/category