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
systenants 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
systenants 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
systenants 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
systenants and all user tenants can directly modify the value of a Session system variable.
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
Set the default character set and collation for a database to utf8mb4_general_ci.
Global level
obclient> SET GLOBAL collation_database='utf8mb4_general_ci';Session level
obclient> SET collation_database='utf8mb4_general_ci';