每个排序规则必须有一个唯一的 ID。要添加排序规则,您必须选择一个当前未使用的 ID 值。MySQL 支持双字节排序规则 ID。ID 范围从 1024 到 2047 保留给用户自定义排序规则。Each collation must have a unique ID. To add a collation, you must choose an ID value that is not currently used. MySQL supports two-byte collation IDs. The range of IDs from 1024 to 2047 is reserved for user-defined collations.
您选择的排序规则 ID 会出现在以下上下文中:The collation ID that you choose appears in these contexts:
Information Schema
COLLATIONS表的ID列。TheIDcolumn of the Information SchemaCOLLATIONStable.SHOW COLLATION输出的Id列。TheIdcolumn ofSHOW COLLATIONoutput.MYSQL_FIELDC API 数据结构的charsetnr成员。Thecharsetnrmember of theMYSQL_FIELDC API data structure.MY_CHARSET_INFO数据结构的number成员,由mysql_get_character_set_info()C API 函数返回。Thenumbermember of theMY_CHARSET_INFOdata structure returned by themysql_get_character_set_info()C API function.
要确定当前使用的最大 ID,请发出以下语句:To determine the largest currently used ID, issue the following statement:
mysql> SELECT MAX(ID) FROM INFORMATION_SCHEMA.COLLATIONS;
+---------+
| MAX(ID) |
+---------+
| 247 |
+---------+
要显示所有当前使用的 ID 列表,请发出此语句:To display a list of all currently used IDs, issue this statement:
mysql> SELECT ID FROM INFORMATION_SCHEMA.COLLATIONS ORDER BY ID;
+-----+
| ID |
+-----+
| 1 |
| 2 |
| ... |
| 52 |
| 53 |
| 57 |
| 58 |
| ... |
| 98 |
| 99 |
| 128 |
| 129 |
| ... |
| 247 |
+-----+
在升级之前,您应保存已更改的配置文件。如果进行就地升级,过程将替换已修改的文件。Before upgrading, you should save the configuration files that you change. If you upgrade in place, the process replaces the modified files.