https://www.cnblogs.com/jentary/p/6655471.html
修改数据库字符集:
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
修改表的字符集:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
修改字段的字符集:
ALTER TABLE table_name CHANGE column_name column_name VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
如果只是某个字段需要 只需要修改那个字段的字符集就可以了
ALTER TABLE TlGameLog CHANGE NickName0 NickName0 varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci not null comment '玩家昵称0' ;
ALTER TABLE TlGameLog CHANGE NickName1 NickName1 varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci not null comment '玩家昵称1' ;
ALTER TABLE TlGameLog CHANGE NickName2 NickName2 varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci not null comment '玩家昵称2' ;