Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_hungarian_ci,IMPLICIT) for operation '='
查看当前数据库的默认编码:
show variables where Variable_name like 'collation%';
查看各表编码:
show create table ‘table_name’;
解决方案给没有设置编码的表重新设置一下:
alter table ‘table_name’ default character set utf8mb4 collate=utf8mb4_general_ci;
这样设置只针对表的,但是表中字段未修改:
ALTER TABLE ‘table_name‘ convert to CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
这个问题SQL语句没问题,检查了很久。太坑了