How to easily master Mysql table Character Set and proofread

Source: Internet
Author: User

Each table has a table character set and a proofreading rule. It cannot be blank. To specify the TABLE Character Set and collation, the create table and alter table statements have an optional clause:

Create table tbl_name (column_list)
[Default character set charset_name [COLLATE collation_name]
Alter table tbl_name
[Default character set charset_name] [COLLATE collation_name]

For example:

Create table t1 (...)
Default character set latin1 COLLATE latin1_danish_ci;

MySQL selects the table Character Set and proofreading rules as follows:

· If character set x and collate y are specified, character set x and collate y are used.

· If character set x is specified but collate y is not specified, character set x and character set x are used as the default proofreading rules.

· Otherwise, server character sets and server verification rules are used.

If the column Character Set and collation are not specified in the column definition, the table Character Set and collation are used by default. Table character sets and proofreading rules are extensions of MySQL; they are not in standard SQL.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.