问题描述:

Error querying database. Cause: java.sql.SQLException: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_icelandic_ci,IMPLICIT) for operation ‘=’ ### The error may exist in file [E:\IDEA_workspace\RuoYi-Vue-master\ruoyi-generator\target\classes\mapper\generator\GenTableMapper.xml] ### The error may involve com.ruoyi.generator.mapper.GenTableMapper.selectDbTableList-Inline ### The error occurred while setting parameters ### SQL: SELECT count(0) FROM information_schema.tables WHERE table_schema = (SELECT database()) AND table_name NOT LIKE ‘qrtz_%’ AND table_name NOT LIKE ‘gen_%’ AND table_name NOT IN (SELECT table_name FROM gen_table) ### Cause: java.sql.SQLException: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_icelandic_ci,IMPLICIT) for operation ‘=’ ; uncategorized SQLException; SQL state [HY000]; error code [1267]; Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_icelandic_ci,IMPLICIT) for operation ‘=’; nested exception is java.sql.SQLException: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_icelandic_ci,IMPLICIT) for operation ‘=’

在调试若依框架时在进行【代码生成】的导入功能时出现了该错误

在这里插入图片描述

看了许多博客说是字段的排序规则不一致导致的,但我查看了自己对应表下的各个字段,并未发现排序规则不一致的字段名

在这里插入图片描述

解决

在这里插入图片描述
重新新建数据库,但要指定排序规则:utf8_general_ci

在这里插入图片描述

在这里插入图片描述

问题解决!

Logo

快速构建 Web 应用程序

更多推荐