查看实例中所有数据库的字符集。(schema相当于db)
select schema_name,default_character_set_name from information_schema.schemata;
修改数据库字符集:
mysql> use zabbix;
mysql> alter database zabbix character set utf8 collate utf8_general_ci;
修改表及下所有字符列(CHAR,VARCHAR,TEXT)字符集:
ALTER TABLE alerts CONVERT TO CHARACTER SET utf8 collate utf8_general_ci;
参考博客:https://www.cnblogs.com/enjong/articles/8537531.html
mysql> show variables like 'character_set_%';
mysql> show variables like 'collation_%';