Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='

前端 未结 8 1350
一向
一向 2020-11-28 21:36

Error message on MySql:

Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation \'=\'

I have gone

8条回答
  •  暖寄归人
    2020-11-28 22:11

    I had a similar problem, but it occurred to me inside procedure, when my query param was set using variable e.g. SET @value='foo'.

    What was causing this was mismatched collation_connection and Database collation. Changed collation_connection to match collation_database and problem went away. I think this is more elegant approach than adding COLLATE after param/value.

    To sum up: all collations must match. Use SHOW VARIABLES and make sure collation_connection and collation_database match (also check table collation using SHOW TABLE STATUS [table_name]).

提交回复
热议问题