Basic types of Mysql character set and unified character Set analysis _mysql

Source: Internet
Author: User
Tags mysql in create database
The following article mainly introduces the basic types of MySQL character set, the actual operation of the unified character set, and other related content of the introduction, the following is the MySQL character set related content description, I hope you will be in the future study or work to bring a lot of help.

A. mysql Character set type

The concept of character set is used in six key locations in the MySQL server: client, connection, database, results, server, System.

A, where the client is the user's character set, the equivalent of the page in the character set as follows <meta http-equiv= "Content-type" content= "text/html;" Charset=utf-8 ">.

b, where the connection is the MySQL character set type of the connection database, if PHP does not indicate the type of character set used by the connection database, follow the server-side default character set.

c, where the database is a set of character sets used by a library in the databases server, the character set settings specified when the server was installed are used when the library is not specified.

D, results is the MySQL character set that the database uses when returning to the client, if not indicated, use the server default character set.

E, server is the default set of character sets that are specified when you install your servers.

F, System is the set of character sets used by database systems.

Ps:

1. System generally defaults to the Utf-8 character set, the server is the highest set of characters, the database does not have to set the server according to the character set, the other is in accordance with the settings of the server set up the character set.

2. Each table and field in the database also has the concept of character set, generally based on the structure of the previous level to determine their own character set, such as the table based on the database library to determine their own character set, the field based on the table to determine their own character set.

two. Unified Character Set Method: (Install in utf-8 character set)

1. The way to completely resolve the character set is to let MySQL in the installation is to use the Utf-8 character set (default is Latin1), so that the above six key points of the coding are utf-8.

2. Use the status command to view the state of each category character set in MySQL.

You can also use show VARIABLES like ' character_set_% ' to view some of the settings for the MySQL character set.

three. If MySQL is installed in the character set for Latin1

When a library is being built, the character set of the specified database is UTF8.
Copy Code code as follows:

CREATE DATABASE qss DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;

The above related content is to the MySQL character set summary introduction, hope you can have the harvest.

The above related content is a description of the MySQL character set summary, hopefully it will give you some help in this regard.

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.