环境:mysql-5.6.22-winx64
复制文件my-default.ini,重命名为my.ini
添加内容如下:
[client]
# Client characterset and Connection characterset
default-character-set=utf8
[mysqld]
# Server characterset and Database characterset
character_set_server=utf8
查看状态
mysql> status
--------------
mysql Ver 14.14 Distrib 5.6.22, for Win64 (x86_64)
Connection id: 1
Current database:
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 5.6.22 MySQL Community Server (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 8 sec
查看字符集:
SHOW VARIABLES LIKE 'collation%';
SHOW VARIABLES LIKE 'character_set%';