MySQL Character set selection utf8mb4

Source: Internet
Author: User

For historical reasons, the UTF8 character set provided by MySQL in previous versions of 5.5.3 is not really utf8, it is just a subset of UTF8 and provides limited UTF8 support. Starting with mysql5.5.3, MySQL changed the internal details implementation, added a UTF8MB4 character set, supported True Unicode, and extended the length from the previous maximum of 3 bits to 4 bits, such as emoticons such as emoji can finally be stored in MySQL.

Whether MySQL provides an older version of the UTF8 character set or utf8mb4,php is handled correctly.

If your MySQL version supports UTF8MB4, it's a good idea to add the following settings in MY.CNF:

[Client]
Default-character-set = Utf8mb4

[MySQL]
Default-character-set = Utf8mb4

[Mysqld]
Character-set-client-handshake = FALSE
Character-set-server = Utf8mb4
Collation-server = Utf8mb4_unicode_ci
init_connect= ' SET NAMES utf8mb4 '

In MySQL, variable name separators are used-or _ are correct, preferably unified.

Other places refer here.

MySQL Character set selection utf8mb4

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.