MySQL database management

Source: Internet
Author: User

the database provides a variety of character sets, such asLatin1,UTF8,GdK,Big5and so on. A character set refers to a comparison rule between characters within the same character set. Only after you determine the character Fu She can you define what is equivalent on a character set and the size relationship between characters. A character set can contain multiple characters Fu She, each with a default character Fu She (Default Collation), each character uniquely corresponds to one character set. MySQLThe character naming rule is to start with the character set name corresponding to the Fu She, centered with the country name (or GeneralCenter), toci,CSorbinend. InciThe trailing character indicates that the case is not sensitive toCSthe end of the character set indicates case sensitivity tobinthe end of the character set sequence represents the comparison by binary encoded values. For example:latin1Character Set hasLatin1_swedish_ci,Latin1_gengeral_cs,Latin1_binand so the word Fu She, which in the word Fu SheLatin_swedish_ciThe rule, the character 'a' and 'A"is equivalent.

Latin1 supports Western European characters, Greek characters, etc.,GBK supports Chinese character characters,Big5 supports Chinese characters, andUTF8 almost all countries in the world.

Latin1 occupies one byte (8 bits)

Gbk occupies two bytes

Utf8 occupies three bytes

use MySQL command:show character set; view character set.

650) this.width=650; "src=" http://blog.itpub.net/attachment/201408/1/29272216_1406871058T4Ai.jpg "width=" 700 " Height= "646" style= "border:0px;"/>

Use the mysql command:show variables like 'character%'; View the character set used by the current MySQL session, where Character_ The Sets_dir parameter defines the MySQL character Set File save path

"C:\programfiles\mysql\mysql server 5.6\share\charsets"

650) this.width=650; "src=" http://blog.itpub.net/attachment/201408/1/29272216_1406871142PPUU.jpg "width=" 700 " height= "370" style= "border:0px;"/>

Where,client: The character set of theMySQL client, after MySQL is installed by default, the value is latin1

Connection: The character set of a data communication link that requests data to be encoded in that character set when the MySQL client sends a request to the server. When the database is installed by default, the value is latin1

Database: DB character set, this value is latin1 when the database is installed by default

Filesystem: The character set of theMySQL server file system, the value is fixed binary

Results: The character set of the result set, when theMySQL server returns the execution result to the MySQL client, the execution result is encoded in that character set. When installed by default, this value is latin1

server:mysql Server instance character set, when MySQL is installed by default, this value is latin1

System: The character set of the metadata (field name, table name, database name, and so on), the default value is UTF8.

Use "Show variables like ' collation% '" to view the word Fu She used by the current MySQL session.

650) this.width=650; "Src=" http://blog.itpub.net/attachment/201408/1/ 29272216_14068714423vi6.jpg "width=" 449 "height=" 164 "style=" border:0px; "/>

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.