2

Hello I got error in mariadb. In my command two columns have different collate. one is utf8_unicode_ci (a) other is utf8_turkish_ci (b). Why I got error when I compare these columns ( where a = b ) both of them utf8. Error: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_turkish_ci,IMPLICIT) for operation '='

3

It would be useful if you can provide your tables definition. However, your error suggests that your are trying to check equality between two columns having different collation.

One solution is to change collation of one of the columns to match the other collation. Check here - Column Level.

Other solution is to use COLLATE clause (I do not know if this works in mariadb, but it should be there).

Personally, I prefer to avoid COLLATE and harmonize string columns as collation mismatch tend to force lots of COLLATEs (maintenance problems).

  • 1
    I would just add that the reason for the error is that the results of = might be different depending on which collation is used, and the server has no way to decide which one is the right one, so you have to tell it. – jkavalik Dec 26 '15 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.