Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I've tried using a stored procedure to create indices, and got the following error:

ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,IMPLICIT) and 
                    (utf8_unicode_ci,IMPLICIT) for operation '='

There's no line number or any other debugging hint.

  • What's the best way to debug this error?
  • Are there any good guidelines to avoid encoding inconsistencies?
share|improve this question
1  
Let's hear it for solving your own problems. +1 !!! –  RolandoMySQLDBA Sep 20 '12 at 16:21
    
Use COLLATE utf8_unicode_ci before all parameters used –  user36588 Apr 4 at 6:14
add comment

1 Answer 1

up vote 2 down vote accepted

After some trial and error, I've learned how and where to apply COLLATE:

Converted lines like:

SELECT SOMETHING
FROM SOMEWHERE
WHERE table_schema = given_database
AND   table_name   = given_table
AND   index_name   = given_index;

To:

SELECT SOMETHING
FROM SOMEWHERE
WHERE table_schema COLLATE utf8_unicode_ci = given_database
AND   table_name   COLLATE utf8_unicode_ci = given_table
AND   index_name   COLLATE utf8_unicode_ci = given_index;
share|improve this answer
2  
Again I say, let's hear it for solving your own problems. +1 !!! –  RolandoMySQLDBA Sep 20 '12 at 16:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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