美文网首页
1267-Illegal mix of collations (

1267-Illegal mix of collations (

作者: 赵哥窟 | 来源:发表于2022-11-29 09:57 被阅读0次

今天LEFT JOIN 表,报如下错误:
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%';

结果:

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;

相关文章

网友评论

      本文标题:1267-Illegal mix of collations (

      本文链接:https://www.haomeiwen.com/subject/raelfdtx.html