PDF (US Ltr)
- 1.1Mb
PDF (A4)
- 1.1Mb
If you change a session variable, the value remains in effect within your session until you change the variable to a different value or the session ends. The change has no effect on other sessions.
To assign a value to a session variable, precede the variable
name by the SESSION
or
LOCAL
keyword, by the
@@SESSION.
, @@LOCAL.
, or
@@
qualifier, or by no keyword or no modifier
at all; for example:
mysql> SET SESSION sql_mode = 'TRADITIONAL';
mysql> SET LOCAL sql_mode = 'TRADITIONAL';
mysql> SET @@SESSION.sql_mode = 'TRADITIONAL';
mysql> SET @@LOCAL.sql_mode = 'TRADITIONAL';
mysql> SET @@sql_mode = 'TRADITIONAL';
mysql> SET sql_mode = 'TRADITIONAL';
Note
For new connections, a session variable value is initialized with the corresponding global system variable value.
Table 11.1 User-Settable Session Variables