Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
docs:mysql:character_sets [2007/03/21 09:56] – billh | docs:mysql:character_sets [2008/08/03 00:25] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Character Sets ====== | ||
+ | * List available character sets | ||
+ | * SHOW CHARACTER SET; | ||
+ | * List collation for character set | ||
+ | * SHOW COLLATION LIKE ' | ||
+ | * Find character set and collation for a specific database | ||
+ | * SHOW CREATE DATABASE databasename; | ||
+ | * Find character set and collation for a specific table | ||
+ | * SHOW CREATE TABLE tablename; | ||
+ | * Find character set and collation for columns | ||
+ | * SHOW FULL COLUMNS FROM tablename; | ||
+ | ===== Changing/ | ||
+ | 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 | ||
+ | |||
+ | ===== Notes ===== | ||
+ | * 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), | ||
+ | |||
+ | ===== See Also ===== | ||
+ | * [[alter_table|ALTER TABLE]] | ||
+ | * [[show|SHOW]] | ||
+ | |||
+ | ===== External Links ===== | ||
+ | * http:// |