Documentation Home
MySQL 5.5 Reference Manual
Related Documentation Download this Manual Excerpts from this Manual

MySQL 5.5 Reference Manual  /  ...  /  Collation Naming Conventions

10.1.3 Collation Naming Conventions

MySQL collation names follow these conventions:

  • A collation name starts with the name of the character set with which it is associated, followed by one or more suffixes indicating other collation characteristics. For example, utf8_general_ci and latin_swedish_ci are collations for the utf8 and latin1 character sets, respectively.

  • A language-specific collation includes a language name. For example, utf8_turkish_ci and utf8_hungarian_ci sort characters for the utf8 character set using the rules of Turkish and Hungarian, respectively.

  • A collation may be case and accent sensitive, or binary. For a binary collation, character comparisons are based on character binary code values. The following table shows the suffixes used to indicate these sorting characteristics.

    Table 10.1 Collation Case Sensitivity Suffixes

    Suffix Meaning
    _ai Accent insensitive
    _as Accent sensitive
    _ci Case insensitive
    _cs Case sensitive
    _bin Binary

    For nonbinary collation names that do not specify accent sensitivity, it is determined by case sensititivy. That is, if a collation name does not contain _ai or _as, _ci in the name implies _ai and _cs in the name implies _as.

    For example, latin1_general_ci is case insensitive (and accent insensitive, implicitly), latin1_general_cs is case sensitive (and accent sensitive, implicitly), and latin1_bin uses binary code values.

  • For Unicode character sets, the xxx_general_mysql500_ci collations preserve the pre-5.1.24 ordering of the original xxx_general_ci collations and permit upgrades for tables created before MySQL 5.1.24. For more information, see Section 2.11.3, “Checking Whether Tables or Indexes Must Be Rebuilt”, and Section 2.11.4, “Rebuilding or Repairing Tables or Indexes”.

User Comments
Sign Up Login You must be logged in to post a comment.