A system variable can have a global value that affects server
operation as a whole, a session value that affects only the
current session, or both. To modify system variable runtime
values, use the
SET
statement. See Section 13.7.4.1, “SET Syntax for Variable Assignment”. This section
describes the privileges required to assign values to system
variables at runtime.
Setting a global system variable runtime value requires the
SUPER
privilege.
To set a session system variable runtime value, use the
SET
SESSION
statement. In contrast to setting global
runtime values, setting session runtime values normally requires
no special privileges and can be done by any user to affect the
current session. For some system variables, setting the session
value may have effects outside the current session and thus is a
restricted operation that can be done only by users who have the
SUPER
privilege. If a session
system variable is restricted in this way, the variable
description indicates that restriction. Examples include
binlog_format
and
sql_log_bin
. Setting the
session value of these variables affects binary logging for the
current session, but may also have wider implications for the
integrity of server replication and backups.