【MySQL】1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIB

MySQL 报错 : 1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation ‘=’"


文章目录

  • MySQL 报错 : 1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation ‘=’"
  • 总结


在插入数据的时候发现报错

1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation ‘=’"


原因: 因为新创建的表字符集是latin1_swedish_ci,而原有的字符集需要utf8mb4_general_ci,所以报错。

ALTER TABLE 表名 CONVERT TO CHARACTER SET 'utf8';

总结

以上就是今天要讲的内容,希望对大家有所帮助!!!

你可能感兴趣的:(遇到的问题,mysql,ci/cd,数据库)