Note
This variable is available starting with V1.4.
Description
collation_database specifies the default character set and collation for a database.
Applicability
This variable is applicable only to OceanBase Database in MySQL mode.
Privilege requirements
Query variables
Global level
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to view the value of a global system variable.Session level
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.SESSION_VARIABLESview (MySQL mode) to view the value of a session system variable.
Modify variables
Global level
systenant can directly modify the value of a global system variable.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Session level
systenant and all user tenants can directly modify the value of a session system variable of the current tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | String |
| Default value | utf8mb4_general_ci |
| Value range |
|
| Scope |
|
| Modifiable | Yes. You can execute the SET or ALTER SESSION SET statement to modify the value. |
| Nullable | Yes |
Examples
Specify the default character set and collation for a database as utf8mb4_general_ci.
Global level
obclient> SET GLOBAL collation_database='utf8mb4_general_ci';Session level
obclient> SET collation_database='utf8mb4_general_ci';
