MySQL issue & Solution: Illegal mix of collations for operation ‘=’

MySQL Error

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


I have two databases in mysql, I have written a sql to compare two table ( &


FROM co, ac

When I execute the request, I will get above error, why it errors?


According to the message, it means that:

  • Table on the left (, field using charset collation utf8_general_ci
  • Table on the right (, field using charset collation utf8_unicode_ci

So in order to compare these two tables from different database, we need to make them to have the same charset and collations.


You have to decide which table to follow the charset and collation?

In my case, I can only modify at so here I did:

alter table `dbA`.`contact` convert to character set utf8 collate utf8_unicode_ci;

This has solved my headache!

If you have more to add, please share your experience in comment.

One reply on “MySQL issue & Solution: Illegal mix of collations for operation ‘=’”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.