mysql数据库将数据库的编码格式改为了utf8mb4见该篇以便能够存储emoji表情">迁移服务器时,重建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)