查询视图时报错: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. boost bimap

    The library Boost.Bimap is based on Boost.MultiIndex and provides a container that can be used immed ...

  2. SDUT 1266 出栈序列统计(卡特兰数)

    这道题是回溯算法,网上一查是卡特兰数先占上代码,题解过两天会写. #include <bits/stdc++.h> using namespace std; int main() { // ...

  3. iview input实现默认获取焦点并选中文字

    1. 业务背景 配置页面,可新建和复制任务:当复制任务的时候,要把名字的input框默认获取焦点,并全选任务名.效果如下: 2. 代码实现 <template> <Form :mod ...

  4. 【Python】用python -m http.server 8888搭建本地局域网

    python -m http.server 8888 由于工作中经常会用到局域网中同事之间互传文件,当文件太大时,可以采用局域网ftp之类的方式进行传输. 这里采用python的一个服务,可以快速的搭 ...

  5. this.$nextTick 与window.setTimeout

    两个都可以设置运行先后.前者,方式: this.$nextTick(() => { this.$refs.orgAddOrUpdate.init(row, isAdd) }) 其中orgAddO ...

  6. 重新认识new

    前言 感谢大佬:https://www.cnblogs.com/luxiaoxun/archive/2012/08/10/2631812.html www.cplusplus.com 因为这段时间在重 ...

  7. FTP- Download, upload, Delete & find files

    Public Function Func_FTP(Operation,ServerName,UserName,Password,RemoteLocation,LocalLocation) 'Set u ...

  8. mysql 【常用sql】

    修改过mysql数据库字段内容默认值为当前时间 --添加CreateTime 设置默认时间 CURRENT_TIMESTAMP ALTER TABLE `table_name` ADD COLUMN ...

  9. smb.conf免密登录文件

    # This is the main Samba configuration file. You should read the# smb.conf(5) manual page in order t ...

  10. shell数学运算

    shell的数学运算 branches@ubuntu:~$ var1=$[ * ] branches@ubuntu:~$ echo $var1 branches@ubuntu:~$ var2=$[$v ...