character_set_results

2025-12-01 14:37:59  Updated

Note

This variable is available starting with V1.4.

Description

character_set_results specifies the character set to which the server should convert result sets or error messages before sending them to the client.

Privilege requirements

  • Query variables

    • Global level

      sys tenants and all user tenants can execute the SHOW VARIABLES statement or query the SYS.TENANT_VIRTUAL_GLOBAL_VARIABLE view (Oracle mode) or the information_schema.GLOBAL_VARIABLES view (MySQL mode) to view the values of global system variables.

    • Session level

      sys tenants and all user tenants can execute the SHOW VARIABLES statement or query the SYS.TENANT_VIRTUAL_SESSION_VARIABLE view (Oracle mode) or the information_schema.SESSION_VARIABLES view (MySQL mode) to view the values of session system variables.

  • Modify variables

    • Global level

      • sys tenants can directly modify the values of global system variables.

      • MySQL user tenants need to have the SUPER or ALTER SYSTEM privilege to modify the values of global system variables.

      • Oracle user tenants need to have the ALTER SYSTEM privilege to modify the values of global system variables.

    • Session level

      sys tenants and all user tenants can directly modify the values of session system variables.

Attributes

Attribute Description
Type String
Default value utf8mb4
Value range
  • utf8mb4
  • binary
  • gbk
Scope
  • Global
  • Session
Modifiable Yes. You can execute the SET statement to modify the value.
Nullable Yes

Examples

Set the character set to which the server should convert result sets or error messages before sending them to the client to utf8mb4.

  • Global level

    obclient> SET GLOBAL character_set_results ='utf8mb4';
    
  • Session level

    obclient> SET character_set_results ='utf8mb4';
    

Contact Us