1.修改mysql配置文件
[mysqld]
default-character-set=utf8
character_set_server=utf8
character_set_client=utf8
collation-server=utf8_general_ci
2.查询mysql编码
show variables like 'collation_%';
show variables like 'character_set_%';
3.mysql默认配置文件存放位置
windows:mysql根目录/my.ini
linux:/etc/my.cnf