报错内容
1267 - Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='
执行的sql为:
select f2.* from folder f2 where f2.parent_id in (
select id from folder where parent_id is null and rel_type='FOLDER' and org_id!='0'
)
原因
由于新生成的查询的结果字符集为utf8_general_ci,而原有表的字符集为utf8_unicode_ci。
解决办法
修改表的字符集为utf8
alter table folder convert to character set utf8;
本文探讨了在执行SQL查询时遇到的非法字符集混合错误,焦点在于新查询结果与原有表的字符集不一致。解决方法是将表的字符集转换为utf8。通过实例和解决方案,帮助开发者理解并处理此类问题。

1824

被折叠的 条评论
为什么被折叠?



