MySQL collation names follow these conventions:
A collation name starts with the name of the character set with which it is associated, generally followed by one or more suffixes indicating other collation characteristics. For example,
utf8mb4_0900_ai_ciandlatin1_swedish_ciare collations for theutf8mb4andlatin1character sets, respectively. Thebinarycharacter set has a single collation, also namedbinary, with no suffixes.A language-specific collation includes a locale code or language name. For example,
utf8mb4_tr_0900_ai_ciandutf8mb4_hu_0900_ai_cisort characters for theutf8mb4character set using the rules of Turkish and Hungarian, respectively.utf8mb4_turkish_ciandutf8mb4_hungarian_ciare similar but based on a less recent version of the Unicode Collation Algorithm.Collation suffixes indicate whether a collation is case-sensitive, accent-sensitive, or kana-sensitive (or some combination thereof), or binary. The following table shows the suffixes used to indicate these characteristics.
Table 1.1 Collation Suffix Meanings
Suffix Meaning _aiAccent-insensitive _asAccent-sensitive _ciCase-insensitive _csCase-sensitive _ksKana-sensitive _binBinary For nonbinary collation names that do not specify accent sensitivity, it is determined by case sensitivity. If a collation name does not contain
_aior_as,_ciin the name implies_aiand_csin the name implies_as. For example,latin1_general_ciis explicitly case-insensitive and implicitly accent-insensitive,latin1_general_csis explicitly case-sensitive and implicitly accent-sensitive, andutf8mb4_0900_ai_ciis explicitly case-insensitive and accent-insensitive.For Japanese collations, the
_kssuffix indicates that a collation is kana-sensitive; that is, it distinguishes Katakana characters from Hiragana characters. Japanese collations without the_kssuffix are not kana-sensitive and treat Katakana and Hiragana characters equal for sorting.For the
binarycollation of thebinarycharacter set, comparisons are based on numeric byte values. For the_bincollation of a nonbinary character set, comparisons are based on numeric character code values, which differ from byte values for multibyte characters. For information about the differences between thebinarycollation of thebinarycharacter set and the_bincollations of nonbinary character sets, see Section 1.8.5, “The binary Collation Compared to _bin Collations”.Collation names for Unicode character sets may include a version number to indicate the version of the Unicode Collation Algorithm (UCA) on which the collation is based. UCA-based collations without a version number in the name use the version-4.0.0 UCA weight keys. For example:
utf8mb4_0900_ai_ciis based on UCA 9.0.0 weight keys (http://www.unicode.org/Public/UCA/9.0.0/allkeys.txt).utf8mb4_unicode_520_ciis based on UCA 5.2.0 weight keys (http://www.unicode.org/Public/UCA/5.2.0/allkeys.txt).utf8mb4_unicode_ci(with no version named) is based on UCA 4.0.0 weight keys (http://www.unicode.org/Public/UCA/4.0.0/allkeys-4.0.0.txt).
For Unicode character sets, the
collations preserve the pre-5.1.24 ordering of the originalxxx_general_mysql500_cicollations and permit upgrades for tables created before MySQL 5.1.24 (Bug #27877).xxx_general_ci