gpt4 book ai didi

MySQL - 什么是 utf8_general_mysql500_ci?

转载 作者:可可西里 更新时间:2023-11-01 06:36:43 28 4
gpt4 key购买 nike

我刚刚看到 MySQL 5.5 提供了 utf8_general_mysql500_ci 作为排序规则。

utf8_general_ci 等其他排序规则有什么区别?

我应该更好地使用 utf8_general_mysql500_ci 吗?

最佳答案

根据 Changes in MySQL 5.5.21 记录:

  • New utf8_general_mysql500_ci and ucs2_general_mysql500_ci collations have been added that preserve the behavior of utf8_general_ci and ucs2_general_ci from versions of MySQL previous to 5.1.24. Bug #27877 corrected an error in the original collations but introduced an incompatibility for columns that contain German 'ß' LATIN SMALL LETTER SHARP S. (As a result of the fix, that character compares equal to characters with which it previously compared different.) A symptom of the problem after upgrading to MySQL 5.1.24 or newer from a version older than 5.1.24 is that CHECK TABLE produces this error:

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

    Unfortunately, REPAIR TABLE could not fix the problem. The new collations permit older tables created before MySQL 5.1.24 to be upgraded to current versions of MySQL.

    To convert an affected table after a binary upgrade that leaves the table files in place, alter the table to use the new collation. Suppose that the table t1 contains one or more problematic utf8 columns. To convert the table at the table level, use a statement like this:

    ALTER TABLE t1
    CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci;

    To apply the change on a column-specific basis, use a statement like this (be sure to repeat the column definition as originally specified except for the COLLATE clause):

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

    To upgrade the table using a dump and reload procedure, dump the table using mysqldump, modify the CREATE TABLE statement in the dump file to use the new collation, and reload the table.

    After making the appropriate changes, CHECK TABLE should report no error.

    For more information, see Checking Whether Tables or Indexes Must Be Rebuilt, and Rebuilding or Repairing Tables or Indexes. (Bug #43593, Bug #11752408)

关于MySQL - 什么是 utf8_general_mysql500_ci?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16589472/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com