Help Center/
GaussDB/
Service Overview/
Compatibility with MySQL Databases/
Centralized Instances/
MySQL Compatibility in M-Compatible Mode/
Character Sets
Updated on 2024-11-11 GMT+08:00
Character Sets
GaussDB allows you to specify the following character sets for databases, schemas, tables, or columns.
No. |
MySQL |
GaussDB |
---|---|---|
1 |
utf8mb4 |
Supported |
2 |
utf8 |
Supported |
3 |
gbk |
Supported |
4 |
gb18030 |
Supported |
5 |
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 report an error. 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.
- Currently, GaussDB does not perform strict encoding logic verification on invalid characters that do not belong to the current character set. As a result, such invalid characters may be successfully entered. However, an error is reported during verification in MySQL.
Parent topic: MySQL Compatibility in M-Compatible Mode
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot