1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE)

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,mysql,sql)