Adding a UCA Collation to a Unicode Character Set 10.14.4.1 Defining a UCA Collation Using LDML Syntax To add a UCA collation for a Unicode character set without recompiling MySQL, use the following procedure. If you are unfamiliar with the LDML rules used to describe the collation’s sort characteristics, see Section 10.14.4.2, “LDML Syntax Supported in MySQL” . The example adds a collation named  utf8_phone_ci  to the  utf8  character set. The collation is designed for a scenario involving a Web application for which users post their names and phone numbers. Phone numbers can be given in very different formats: The problem raised by dealing with these kinds of values is that the varying permissible formats make searching for a specific phone number very difficult. The solution is to define a new collation that reorders punctuation characters, making them ignorable. mysql>  SHOW VARIABLES LIKE ’character_sets_dir’; +--------------------+-----------------------------------------+ | Variable_name | Value | +--------------------+-----------------------------------------+ | character_sets_dir | /user/local/mysql/share/mysql/charsets/ | +--------------------+-----------------------------------------+ 1998 5. Restart the server and use this statement to verify that the collation is present: 4. If you want a similar collation for other Unicode character sets, add other  <collation>  elements. For example, to define  ucs2_phone_ci , add a  <collation>  element to the  <charset name="ucs2"> element. Remember that each collation must have its own unique ID. 3. Choose a name for the collation and list it in the  Index.xml  file. In addition, you’ll need to provide the collation ordering rules. Find the  <charset>  element for the character set to which the collation is being added, and add a  <collation>  element that indicates the collation name and ID, to associate the name with the ID. Within the  <collation>  element, provide a  <rules>  element containing the ordering rules: <charset name="utf8"> ... <collation name="utf8_phone_ci" id="1029"> <rules> <reset>\u0000</reset> <i>\u0020</i> <!-- space --> <i>\u0028</i> <!-- left parenthesis --> <i>\u0029</i> <!-- right parenthesis --> <i>\u002B</i> <!-- plus --> <i>\u002D</i> <!-- hyphen --> </rules> </collation> ... </charset> 2. To modify the  Index.xml  configuration file. This file is located in the directory named by the character_sets_dir  system variable. You can check the variable value as follows, although the path name might be different on your system: 1. Choose a collation ID, as shown in Section 10.14.2, “Choosing a Collation ID” . The following steps use an ID of 1029. +7-12345-67 +7-12-345-67 +7 12 345 67 +7 (12) 345 67 +71234567