By default, OceanBase Database uses the utf8mb4 character set.
OceanBase Database supports the following character sets:
binarygbkgb18030utf16utf8mb4
Note
- To support seamless migration, OceanBase Database uses
utf8as a synonym ofutf8mb4.- You cannot modify the database character set after you create the database.
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
+---------+-----------------------+--------------------+--------+
5 rows in set (0.00 sec)
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 (0.00 sec)