Mysql 默认编码问题
新安装的数据库默认编码是 latin1
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client |latin1|
| character_set_connection |latin1|
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results |latin1|
| character_set_server | latin1 |
| character_set_system |latin1|
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
通过配置my.cnf 可将mysql编码设置为默认utf8
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
注意: mysqld 的设置与上面两个不同