Skip to main content
Sets the specified system variables or user-defined variables for the database. You can view the system variables of the database using SHOW VARIABLES. For details about system variables, see System Variables. For details about user-defined variables, see User-defined variables. Tip This operation does not require privileges.

Syntax

Parameters

Examples

Example 1: Set the time_zone to Asia/Shanghai within the session.
Example 2: Set the query_mem_limit to 2147483648 globally.
Example 3: Set multiple global variables. Add the GLOBAL keyword before each variable.