docs/en/sql-reference/sql-statements/cluster-management/config_vars/SET.md
Sets the specified system variables or user-defined variables for StarRocks. You can view the system variables of StarRocks 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.
:::
SET [ GLOBAL | SESSION ] <variable_name> = <value> [, <variable_name> = <value>] ...
| Parameter | Description |
|---|---|
| Modifier:<ul><li>GLOBAL</li><li>SESSION</li></ul> | <ul><li>With a GLOBAL modifier, the statement sets the variables globally.</li><li>With a SESSION modifier, the statement sets the variables within the session. LOCAL is a synonym for SESSION.</li><li>If no modifier is present, the default is SESSION.</li></ul>For details about global and session variables, see System Variables. |
| NOTE | |
| Only users with the ADMIN privilege can set the variables globally. | |
| variable_name | The name of the variable. |
| value | The value of the variable. |
Example 1: Set the time_zone to Asia/Shanghai within the session.
mysql> SET time_zone = "Asia/Shanghai";
Query OK, 0 rows affected (0.00 sec)
Example 2: Set the exec_mem_limit to 2147483648 globally.
mysql> SET GLOBAL exec_mem_limit = 2147483648;
Query OK, 0 rows affected (0.00 sec)
Example 3: Set multiple global variables. Add the GLOBAL keyword before each variable.
mysql> SET
GLOBAL exec_mem_limit = 2147483648,
GLOBAL time_zone = "Asia/Shanghai";
Query OK, 0 rows affected (0.00 sec)