日期:2014-05-16 浏览次数:20482 次
sudo gedit /etc/mysql/my.cnf
·[client] default-character-set=utf8 ·[mysqld] default-character-set=utf8 skip-character-set-client-handshake #此处是忽略客户端的字符集,使用服务器的设置
sudo /etc/init.d/mysql restart
show variables like 'characte%';
+--------------------------+----------------------------+ | 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/ | +--------------------------+----------------------------+