docs:mysql:character_sets

This is an old revision of the document!


Character Sets

  • List available character sets
    • SHOW CHARACTER SET;
  • List collation for character set
    • SHOW COLLATION LIKE 'latin1%';

Initially, the server character set and collation depend on the options that you use when you start mysqld. You can use –character-set-server for the character set. Along with it, you can add –collation-server for the collation. If you don't specify a character set, that is the same as saying –character-set-server=latin1. If you specify only a character set (for example, latin1) but not a collation, that is the same as saying –character-set-server=latin1 –collation-server=latin1_swedish_ci because latin1_swedish_ci is the default collation for latin1.

  • Two different character sets cannot have the same collation.
  • Each character set has one collation that is the default collation. For example, the default collation for latin1 is latin1_swedish_ci. The output for SHOW CHARACTER SET indicates which collation is the default for each displayed character set.
  • There is a convention for collation names: They start with the name of the character set with which they are associated, they usually include a language name, and they end with _ci (case insensitive), _cs (case sensitive), or _bin (binary).
  • docs/mysql/character_sets.1174461809.txt.gz
  • Last modified: 2008/08/03 00:25
  • (external edit)