Updated on 2025-06-30 GMT+08:00

Character Sets

GaussDB allows you to specify the following character sets for databases, schemas, tables, or columns.

Table 1 Character sets

MySQL

GaussDB

utf8mb4

Supported.

utf8

Supported.

gbk

Supported.

gb18030

Supported.

binary

Supported.

  • utf8 and utf8mb4 refer to the same character set in GaussDB. The maximum code length is 4 bytes. If the current character set is utf8 and the collation is set to utf8mb4_bin, utf8mb4_general_ci, utf8mb4_unicode_ci, or utf8mb4_0900_ai_ci (for example, by running SELECT _utf8'a' collate utf8mb4_bin), MySQL reports an error but GaussDB does not. The difference also exists when the character set is utf8mb4 and the collation is set to utf8_bin, utf8_general_ci, or utf8_unicode_ci.
  • The lexical syntax is parsed based on byte streams. If a multi-byte character contains code that is consistent with symbols such as '\', '\'', and '\\', the behavior of the multi-byte character is inconsistent with that in MySQL. In this case, you are advised to disable the escape character function temporarily.