查询视图时报错:java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '=';

本地环境:mysql8.0.13

异常提示排序规则编码混乱,mysql8.0.1之后的默认COLLATE为utf8mb4_0900_ai_ci;

检查视图中所包含的表发现其中一个建表时 没有设置编码,并且其他的表设置的是 CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;因此导致混乱;

查看当前数据库的默认编码:

mysql> show variables where Variable_name like 'collation%';

查看各表编码:

mysql> show create table ‘table_name’;

解决方案给没有设置编码的表重新设置一下:

mysql> alter table table_name default character set utf8mb4 collate=utf8mb4_general_ci;

这样设置只针对表的,但是表中字段未修改:

mysql> ALTER TABLE table_name convert to CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

修改完成以后,重新创建视图!!!!

参考编码修改

java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '='的更多相关文章

  1. java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' 异常处理,及MySQL数据库编码设置

    java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,C ...

  2. 【MySQL】Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and ...

    线上遇到这个问题,详细信息如下: SQL state [HY000]; error code [1267]; Illegal mix of collations (utf8mb4_general_ci ...

  3. java.sql.SQLException: Illegal connection port value '3306:success'

    严重: Servlet.service() for servlet jsp threw exceptionjava.sql.SQLException: Illegal connection port ...

  4. Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '<>'

    1.问题 今天又在mysql中遇到了,吐血. 2.解决方案 SQL最后加上 COLLATE utf8mb4_unicode_ci SELECT t2.cust_id as cust_id_ex,t1. ...

  5. JDBC连接错误(Illegal mix of collations。。。)

    连接java和mysql时出现了这样的报错: java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) ...

  6. 解决Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER

    今天在用java与mysql数据库时发现Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER ...

  7. MySQL replication illegal mix of collations

    MySQL replication case 一则 转载:http://www.vmcd.org/2013/09/mysql-replication-case-%E4%B8%80%E5%88%99/ ...

  8. Illegal mix of collations for operation 'like' while searching with Ignited-Datatables

    Stack Overflow Questions Developer Jobs Tags Users   Log In Sign Up Join Stack Overflow to learn, sh ...

  9. 彻底解决phpcms v9升级后,文章发布出现: Mysql 1267错误:MySQL Error : Illegal mix of collations 解决办法

    彻底解决phpcms v9升级后,文章发布出现: MySQL Query : SELECT * FROM `withli_a`.`v9_keyword` WHERE `keyword` = '吼吼' ...

随机推荐

  1. js 最短代码生成随机数(字符串、id)

    以生成8位字符串为例 Math.random().toString(36).substr(-8)

  2. 「树的直径」BFS方法证明

    选定任意一个点u,从u开始BFS求出距离u最大的点s,再从s点出发BFS到距离s最大的点t,则dis(s,t)即为树的直径 证明 其实只要找到了树的直径的一个端点,再BFS找到最远点就一定是直径的另一 ...

  3. XenServer(服务器虚拟化平台)

    Citrix Xenserver,思杰基于Xen的虚拟化服务器.Citrix XenServer是一种全面而易于管理的服务器虚拟化平台,基于强大的 Xen Hypervisor 程序之上.Xen技术被 ...

  4. [CSP-S模拟测试]:施工(DP+单调栈+前缀和)

    题目描述 小$Y$家门前有一条街道,街道上顺序排列着$n$幢建筑,其中左起第$i$幢建筑的高度为$h_i$.小$Y$定义街道的不美观度为所有相邻建筑高度差的绝对值之和乘上常数$c$,为了改善街道环境, ...

  5. python数据分析中常用的库

    Python是数据处理常用工具,可以处理数量级从几K至几T不等的数据,具有较高的开发效率和可维护性,还具有较强的通用性和跨平台性,这里就为大家分享几个不错的数据分析工具,需要的朋友可以参考下 Pyth ...

  6. js练习题之图片背景轮播

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  7. 20175120彭宇辰 《Java程序设计》第十一周学习总结

    教材内容总结 第十三章 Java网络编程 一.URL类 一个URL对象包含的三个基本信息:协议.地址和资源. -协议:必须是URL对象所在的Java虚拟机支持的协议,常用的有:Http.Ftp.Fil ...

  8. tomcat正常启动输入localhost:8080显示404错误

    找了半天才解决. 看这个贴子: https://www.cnblogs.com/lovelanglangyou/p/7410937.html 简而言之: 需要修改eclipse中的server配置,e ...

  9. python rpy2,tkinter安装问题解决

    windows系统下 在python中直接pip install rpy2时,会出错,没仔细看错误,直接下载了whl文件(https://www.lfd.uci.edu/~gohlke/pythonl ...

  10. Class-DbConnectionManipulator:Execute,QueryFirstDefault<>

    ylbtech-Class-DbConnectionManipulator:Execute,QueryFirstDefault<> 1.返回顶部 1. public object GetS ...