By default, OceanBase Database uses the utf8mb4 character set.
OceanBase Database supports the following character sets:
binarygbkgb18030utf16utf8mb4latin1Note
- To support seamless migration, OceanBase Database uses
UTF8as a synonym ofUTF8MB4. - You cannot modify the database character set.
- To support seamless migration, OceanBase Database uses
To view the default character sets, execute the SHOW CHARACTER SET statement:
obclient> SHOW CHARACTER SET;
+---------+-----------------------+--------------------+--------+
| Charset | Description | Default collation | Maxlen |
+---------+-----------------------+--------------------+--------+
| binary | Binary pseudo charset | binary | 1 |
| utf8mb4 | UTF-8 Unicode | utf8mb4_general_ci | 4 |
| gbk | GBK charset | gbk_chinese_ci | 2 |
| utf16 | UTF-16 Unicode | utf16_general_ci | 2 |
| gb18030 | GB18030 charset | gb18030_chinese_ci | 4 |
| latin1 | cp1252 West European | latin1_swedish_ci | 1 |
+---------+-----------------------+--------------------+--------+
5 rows in set
OceanBase Database allows you to specify a character set other than the default one for communication with the server. For example, to use the gbk character set, execute the following statement after you connect to the server:
obclient> SET NAMES gbk;
Query OK, 0 rows affected