Information Schema CHARACTER_SETS Table
The Information Schema CHARACTER_SETS
table contains a list of supported character sets, their default collations and maximum lengths.
It contains the following columns:
Column | Description |
---|---|
CHARACTER_SET_NAME |
Name of the character set. |
DEFAULT_COLLATE_NAME |
Default collation used. |
DESCRIPTION |
Character set description. |
MAXLEN |
Maximum length. |
The SHOW CHARACTER SET statement returns the same results (although in a different order), and both can be refined in the same way. For example, the following two statements return the same results:
SHOW CHARACTER SET WHERE Maxlen LIKE '2';
and
SELECT * FROM information_schema.CHARACTER_SETS WHERE MAXLEN LIKE '2';
See Setting Character Sets and Collations for details on specifying the character set at the server, database, table and column levels, and Supported Character Sets and Collations for a full list of supported characters sets and collations.
Example
SELECT CHARACTER_SET_NAME FROM information_schema.CHARACTER_SETS WHERE DEFAULT_COLLATE_NAME LIKE '%chinese%'; +--------------------+ | CHARACTER_SET_NAME | +--------------------+ | big5 | | gb2312 | | gbk | +--------------------+
© 2021 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/information-schema-character_sets-table/