The conversion process of the MySQL character set

Source: Internet
Author: User

1. Open a Command Prompt window, where the command prompt window itself has a character set that is viewed by right-clicking on the title bar of the command Prompt window and selecting the default value - Options - The default code page allows you to set the character set of the current command prompt window.

2 . Enter the mysql command or SQL statement in the Command Prompt window, and after carriage returns, these MySQL commands or SQL statements are converted from the command Prompt window character set to the character_set_client"defined character set

3 . After successfully connecting to the MySQL server using the Command Prompt window, a "Data communication link" has been established, and themysql command or SQL statement is passed to MySQL along the link. server, the character set defined by "character_set_client" is converted to character_set_connection to define the character set

4. The MySQL service instance receives a mysql command or SQL statement from the data communication link, and the MySQL statement or SQL statement from Character_set_connection defined character set converted to character_set_server defined character set

5. if the mysql command or SQL statement operates on a database, the mysql command or SQL command is Character_set_server defined character set converted to character_set_database defined character set

6. After the MySQL command or SQL statement finishes executing, set the execution result to character_set_results to define the character set

7 . The execution result is returned along the Open Data Communication link path, and the execution result is character_set_results defined character set to character_set_client The final conversion to the command Prompt window character set is displayed in the Command Prompt window.

setting of the character set

1. Modify the my.ini configuration file

2. MySQL provides the following MySQL commands, which can "temporarily" modify the MySQL"current session", the character set in word order

3. Set names GBK can "temporarily" set character_set_client\connection\results\ 's character set on a "temporary" basis

4 . Specify the character set when connecting to the MySQL server. mysql-default-character-set= Character Set –h server IP address –u account name –p password for example " Mysql-default-character-set=gbk-h 127.0.0.1–u root-proot"

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.