SQL语句报错:java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_g

错误截图

SQL语句报错:java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_g

发生错误的原因:sql语句中有中文条件,查询的表中,表的编码不一致,导致出现这个错误

 

解决方案:

先查看所有表的结构与编码是否一致:show full columns from zx_log_manage

修改表现在的编码   ALTER TABLE `表名`convert to character set utf8mb4;  

utf8mb4:是你要设置的编码,我这里是utfmb4