Database Coding Issues

Source: Internet
Author: User
Lmysql has six character sets, namely: client, Connection , database, results, server, System. Client is the character set used by clients. Connection is the character set type of the connection database, if the program does not indicate the character set type used by the connection database, follow the server-side default character set setting. Database is the character set used by a library in the DB server, if not specified when the library is built. The set of character sets specified when the server installation is used. Results is the character set that the database uses when it returns to the client, and if not specified, the default character set of the server is used. Server is the default character set that is specified when the server is installed. System is the word used by the database Descriptor settings. L View and modify the database character set? show variables like ' character% ';? Set CHARACTER_SET_RESULTS=GBK;?  Set CHARACTER_SET_CLIENT=GBK; If the default database is the Utf-8 type of 6 character sets, under Dos property by default is GBK processing character set, when inserting data using INSERT INTO statement inserted in Chinese, this Chinese is GBK encoded and then into the database by default as Utf-8 storage is garbled, if? set CHARACTER_SET_CLIENT=GBK; Notifies the database client that GBK is the database that is decoded according to the GBK Code table and then encoded UTF-8 exists in the database, "set CHARACTER_SET_RESULTS=GBK; The code displays the result as GBK.

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.