Every database has a database character set and a database collation. : COLLATION Character Set : Table MySQL TUTORIALS


MySQL TUTORIALS » Table » COLLATION Character Set »

 

Every database has a database character set and a database collation.


The CREATE DATABASE and ALTER DATABASE statements have optional clauses for specifying the database character set and collation:

All database options are stored in a text file named db.opt that can be found in the database directory.

CREATE DATABASE db_name
    [[DEFAULTCHARACTER SET charset_name]
    [[DEFAULTCOLLATE collation_name]

ALTER DATABASE db_name
    [[DEFAULTCHARACTER SET charset_name]
    [[DEFAULTCOLLATE collation_name]
CREATE DATABASE db_name CHARACTER SET X COLLATE Y;

If both CHARACTER SET X and COLLATE Y were specified, then character set X and collation Y.

If CHARACTER SET X was specified without COLLATE, then character set X and its default collation.

If COLLATE Y was specified without CHARACTER SET, then the character set associated with Y and collation Y.

Otherwise, the server character set and server collation.

Quote from MySQL document http://www.mysql.com

CREATE DATABASE db_name CHARACTER SET latin1 COLLATE latin1_swedish_ci;



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Table
» COLLATION Character Set