练习MySQL出错:

ERROR 1267 (HY000): Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (gbk_chinese_ci,COERCIBLE) for operation 'ifnull'

造成该错误的原因是由于新生成的表的字符集是latin1_swedish_ci,而原有的字符集需要utf8_general_ci,所以报错。

解决方法:修改所有表的字符集为utf8即可

alter table student_table convert to character set utf8;

 

posted on 2021-08-25 10:30  JxSir  阅读(1799)  评论(0编辑  收藏  举报