跳到主要内容

SET

Changes the value of a setting. To show all the current settings, use SHOW SETTINGS.

See also: UNSET

Syntax

SET [GLOBAL] <setting_name> = <new_value>;

GLOBAL: If you include this option preceding a session-level setting, the setting will become a cluster-level (global-level) setting.

备注

A cluster-level setting is a cluster setting and the value will be stored in the meta service.

Examples

The following example sets the max_threads setting to 4:

SET max_threads = 4;

The following example sets the max_threads setting to 4 and changes it to be a cluster-level setting:

SET GLOBAL max_threads = 4;