Modify the MySQL encoding method

Source: Internet
Author: User

The first type :
Modified via MySQL command line:
1) First look at the database character encoding, the command is:
Show variables like ' collation_% ';
Show variables like ' character_set_% ';
2) Modify the character encoding at the command line (for example, gb3212)
Set character_set_client=gb2312; Client Encoding method
Set character_set_connection= gb2312; establish the encoding used for the connection
Set character_set_database= gb2312; the encoding of the database
Set character_set_results= gb2312; the encoding of the result set
Set character_set_server= gb2312; the encoding of the database server
Ensure that the first five uses the same encoding method, there will be no garbled problem.
Set character_set_system= gb2312;
Set collation_connection= gb2312;
Set collation_database= gb2312;
Set collation_server= gb2312;
The second type:
The MySQL database can be removed for reinstallation and can be set up directly with MySQL Server Instance Configwizard during the installation process.
The third type:
If you want to modify the entire database, you can change the configuration file directly:
Open the MySQL installation directory, find My.ini This file, open with Notepad or edit with VI,
Under [client] and [MySQL], add:
Default-character-set=utf8 This field, it is set encoding, followed by the encoding format, added can be

Modify the MySQL encoding method

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.