Concepts > Attributes (MetaAttributes) > CHARACTER SET \ MySQL
CHARACTER SET \ MySQL
Every "character" column (that is, a column of type CHAR, VARCHAR, or TEXT) has a column character set and a column collation. Column definition syntax has optional clauses for specifying the column character set and collation:
col_name {CHAR | VARCHAR | TEXT} (col_length)
[CHARACTER SET charset_name] [COLLATE collation_name]
 
Example:
CREATE TABLE Table1
(
column1 VARCHAR(5) CHARACTER SET latin1 COLLATE latin1_german1_ci
);
MySQL chooses the column character set and collation in the following manner:
- If both CHARACTER SET X and COLLATE Y were specified, then character set X and collation Y
are used.
- If CHARACTER SET X was specified without COLLATE, then character set X and its default collation
are used.
- If COLLATE Y was specified without CHARACTER SET, then the character set associated with Y
and collation Y.
- Otherwise, the table character set and collation are used.
The CHARACTER SET and COLLATE clauses are standard SQL.
Translations
Type
String (63) Enumeration
 
List of MetaClasses
Value
(ar8), (asi), (bi5), (biy), (cp0), (cp1), (cp2), (cp3), (cp4), (cp5), (cp6), (cp7), (de8), (eus), (eur), (gb2), (gbk), (ge8), (grk), (hew), (hp8), (ke2), (kor), (kou), (la1), (la2), (la5), (la7), (mae), (man), (sjs), (sw7), (ti0), (uc2), (ujs), (ut8).