Overview
collation_database specifies the default character set and collation for creating a database.
Privilege requirements
Query variables
Global level
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement or theinformation_schema.GLOBAL_VARIABLESview to view the values of global system variables.Session level
The
systenant and all user tenants can use theSHOW VARIABLESstatement or theinformation_schema.SESSION_VARIABLESview to view the values of session system variables.
Modify variables
Global effective
The
systenant can directly modify the values of global system variables.The user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Session expiration
The
systenant and all user tenants can directly modify the values of session system variables for their own tenants.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | String |
| Default Value | utf8mb4_general_ci |
| Value range |
|
| Effective Scope |
|
| Modifiable | Yes, you can use the following methods:SETorALTER SESSION SETStatement modification. |
| Whether it can be empty | Yes |
Configuration example
Specify the default character set and collation for database creation as utf8mb4_general_ci.
Effective globally
obclient> SET GLOBAL collation_database='utf8mb4_general_ci';Session expiration
obclient> SET collation_database='utf8mb4_general_ci';