和以前
版本的mysql不同了!
留为备份!
1、在[client]字段里加入default-character-set=utf8,如下:
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=utf8
2、在[mysqld]字段里加入character-set-server=utf8,如下:
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
character-set-server=utf8
3、在[mysql]字段里加入default-character-set=utf8,如下:
[mysql]
no-auto-rehash
default-character-set=utf8
修改后确认:
mysql> show variables like '%character%';
+--------------------------+------------------------------------------------------------------------------+
| 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/local/Percona-Server-5.6.30-rel76.3-Linux.x86_64.ssl101/share/charsets/ |
+--------------------------+------------------------------------------------------------------------------+
8 rows in set (0.00 sec)
阅读(900) | 评论(0) | 转发(0) |