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

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

image

出现这种问题就是关联表的字符集不匹配
1.查看数据库的字符集

show variables where Variable_name like 'collation%';

结果:
image

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/CrestaLee/p/15176174.html

posted @   Lafite-1820  阅读(646)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2023-10-09 Stream流式编程,让代码变优雅
2023-10-09 告别复杂逻辑,项目终于用上了 Spring 状态机,非常优雅!
2023-10-09 FastDFS+Nginx,轻轻松松搭建一个本地文件服务器
2023-10-09 SpringBoot+RabbitMQ+Redis 开发一个秒杀系统,细节打满(附源码)
点击右上角即可分享
微信分享提示