查看数据库当前编码:
SHOW VARIABLES LIKE 'character%';
修改my.ini (标签下没有的添加,有的修改)
[mysqld]
basedir=E:\mysql\mysql-5.7.16-winx64
datadir=E:\mysql\mysql-5.7.16-winx64\data
character_set_server=utf8
[mysql]
default-character-set= utf8
[client]
default-character-set= utf8
重启MySQL服务
然后查看数据库编码:
SHOW VARIABLESLIKE 'character%';