MySQL - What is utf8_general_mysql500_ci?

I just saw that MySQL 5.5 offers utf8_general_mysql500_ci as a sort.

What is the difference between other mappings such as utf8_general_ci ?

Should I better use utf8_general_mysql500_ci ?

+6
source share
1 answer

As described in Changes in MySQL 5.5.21 :

  • New utf8_general_mysql500_ci and ucs2_general_mysql500_ci that preserve the utf8_general_ci and ucs2_general_ci from MySQL versions prior to 5.1.24. Error No. 27877 fixed the error in the original collaborations, but introduced incompatibility for columns containing the German 'ß' LATIN SMALL LETTER SHARP S. (As a result of the correction, this character is compared with the characters with which it previously compared different ones). The symptom of the problem after upgrading to MySQL 5.1.24 or later from version older than 5.1.24 is that CHECK TABLE generates this error:

      Table upgrade required.
     Please do "REPAIR TABLE` t` "or dump / reload to fix it!
    

    Sorry, REPAIR TABLE could not fix the problem. New mappings allow you to create old tables created before MySQL 5.1.24 is upgraded to current versions of MySQL.

    To convert the affected table after a binary update that leaves the table files in place, modify the table to use the new sort. Suppose table t1 contains one or more problematic utf8 columns. To convert a table at the table level, use a statement similar to this:

     ALTER TABLE t1 CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci; 

    To apply the change depending on the column, use the following statement (be sure to repeat the definition of the column as indicated in it, with the exception of the COLLATE ):

     ALTER TABLE t1 MODIFY c1 CHAR(N) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci; 

    To update the table using the dump and reload procedure, dump the table using mysqldump , change the CREATE TABLE statement in the dump file to use the new sort, and reload the table.

    After making the appropriate changes, CHECK TABLE does not report an error.

    For more information, see Checking whether tables or indexes need to be restored and Restoring or restoring tables or indexes . (Error No. 43593, Error No. 11752408)

+7
source

Source: https://habr.com/ru/post/945171/


All Articles