java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '='
查询视图时报错: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 '='的更多相关文章
- 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 ...
- 【MySQL】Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and ...
线上遇到这个问题,详细信息如下: SQL state [HY000]; error code [1267]; Illegal mix of collations (utf8mb4_general_ci ...
- java.sql.SQLException: Illegal connection port value '3306:success'
严重: Servlet.service() for servlet jsp threw exceptionjava.sql.SQLException: Illegal connection port ...
- 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. ...
- JDBC连接错误(Illegal mix of collations。。。)
连接java和mysql时出现了这样的报错: java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) ...
- 解决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 ...
- MySQL replication illegal mix of collations
MySQL replication case 一则 转载:http://www.vmcd.org/2013/09/mysql-replication-case-%E4%B8%80%E5%88%99/ ...
- 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 ...
- 彻底解决phpcms v9升级后,文章发布出现: Mysql 1267错误:MySQL Error : Illegal mix of collations 解决办法
彻底解决phpcms v9升级后,文章发布出现: MySQL Query : SELECT * FROM `withli_a`.`v9_keyword` WHERE `keyword` = '吼吼' ...
随机推荐
- js 事件对象event
在触发DOM上的某个事件时,会产生一个事件对象event.这个对象中包含着所有与事件有关的信息.包括导致事件的元素,事件的类型以及其他与特定事件相关的信息. <body> <a hr ...
- Python函数中*args和**kwargs来传递变长参数的用法
参考自: http://www.jb51.net/article/78705.htm 单星号形式(*args)用来传递非命名键可变参数列表.双星号形式(**kwargs)用来传递键值可变参数列表. 1 ...
- 操作数据库结构Sql语句
新建表: create table [表名] ( ,) PRIMARY KEY , ) default '默认值' null , [字段2] ntext null , [字段3] datetime, ...
- ES6转ES5环境搭配
1.初始化项目 在项目根目录创建 package.json 文件 npm init //或者 npm init -y 2.安装babel-cli脚手架 npm install babel-cli -- ...
- 【Flutter学习】基本组件之Webview组件
1.添加依赖 dependencies: flutter_webview_plugin: ^+ 2.导入库 import 'import 'package:flutter_webview_plugin ...
- APIO2019 练习赛 Wedding cake——思路+高精度
题目大意: 给 n ( n<=1e5 ) 个数 \( a_i \) (\( a_i \) <=1e5),需要构造 n 个实数使得它们的和是 1 ,并且第 i 个实数必须小数点后恰好有 \( ...
- Shorten IPv6 Address
题目链接 题意:转换一个128位的二进制串,变成16进制,并且格式为x:x:x:x:x:x:x:x然后多个相邻的0变成::,且只有一个::,求变成的字典序最小且最短的字符串. 思路:大水题,但是就是一 ...
- three dots in git
What are the differences between double-dot “..” and triple-dot “…” in Git commit ranges? Using Comm ...
- composer 国内加速,修改镜像源
为什么慢 由于默认情况下执行 composer 各种命令是去国外的 composer 官方镜像源获取需要安装的具体软件信息,所以在不使用代理.不翻墙的情况下,从国内访问国外服务器的速度相对比较慢 如何 ...
- MongoDB 3.6 开启慢查询
参考:Profiling Levels:支持一下级别.0 默认的profiler level,profiler 关闭并且不收集数据.1 profiler 收集超过slowms的操作数据.2 profi ...