Each collation must have a unique ID. To add a new collation, you must choose an ID value that is not currently used. The range of IDs from 1024 to 2047 is reserved for user-defined collations. Before MySQL 5.5, the ID must be chosen from the range 1 to 254. The collation ID that you choose will show up in these contexts:
The
Idcolumn ofSHOW COLLATIONoutputThe
IDcolumn of theINFORMATION_SCHEMA.COLLATIONStableThe
charsetnrmember of theMYSQL_FIELDC API data structureThe
numbermember of theMY_CHARSET_INFOdata structure returned by themysql_get_character_set_info()C API function
To determine the largest currently used ID, issue the following statement:
mysql> SELECT MAX(ID) FROM INFORMATION_SCHEMA.COLLATIONS;
+---------+
| MAX(ID) |
+---------+
| 210 |
+---------+
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 |
| ... |
| 210 |
+-----+
Before MySQL 5.5, which provides for a range of user-defined collation IDs, you must choose an ID in the range from 1 to 254. In this case, if you upgrade MySQL, you may find that the collation ID you choose has been assigned to a collation included in the new MySQL distribution. In this case, you will need to choose a new value for your own collation.
In addition, before upgrading, you should save the configuration files that you change. If you upgrade in place, the process will replace the your modified files.