Character Set settings in Mysql are classified into the following levels: 1. mysql Server-level Character Set 2. database-level Character Set 3. character Set at the data table level 4. each character set at the data column level corresponds to a default sorting method. You can use charactersetcharset and collatecollation respectively.
Character Set settings in Mysql are classified into the following levels: 1. mysql Server-level Character Set 2. database-level Character Set 3. character Set at the data table level 4. the character set at the data column Level Sets a default sorting method for each character set. You can use character set charset and collate collation respectively.
Character Set settings in Mysql are classified into the following centralized levels:
1. Mysql Server-level Character Set
2. Database-level Character Set
3. Data Table-level Character Set
4. character set at the data column level
Each character set corresponds to a default sorting method. You can use character set charset and collate collation to set the database, data table, and data column. Server-level character sets and sorting methods are built-in and set during the compilation phase. You can set them through system variables, which is rarely involved.
When creating databases, data tables, and data columns, set a default utf8 Character Set and utf8_general_ci sorting method (the character set must be compatible with the sorting method ):
create database db_name character set utf8 collate utf8_general_ci;create table tbl_name ( column varchar(10) character set utf8 collate utf8_general_ci) engine = InnoDB character set utf8 collate utf8_general_ci
You can query character_sets and collations data tables in information_schema to obtain supported character sets and sorting methods.
You can also use the following statement to query:
show character set;show collation;
If the character set is not set for the data column, the character set of the data table is used by default. If the character set is not set for the data table, the character set of the database is used by default. If the character set is not set for the database, the character set of the database server is used by default.
Original article address: Mysql character set. Thank you for sharing it.