<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="using-system-variables">
      </a>
      7.1.9 Using System Variables
     </h3>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="system-variable-privileges.html">
       7.1.9.1 System Variable Privileges
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="dynamic-system-variables.html">
       7.1.9.2 Dynamic System Variables
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="persisted-system-variables.html">
       7.1.9.3 Persisted System Variables
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="nonpersistible-system-variables.html">
       7.1.9.4 Nonpersistible and Persist-Restricted System Variables
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="structured-system-variables.html">
       7.1.9.5 Structured System Variables
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <a class="indexterm" name="idm46045266750032">
  </a>
  <a class="indexterm" name="idm46045266748960">
  </a>
  <a class="indexterm" name="idm46045266747472">
  </a>
  <a class="indexterm" name="idm46045266746384">
  </a>
  <p>
   The MySQL server maintains many system variables that configure
      its operation.
   <a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
    Section 7.1.8, “Server System Variables”
   </a>
   ,
      describes the meaning of these variables. Each system variable has
      a default value. System variables can be set at server startup
      using options on the command line or in an option file. Most of
      them can be changed dynamically while the server is running by
      means of the
   <a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
    <code class="literal">
     SET
    </code>
   </a>
   statement, which enables you to modify operation of the server
      without having to stop and restart it. You can also use system
      variable values in expressions.
  </p>
  <p>
   Many system variables are built in. System variables may also be
      installed by server plugins or components:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      System variables implemented by a server plugin are exposed
          when the plugin is installed and have names that begin with
          the plugin name. For example, the
      <code class="literal">
       audit_log
      </code>
      plugin implements a system variable named
      <a class="link" href="audit-log-reference.html#sysvar_audit_log_policy">
       <code class="literal">
        audit_log_policy
       </code>
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      System variables implemented by a component are exposed when
          the component is installed and have names that begin with a
          component-specific prefix. For example, the
      <code class="literal">
       log_filter_dragnet
      </code>
      error log filter
          component implements a system variable named
      <code class="literal">
       log_error_filter_rules
      </code>
      , the full name of
          which is
      <a class="link" href="server-system-variables.html#sysvar_dragnet.log_error_filter_rules">
       <code class="literal">
        dragnet.log_error_filter_rules
       </code>
      </a>
      .
          To refer to this variable, use the full name.
     </p>
    </li>
   </ul>
  </div>
  <p>
   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:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      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
      <a class="xref" href="program-options.html" title="6.2.2 Specifying Program Options">
       Section 6.2.2, “Specifying Program Options”
      </a>
      .)
     </p>
    </li>
    <li class="listitem">
     <p>
      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
      <a class="link" href="server-system-variables.html#sysvar_sql_mode">
       <code class="literal">
        sql_mode
       </code>
      </a>
      value, which is
          initialized when the client connects to the value of the
          global
      <a class="link" href="server-system-variables.html#sysvar_sql_mode">
       <code class="literal">
        sql_mode
       </code>
      </a>
      value.
     </p>
     <p>
      For some system variables, the session value is not
          initialized from the corresponding global value; if so, that
          is indicated in the variable description.
     </p>
    </li>
   </ul>
  </div>
  <p>
   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,
   <a class="link" href="server-system-variables.html#sysvar_general_log">
    <code class="option">
     --general_log=ON
    </code>
   </a>
   and
   <a class="link" href="server-system-variables.html#sysvar_general_log">
    <code class="option">
     --general-log=ON
    </code>
   </a>
   are equivalent.
  </p>
  <p>
   When you use a startup option to set a variable that takes a
      numeric value, the value can be given with a suffix of
   <code class="literal">
    K
   </code>
   ,
   <code class="literal">
    M
   </code>
   ,
   <code class="literal">
    G
   </code>
   ,
   <code class="literal">
    T
   </code>
   ,
   <code class="literal">
    P
   </code>
   , or
   <code class="literal">
    E
   </code>
   (either uppercase or lowercase) to indicate a
      multiplier of 1024, 1024
   <sup>
    2
   </sup>
   ,
      1024
   <sup>
    3
   </sup>
   ,
      1024
   <sup>
    4
   </sup>
   ,
      1024
   <sup>
    5
   </sup>
   , or
      1024
   <sup>
    6
   </sup>
   ; that is, units of kilobytes,
      megabytes, gigabytes, terabytes, petabytes, or ettabytes,
      respectively. Thus, the following command starts the server with a
      sort buffer size of 256 kilobytes and a maximum packet size of one
      gigabyte:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa53975136"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">mysqld <span class="token constant">--sort-buffer-size</span><span class="token attr-value"><span class="token punctuation">=</span>256K</span> <span class="token constant">--max-allowed-packet</span><span class="token attr-value"><span class="token punctuation">=</span>1G</span></code></pre>
  </div>
  <p>
   Within an option file, those variables are set like this:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa99276664"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><span class="token selector">[mysqld]</span>
<span class="token constant">sort_buffer_size</span><span class="token attr-value"><span class="token punctuation">=</span>256K</span>
<span class="token constant">max_allowed_packet</span><span class="token attr-value"><span class="token punctuation">=</span>1G</span></code></pre>
  </div>
  <p>
   The lettercase of suffix letters does not matter;
   <code class="literal">
    256K
   </code>
   and
   <code class="literal">
    256k
   </code>
   are
      equivalent, as are
   <code class="literal">
    1G
   </code>
   and
   <code class="literal">
    1g
   </code>
   .
  </p>
  <p>
   To restrict the maximum value to which a system variable can be
      set at runtime with the
   <a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
    <code class="literal">
     SET
    </code>
   </a>
   statement, specify this maximum by using an option of the form
   <code class="option">
    --maximum-
    <em class="replaceable">
     <code>
      var_name
     </code>
    </em>
    =
    <em class="replaceable">
     <code>
      value
     </code>
    </em>
   </code>
   at server startup. For example, to prevent the value of
   <a class="link" href="server-system-variables.html#sysvar_sort_buffer_size">
    <code class="literal">
     sort_buffer_size
    </code>
   </a>
   from being
      increased to more than 32MB at runtime, use the option
   <code class="option">
    --maximum-sort-buffer-size=32M
   </code>
   .
  </p>
  <p>
   Many system variables are dynamic and can be changed at runtime by
      using the
   <a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
    <code class="literal">
     SET
    </code>
   </a>
   statement. For a list, see
   <a class="xref" href="dynamic-system-variables.html" title="7.1.9.2 Dynamic System Variables">
    Section 7.1.9.2, “Dynamic System Variables”
   </a>
   . To change a system
      variable with
   <a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
    <code class="literal">
     SET
    </code>
   </a>
   , 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:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Set a global system variable:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa46675623"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SET</span> <span class="token keyword">GLOBAL</span> max_connections <span class="token operator">=</span> <span class="token number">1000</span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token variable">@@GLOBAL.max_connections</span> <span class="token operator">=</span> <span class="token number">1000</span><span class="token punctuation">;</span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      Persist a global system variable to the
      <code class="filename">
       mysqld-auto.cnf
      </code>
      file (and set the runtime
          value):
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa13440677"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SET</span> <span class="token keyword">PERSIST</span> max_connections <span class="token operator">=</span> <span class="token number">1000</span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token variable">@@PERSIST.max_connections</span> <span class="token operator">=</span> <span class="token number">1000</span><span class="token punctuation">;</span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      Persist a global system variable to the
      <code class="filename">
       mysqld-auto.cnf
      </code>
      file (without setting the
          runtime value):
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa78930457"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SET</span> <span class="token keyword">PERSIST_ONLY</span> back_log <span class="token operator">=</span> <span class="token number">1000</span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token variable">@@PERSIST_ONLY.back_log</span> <span class="token operator">=</span> <span class="token number">1000</span><span class="token punctuation">;</span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      Set a session system variable:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa52167445"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SET</span> <span class="token keyword">SESSION</span> sql_mode <span class="token operator">=</span> <span class="token string">'TRADITIONAL'</span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token variable">@@SESSION.sql_mode</span> <span class="token operator">=</span> <span class="token string">'TRADITIONAL'</span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token variable">@@sql_mode</span> <span class="token operator">=</span> <span class="token string">'TRADITIONAL'</span><span class="token punctuation">;</span></code></pre>
     </div>
    </li>
   </ul>
  </div>
  <p>
   For complete details about
   <a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
    <code class="literal">
     SET
    </code>
   </a>
   syntax, see
   <a class="xref" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
    Section 15.7.6.1, “SET Syntax for Variable Assignment”
   </a>
   . For a description of
      the privilege requirements for setting and persisting system
      variables, see
   <a class="xref" href="system-variable-privileges.html" title="7.1.9.1 System Variable Privileges">
    Section 7.1.9.1, “System Variable Privileges”
   </a>
  </p>
  <p>
   Suffixes for specifying a value multiplier can be used when
      setting a variable at server startup, but not to set the value
      with
   <a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
    <code class="literal">
     SET
    </code>
   </a>
   at runtime. On the other hand, with
   <a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
    <code class="literal">
     SET
    </code>
   </a>
   you
      can assign a variable's value using an expression, which is not
      true when you set a variable at server startup. For example, the
      first of the following lines is legal at server startup, but the
      second is not:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa52891527"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">mysql</span> <span class="token constant">--max_allowed_packet</span><span class="token attr-value"><span class="token punctuation">=</span>16M</span>
<span class="token prompt">$&gt; </span><span class="token command">mysql</span> <span class="token constant">--max_allowed_packet</span><span class="token attr-value"><span class="token punctuation">=</span>16*1024*1024</span></code></pre>
  </div>
  <p>
   Conversely, the second of the following lines is legal at runtime,
      but the first is not:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa59191544"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">mysql&gt;</span><span class="token command"> SET</span> GLOBAL max_allowed_packet<span class="token attr-value"><span class="token punctuation">=</span>16M;</span>
<span class="token prompt">mysql&gt;</span><span class="token command"> SET</span> GLOBAL max_allowed_packet<span class="token attr-value"><span class="token punctuation">=</span>16*1024*1024;</span></code></pre>
  </div>
  <p>
   To display system variable names and values, use the
   <a class="link" href="show-variables.html" title="15.7.7.41 SHOW VARIABLES Statement">
    <code class="literal">
     SHOW VARIABLES
    </code>
   </a>
   statement:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa65692601"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">VARIABLES</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Variable_name                                         <span class="token punctuation">|</span> Value                <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> activate_all_roles_on_login                           <span class="token punctuation">|</span> OFF                  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> admin_address                                         <span class="token punctuation">|</span>                      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> admin_port                                            <span class="token punctuation">|</span> 33062                <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> admin_ssl_ca                                          <span class="token punctuation">|</span>                      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> admin_ssl_capath                                      <span class="token punctuation">|</span>                      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> admin_ssl_cert                                        <span class="token punctuation">|</span>                      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> admin_ssl_cipher                                      <span class="token punctuation">|</span>                      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> admin_ssl_crl                                         <span class="token punctuation">|</span>                      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> admin_ssl_crlpath                                     <span class="token punctuation">|</span>                      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> admin_ssl_key                                         <span class="token punctuation">|</span>                      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> admin_tls_ciphersuites                                <span class="token punctuation">|</span>                      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> admin_tls_version                                     <span class="token punctuation">|</span> TLSv1.2,TLSv1.3      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> authentication_policy                                 <span class="token punctuation">|</span> *,,                  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> auto_generate_certs                                   <span class="token punctuation">|</span> ON                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> auto_increment_increment                              <span class="token punctuation">|</span> 1                    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> auto_increment_offset                                 <span class="token punctuation">|</span> 1                    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> autocommit                                            <span class="token punctuation">|</span> ON                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> automatic_sp_privileges                               <span class="token punctuation">|</span> ON                   <span class="token punctuation">|</span></span>

<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>

<span class="token output"><span class="token punctuation">|</span> version                                               <span class="token punctuation">|</span> 8.4.0                <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> version_comment                                       <span class="token punctuation">|</span> Source distribution  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> version_compile_machine                               <span class="token punctuation">|</span> x86_64               <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> version_compile_os                                    <span class="token punctuation">|</span> Linux                <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> version_compile_zlib                                  <span class="token punctuation">|</span> 1.2.13               <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> wait_timeout                                          <span class="token punctuation">|</span> 28800                <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> warning_count                                         <span class="token punctuation">|</span> 0                    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> windowing_use_high_precision                          <span class="token punctuation">|</span> ON                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> xa_detach_on_prepare                                  <span class="token punctuation">|</span> ON                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
  </div>
  <p>
   With a
   <a class="link" href="string-comparison-functions.html#operator_like">
    <code class="literal">
     LIKE
    </code>
   </a>
   clause, the statement
      displays only those variables that match the pattern. To obtain a
      specific variable name, use a
   <a class="link" href="string-comparison-functions.html#operator_like">
    <code class="literal">
     LIKE
    </code>
   </a>
   clause as shown:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa99686477"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SHOW</span> <span class="token keyword">VARIABLES</span> <span class="token operator">LIKE</span> <span class="token string">'max_join_size'</span><span class="token punctuation">;</span>
<span class="token keyword">SHOW</span> <span class="token keyword">SESSION</span> <span class="token keyword">VARIABLES</span> <span class="token operator">LIKE</span> <span class="token string">'max_join_size'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   To get a list of variables whose name match a pattern, use the
   <code class="literal">
    %
   </code>
   wildcard character in a
   <a class="link" href="string-comparison-functions.html#operator_like">
    <code class="literal">
     LIKE
    </code>
   </a>
   clause:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa31536938"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SHOW</span> <span class="token keyword">VARIABLES</span> <span class="token operator">LIKE</span> <span class="token string">'%size%'</span><span class="token punctuation">;</span>
<span class="token keyword">SHOW</span> <span class="token keyword">GLOBAL</span> <span class="token keyword">VARIABLES</span> <span class="token operator">LIKE</span> <span class="token string">'%size%'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   Wildcard characters can be used in any position within the pattern
      to be matched. Strictly speaking, because
   <code class="literal">
    _
   </code>
   is
      a wildcard that matches any single character, you should escape it
      as
   <code class="literal">
    \_
   </code>
   to match it literally. In practice, this
      is rarely necessary.
  </p>
  <p>
   For
   <a class="link" href="show-variables.html" title="15.7.7.41 SHOW VARIABLES Statement">
    <code class="literal">
     SHOW VARIABLES
    </code>
   </a>
   , if you specify
      neither
   <code class="literal">
    GLOBAL
   </code>
   nor
   <code class="literal">
    SESSION
   </code>
   ,
      MySQL returns
   <code class="literal">
    SESSION
   </code>
   values.
  </p>
  <p>
   The reason for requiring the
   <code class="literal">
    GLOBAL
   </code>
   keyword
      when setting
   <code class="literal">
    GLOBAL
   </code>
   -only variables but not when
      retrieving them is to prevent problems in the future:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Were a
      <code class="literal">
       SESSION
      </code>
      variable to be removed that
          has the same name as a
      <code class="literal">
       GLOBAL
      </code>
      variable, a
          client with privileges sufficient to modify global variables
          might accidentally change the
      <code class="literal">
       GLOBAL
      </code>
      variable rather than just the
      <code class="literal">
       SESSION
      </code>
      variable for its own session.
     </p>
    </li>
    <li class="listitem">
     <p>
      Were a
      <code class="literal">
       SESSION
      </code>
      variable to be added with
          the same name as a
      <code class="literal">
       GLOBAL
      </code>
      variable, a
          client that intends to change the
      <code class="literal">
       GLOBAL
      </code>
      variable might find only its own
      <code class="literal">
       SESSION
      </code>
      variable changed.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
