查询时报错
-- 用于解决报错
> 1267 - Illegal mix of collations (utf8mb4_0900_ai_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation '='
这个错误是由于在进行比较操作时涉及到不同的字符集和校对规则(collations)。
涉及到了utf8mb4_0900_ai_ci和utf8mb4_general_ci的混合使用。
mysql8.0.1之后的默认COLLATE为utf8mb4_0900_ai_ci;
-- 查看数据库的规则
show variables where Variable_name like 'collation%';
-- 修改校对规则
ALTER TABLE t_name DEFAULT CHARACTER
SET utf8mb4 COLLATE = utf8mb4_general_ci;
ALTER TABLE t_name CONVERT TO CHARACTER
SET utf8mb4 COLLATE utf8mb4_general_ci;
标签:ci,utf8mb4,ai,collations,general,0900
From: https://www.cnblogs.com/alvisClub/p/17882148.html