当前位置:   article > 正文

mysql错误代码: 1267_mysql 1267

mysql 1267

例:select a.* from tbl_test a LEFT JOIN tbl_test_askforleave b ON a.userid=b.userid AND a.groupCode=b.groupCode
错误提示:
Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation ‘=’
原因:a.groupCode(utf8mb4_general_ci)=b.groupCode(utf8mb4_0900_ai_ci),
设置如下方法仍不生效:
SHOW VARIABLES LIKE ‘%coll%’;
SET GLOBAL collation_connection = ‘utf8mb4_general_ci’;
先执行:
SET collation_database = ‘utf8mb4_general_ci’;
解决方法:查询时给字段设置指定字符集,如:
select a.* from tbl_test a LEFT JOIN tbl_test_askforleave b ON a.userid=b.userid AND convert(a.groupCode using utf8)=convert(b.groupCode using utf8)

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号