执行mysql语句报错 Illegal mix of collations……

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation

在数据库执行查找的命令,判断条件含有特殊字符,再执行的时候报了以上错误;

查看字段编码发现是 latin1 字符集的latin1_german1_ci排序规则,而数据库是utf-8编码,确定错误是编码导致。

修改数据库字段为utf-8编码  再次执行 顺利查出结果

 

posted @ 2019-03-08 16:02  进阶丶xiao路  阅读(14084)  评论(0编辑  收藏  举报