The server maintains many system variables that indicate how it is configured. All of them have default values. They can be set at server startup using options on the command line or in option files. Most of them can be set at runtime using the SET
statement.
Beginning with MySQL 4.0.3, the MySQLd server maintains two kinds of variables. Global variables affect the overall operation of the server. Session variables affect its Operation for individual clIEnt connections.
When the server starts, it initializes all global variables to their default values. These defaults can be changed by options specifIEd in option files or on the command line. After the server starts, those global variables that are dynamic can be changed by connecting to the server and issuing a SET GLOBAL
statement. To change a global variable, you must have the var_name
SUPER
privilege.
The server also maintains a set of session variables for each client that connects. The client's session variables are initialized at connect time using the current values of the corresponding global variables. For those session variables that are dynamic, the clIEnt can change them by issuing a SET SESSION
statement. Setting a session variable requires no special privilege, but a client can change only its own session variables, not those of any other clIEnt. var_name
A change to a global variable is visible to any clIEnt that Accesses that global variable. However, it affects the corresponding session variable that is initialized from the global variable only for clients that connect after the change. It does not affect the session variable for any clIEnt that is currently