Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I need your help in identifying why this error is coming

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

The procedure was working fine till yesterday and today it started giving error of illegal mix of collations. I checked each and every table of my database and all the tables and its columns are in one charset and collation that is:- utf8 utf8_unicode_ci.

I created another schema with same structrue and tried to execute same query it works fine but not on its original schema.

can anyone provide any input on this? Why is so happening ?

like image 929
MySQL DBA Avatar asked Jun 15 '09 12:06

MySQL DBA


People also ask

What is the difference between utf8mb4_unicode_ci and utf8mb4_general_ci?

utf8mb4_unicode_ci is based on the official Unicode rules for universal sorting and comparison, which sorts accurately in a wide range of languages. utf8mb4_general_ci is a simplified set of sorting rules which aims to do as well as it can while taking many short-cuts designed to improve speed.

What is utf8_general_ci?

utf8_general_ci is a legacy collation that does not support expansions, contractions, or ignorable characters. It can make only one-to-one comparisons between characters.


2 Answers

I've had same problem, and i discovered that tables had same collation, but columns did not. You could download mysqlyog trial and in alter table uncheck hide language options.... Quickest way to see.

like image 181
Radmilo Avatar answered Oct 06 '22 08:10

Radmilo


in my case it was due to stupid mysql workbench - it somehow adds to procedure default collation from schema (to some metadata or what) and then if you collate anything in procedure to different collation, this exception occurs;

must set correct (the one which is used in procedure) collation to schema and then to re-edit the procedure and apply changes (must be resaved or recreated) and everything is ok now

like image 28
meriu Avatar answered Oct 06 '22 08:10

meriu