All Products
Search
Document Center

ApsaraDB RDS:How do I use the utf8mb4 character set to store emojis in an ApsaraDB RDS for MySQL instance?

Last Updated:Jul 14, 2025

When you store emojis in an ApsaraDB RDS for MySQL instance, the error code [1366]; Incorrect string value: 'xx' or General error: 3988 Conversion from collation utf8mb3_general_ci into utf8mb4_general_ci impossible for parameter error message may be displayed. The cause is that a character in the UTF-8 character set supports up to 3 bytes. However, 4 bytes are required to store an emoji. In this case, you can use the utf8mb4 character set to store emojis.

Compatibility requirements

To store emojis in an RDS instance, you must use the utf8mb4 character set for the following components:

  • Client: The client uses the utf8mb4 character set for the output strings.

  • Database connection layer: The utf8mb4 character set is supported. For example, if you create JDBC connections, make sure that the following requirements are met:

    • The MySQL Connector/J driver runs version 5.1.13 or later.

    • You do not configure the characterEncoding parameter for the JDBC connection strings.

  • RDS instance:

Character set change

If the character set does not meet your business requirements, you can change the character set based on the following priority:

  1. Instance-level parameter character_set_server

  2. Database character set

  3. Table character set

  4. Field character set

Note

After you change the character set from utf8 to utf8mb4, take note of the following points:

  • The data compatibility is not affected.

  • You can store emojis for new data.

  • The estimated data storage is increased.