8

I tried to change collation MySQL table to utf8_general_cs but got following error:

mysql> ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_cs';
ERROR 1273 (HY000): Unknown collation: 'utf8_general_cs'

I run "SHOW COLLATE" command and "utf8_general_cs" is not in the results.

What can I do now?

12

MySQL doesn't have case-sensitive Unicode collations, because it's a difficult problem. Some languages collate lower-case before upper-case, and others collate upper-case before lower-case. SQL Server tries to do case-sensitive Unicode, taking locale into consideration.

You have a couple of choices:

  • It's interesting how case-sensitive is a difficult problem. If you asked me to guess, I would take a shot that case-insensitive is a more difficult problem to solve. Can you elaborate on that a little? – Robo Robok Dec 13 '18 at 23:03
  • The next sentence describes the problem. IBM has a series of pages about "language-aware collation." Case-insensitive is super easy, because it doesn't matter how the language sorts different cases. – David M Dec 21 '18 at 19:08
  • I still don't understand. Languages sort characters by accents, not by case. – Robo Robok Dec 21 '18 at 19:13
  • Sorry, I'm busy today. Maybe this will help: lmgtfy.com/?q=why+is+unicode+case+sensitive+hard – David M Dec 21 '18 at 19:50
  • It returns nothing, because your statement is just not true. – Robo Robok Dec 21 '18 at 19:55

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.