首页 » MySQL » 正文

MySQL报错:Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ‘XXX’

执行SQL语句遇到如下报错信息:

Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ‘XXX’

 

原因是因为字符集不统一导致执行失败,将会话连接的字符集修改与Server端字符集统一即可。

SET character_set_connection = character_set_server

SET character_set_client= character_set_server

执行以上语句将等号后边替换成对应的value(如:gbk)。

发表评论