Description of mysql Character Set System Variables

Source: Internet
Author: User

1. character_set_server and collation_server
These two variables are the server's character set. When the system is started, you can use -- character-set-server and -- collation-server to set them. If not, the system sets the two variables to the default values latin1 and latin1_swedish_ci. The default value is compiled in the program and can only be changed through recompilation.
These two variables are only used to provide default values for the create database Command.
2. character_set_database and collation_database
These two variables are the character set of the current database. The create database Command has two parameters that can be used to set the character set and comparison rules of the database. Database creation records the database options in the db. opt file under the database directory, and records the character set settings of the database. When we use to change the current database, mysql will read the database db. opt file to set these two variables. If no database exists, the two variables are character_set_server and collation_server.
These two variables are only used to provide default values for the create table command.
3. character_set_client
This variable is used to determine how mysql interprets the SQL command text sent from the client to the server.
4. character_set_connection and collation_connection
These two variables are used to determine how mysql processes the SQL commands sent from the client. Mysql will convert the SQL command text from character_set_client encoding to character_set_connection and then execute. Collation_connection is used to compare the direct quantity in SQL.
5. character_set_results
When SQL returns results, this variable is used to determine the encoding of the text volume in the results sent to the client.

There are also several character sets that are not represented by system variables.
6. Table Character Set
You can set it in the create table parameter to provide the default value for the column character set.
7. Column Character Set
Determines the storage encoding of text data in this column. The column comparison rule is higher than collation_connection. That is to say, mysql converts the SQL text directly into the column character set and then compares it with the column text data.
8. character_set_system
This is the character set of metadata. Databases, tables, and column definitions use this character set. It has a fixed value, which is UTF-8

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: info-contact@alibabacloud.com 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.