查看编码
show variables like '%char%';
show create table <表名>;
例:show create table user;
show full columns from <表名>;
例: show full column from user;
修改编码格式
alter database <数据库名> character set utf8mb4;
例:alter database db_user character set utf8mb4;
alter table <表名> character set utf8mb4;
例:alter table user character set utf8mb4;
ALTER TABLE <表名> MODIFY COLUMN <字段名> <字段类型> CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
例:ALTER TABLE comment MODIFY COLUMN content VARCHAR(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;