SET and SET SESSION

Sets a session variable. The variable’s value is effective for the user’s current connection to the node, until the node is restarted.

Syntax

SET [SESSION] variable_name = value

SET [SESSION] @@variable_name = value

Remarks

  • variable_name is the name of the session variable.
  • The SESSION keyword is optional. Including it does not change this command’s behavior.
  • The @@variable_name syntax for is supported for compatibility with some other database systems. This is similar to MySQL behavior.
  • See the engine variables overview for information about other ways to set variables.

Example

The following example sets the session variable net_read_timeout and retrieves its value.

SET net_read_timeout = 5000;

Retrieve the session variable’s value:

SELECT @@net_read_timeout;

Related Topics

Was this article useful?