9

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?

1 Answer 1

15

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:

3
  • 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, 2018 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, 2018 at 19:08
  • 1
    I still don't understand. Languages sort characters by accents, not by case.
    – Robo Robok
    Dec 21, 2018 at 19:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .