MySQL Production library change character set, UTF8-utf8mb4 Emoj

Source: Internet
Author: User

UTF8 is a three-byte character, and the Emoj expression is a four-sub-section, so you need to change the character set to UTF8MB4. The latter is compatible with UTF8.

For production libraries with existing data, the change process is as follows:

Very Important! do not operate during peak hours, otherwise the consequences of the lock table may not be predictable

    1. Server side: The JDBC connection needs to support Emoj, but the charset in the JDBC connection string does not support UTF8MB4. Modifying MySQL's character_set_server to UTF8MB4 requires a reboot of the instance . This way, JDBC automatically detects this parameter and remains consistent
    2. MySQL: will need to modify the table, with the following SQL changes. When finished, all char fields will be modified
      ALTER TABLE CONVERT  to CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

MySQL Production library change character set, UTF8-utf8mb4 Emoj

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.