mysql错误提示Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)

来源:互联网 发布:如何安装ubuntu系统 编辑:程序博客网 时间:2024/04/30 07:41
1.修改表编码

ALTER TABLE 表名 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;

2.修改字段的编码:
ALTER TABLE 表名 CHANGE `列明` `列明` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
 
通过以上两个步骤可以解决上述Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)错误
0 0