错误号:1267 非法混合排序规则 (latin1_swedish_ci,IMPLICIT) 和 (utf8_general_ci,COERCIBLE) 用于操作 '='

Error Number: 1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

Table 姓名:xyz 类型:InnoDB Collation:latin1_swedish_ci

字段:

---------------------------------------------------------------------------
            Field        | Type        | Collation         | Extra        |
---------------------------------------------------------------------------
            id           | int         |                   | Primary Key  |
---------------------------------------------------------------------------
            name         | varchar     | latin1_swedish_ci |              |
---------------------------------------------------------------------------

这是我的数据库table。当我尝试为名称插入一个值时,类似这样

If T₀, T₁, T₂ . . . . . . . Tn represent the terms in the expansion of (x + a)n, then (T₀ - T₂ + T₄ - . . )2 + (T₁ - T₃ + T₅ - . . )2 

我收到以下错误:

Error Number: 1267Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

我进行了快速研究,发现许多 S.O 问题和提供解决方案的文章,但其中 none 对我有用。

我的参考:Visit

我尝试使用如下查询更改 table 的排序规则:

ALTER TABLE xyz CHARACTER SET utf8 COLLATE utf8_general_ci;

但错误依旧。

我也试过使用utf8_unicode_ci,但还是不行。

原因?解决方案?谢谢。

感谢@vhu 将其标记为重复。

回答礼貌:@Marvin W

我修改了 table 并解决了我的问题。

ALTER TABLE xyz CONVERT TO CHARACTER SET utf8;