[HY000][1267] Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLIC mysql表字符集不匹配

时间:2021-08-23 16:49:21   收藏:0   阅读:21

问题描述:[HY000][1267] Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLIC for operation  ‘=‘

技术分享图片

 出现这种问题就是关联表的字符集不匹配

1.查看数据库的字符集

show variables where Variable_name like ‘collation%‘;
结果:

技术分享图片

 2.查看关联表字符集

show create table table_name;

3.给关联表设置字符编码

alter table table_name default character set utf8mb4 collate=utf8mb4_general_ci;

4.给关联表字段设置字符编码

ALTER TABLE table_name convert to CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

 

原文:https://www.cnblogs.com/Ldengfeng/p/15176174.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!