mysql ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) ....
来源:互联网 发布:韩版西装品牌 知乎 编辑:程序博客网 时间:2024/06/05 17:32
迁移服务器时,重建mysql数据库,将数据库的编码格式改为了utf8mb4(见该篇),以便能够存储emoji表情.
在遇到一个执行procedure报错 :
call TigAddUserPlainPw(‘db-properties’, NULL);
ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (utf8mb4_unicode_ci,COERCIBLE) for operation '='
存储过程TigAddUserPlainPw代码:
create procedure TigAddUserPlainPw(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8)begin case TigGetDBProperty('password-encoding') when 'MD5-PASSWORD' then call TigAddUser(_user_id, MD5(_user_pw)); when 'MD5-USERID-PASSWORD' then call TigAddUser(_user_id, MD5(CONCAT(_user_id, _user_pw))); when 'MD5-USERNAME-PASSWORD' then call TigAddUser(_user_id, MD5(CONCAT(substring_index(_user_id, '@', 1), _user_pw))); else call TigAddUser(_user_id, _user_pw); end case;end
以上建表语句中 ‘MD5-USERID-PASSWORD’ 等变量的默认编码方式需要改变,修改TigAddUserPlainPw代码:
create procedure TigAddUserPlainPw(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8) begin case TigGetDBProperty('password-encoding') when CONVERT('MD5-PASSWORD' USING utf8mb4) COLLATE utf8mb4_unicode_ci then call TigAddUser(_user_id, MD5(_user_pw)); when CONVERT('MD5-USERID-PASSWORD' USING utf8mb4) COLLATE utf8mb4_unicode_ci then call TigAddUser(_user_id, MD5(CONCAT(_user_id, _user_pw))); when CONVERT('MD5-USERNAME-PASSWORD' USING utf8mb4) COLLATE utf8mb4_unicode_ci then call TigAddUser(_user_id, MD5(CONCAT(substring_index(_user_id, '@', 1), _user_pw))); else call TigAddUser(_user_id, _user_pw); end case; end
删除存储过程TigAddUserPlainPw,重建该存储过程。
阅读全文
0 0
- mysql ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) ....
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE)
- MySql (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (utf8_general_ci,COERCIBLE)解决
- MySql中出现 Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (gbk_chinese_ci,COERCIBLE) for
- ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,IMPLICIT) and (gbk_chinese_ci,COERCIB
- MySQL Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (utf8_general_ci,IMPLICIT) for operation 'UNION' 错误解决方法
- 解决Mysql:Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
- mysql错误提示Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)的一个解决办法
- mysql错误提示Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)的一个解决办法
- mysql错误提示Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- mysql错误:Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- Illegal mix of collations (gb2312_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- 解决"Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- 解决 Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- 数据库错误发生 1267 Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) fo
- [Err] 1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- mysql 报错Error Code: 1267 Illegal mix of collations的解决办法
- 栈的应用之表达式求值
- 针对二分类问题的线性判别分析模型
- 十九、mcg-helper业务系统单表业务模块自动化生成生成js文件
- 【C#学习】索引函数
- 引用参数和传值参数
- mysql ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) ....
- mybatis+oracle generator 配置和异常处理
- sleep和wait区别
- mysql php 查询后怎样获取数据
- Sorting Algorithms
- Softmax和交叉熵
- 编程通用知识
- eclipse oxygen4.7 bug: jsp html 标签Option 嵌入jsp标签如<c:if>报错
- Xen中半虚拟化的创建与配置