Using System Variables There are two scopes in which system variables exist. Global variables affect the overall operation of the server. Session variables affect its operation for individual client connections. A given system variable can have both a global and a session value. Global and session system variables are related as follows: •When the server starts, it initializes each global variable to its default value. These defaults can be changed by options specified on the command line or in an option file. (See Section 4.2.2, “Specifying Program Options” .) •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 example, a client’s SQL mode is controlled by the session  sql_mode  value, which is initialized when the client connects to the value of the global  sql_mode  value. For some system variables, the session value is not initialized from the corresponding global value; if so, that is indicated in the variable description. System variable values can be set globally at server startup by using options on the command line or in an option file. At startup, the syntax for system variables is the same as for command options, so within variable names, dashes and underscores may be used interchangeably. For example,  -- general_log=ON  and  --general-log=ON  are equivalent. When you use a startup option to set a variable that takes a numeric value, the value can be given with a suffix of  K ,  M , or  G  (either uppercase or lowercase) to indicate a multiplier of 1024, 1024$^{2}$ or 1024$^{3}$; that is, units of kilobytes, megabytes, or gigabytes, respectively. As of MySQL 8.0.14, a suffix can also be  T ,  P , and  E  to indicate a multiplier of 1024$^{4}$, 1024$^{5}$ or 1024$^{6}$. Thus, the following command starts the server with an  InnoDB  log file size of 16 megabytes and a maximum packet size of one gigabyte: The lettercase of suffix letters does not matter;  16M  and  16m  are equivalent, as are  1G  and  1g . Within an option file, those variables are set like this: mysqld --innodb-log-file-size=16M --max-allowed-packet=1G [mysqld] innodb_log_file_size=16M max_allowed_packet=1G To restrict the maximum value to which a system variable can be set at runtime with the  SET  statement, specify this maximum by using an option of the form  --maximum- var_name = value  at server startup. For example, to prevent the value of  innodb_log_file_size  from being increased to more than 32MB at runtime, use the option  --maximum-innodb-log-file-size=32M . Many system variables are dynamic and can be changed at runtime by using the  SET  statement. For a list, see Section 5.1.9.2, “Dynamic System Variables” . To change a system variable with  SET , refer to it by name, optionally preceded by a modifier. At runtime, system variable names must be written using underscores, not dashes. The following examples briefly illustrate this syntax: •Set a global system variable: •Persist a global system variable to the  mysqld-auto.cnf  file (and set the runtime value): •Persist a global system variable to the  mysqld-auto.cnf  file (without setting the runtime value): 917 SET PERSIST max_connections = 1000; SET @@PERSIST.max_connections = 1000; SET GLOBAL max_connections = 1000; SET @@GLOBAL.max_connections = 1000;