转载网址:http://www.cnblogs.com/vingi/articles/4302330.html
修改/etc/mysql/my.cnf
On MySQL 5.5 I have in my.cnf
[mysqld] init_connect=‘SET collation_connection = utf8_unicode_ci‘ init_connect=‘SET NAMES utf8‘ character-set-server=utf8 collation-server=utf8_unicode_ci skip-character-set-client-handshake
[client]default-character-set=utf8[mysql]default-character-set=utf8
Result is
Mysql>Show variablesLike "%character%";Show variablesLike "%collation%";+--------------------------+----------------------------+|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/Share/Mysql/Charsets/ |+--------------------------+----------------------------+8 Rows Inch Set (0.00Sec)+----------------------+-----------------+|Variable_name|Value|+----------------------+-----------------+| collation_connection | Utf8_unicode_ci |< Span class= "PLN" >| Collation_database || | Collation_server | Utf8_unicode_ci |+----------------------+-----------------+< Span class= "lit" >3 rows in set (0.00 Sec)
[Reprint]linux under Configuration mariadb support Chinese