Note
This variable is available starting with V1.4 and is only used for compatibility with MySQL. While you can query and set it, the related features are not supported. Changing the value has no effect and does not produce an error.
Description
collation_database specifies the default character set and collation for the database.
Applicability
This variable applies only to OceanBase Database in MySQL mode.
Privilege requirements
Query variables
Global variables
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to obtain the values of Global system variables.Session variables
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.SESSION_VARIABLESview (MySQL mode) to obtain the values of Session system variables.
Modify variables
Global level
systenants can directly modify the values of Global system variables.MySQL user tenants can modify the values of Global system variables only if they have the
SUPERorALTER SYSTEMprivilege.
Session level
systenants and all user tenants can directly modify the values of Session system variables of their own tenants.
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 the database as utf8mb4_general_ci.
Global level
obclient> SET GLOBAL collation_database='utf8mb4_general_ci';Session level
obclient> SET collation_database='utf8mb4_general_ci';