url
stringlengths 45
122
| content
stringlengths 380
3.07M
|
---|---|
https://dev.mysql.com/doc/refman/8.4/en/user-resources.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="user-resources">
</a>
8.2.21 Setting Account Resource Limits
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045247567584">
</a>
<a class="indexterm" name="idm46045247566128">
</a>
<a class="indexterm" name="idm46045247564640">
</a>
<a class="indexterm" name="idm46045247563568">
</a>
<a class="indexterm" name="idm46045247562496">
</a>
<a class="indexterm" name="idm46045247561408">
</a>
<p>
One means of restricting client use of MySQL server resources is
to set the global
<a class="link" href="server-system-variables.html#sysvar_max_user_connections">
<code class="literal">
max_user_connections
</code>
</a>
system
variable to a nonzero value. This limits the number of
simultaneous connections that can be made by any given account,
but places no limits on what a client can do once connected. In
addition, setting
<a class="link" href="server-system-variables.html#sysvar_max_user_connections">
<code class="literal">
max_user_connections
</code>
</a>
does not
enable management of individual accounts. Both types of control
are of interest to MySQL administrators.
</p>
<p>
To address such concerns, MySQL permits limits for individual
accounts on use of these server resources:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The number of queries an account can issue per hour
</p>
</li>
<li class="listitem">
<p>
The number of updates an account can issue per hour
</p>
</li>
<li class="listitem">
<p>
The number of times an account can connect to the server per
hour
</p>
</li>
<li class="listitem">
<p>
The number of simultaneous connections to the server by an
account
</p>
</li>
</ul>
</div>
<p>
Any statement that a client can issue counts against the query
limit. Only statements that modify databases or tables count
against the update limit.
</p>
<p>
An
<span class="quote">
“
<span class="quote">
account
</span>
”
</span>
in this context corresponds to a row in
the
<code class="literal">
mysql.user
</code>
system table. That is, a
connection is assessed against the
<code class="literal">
User
</code>
and
<code class="literal">
Host
</code>
values in the
<code class="literal">
user
</code>
table row that applies to the connection. For example, an account
<code class="literal">
'usera'@'%.example.com'
</code>
corresponds to a row in
the
<code class="literal">
user
</code>
table that has
<code class="literal">
User
</code>
and
<code class="literal">
Host
</code>
values of
<code class="literal">
usera
</code>
and
<code class="literal">
%.example.com
</code>
, to permit
<code class="literal">
usera
</code>
to connect from any host in the
<code class="literal">
example.com
</code>
domain. In this case, the server
applies resource limits in this row collectively to all
connections by
<code class="literal">
usera
</code>
from any host in the
<code class="literal">
example.com
</code>
domain because all such connections
use the same account.
</p>
<p>
To establish resource limits for an account at account-creation
time, use the
<a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
<code class="literal">
CREATE USER
</code>
</a>
statement. To modify the limits for an existing account, use
<a class="link" href="alter-user.html" title="15.7.1.1 ALTER USER Statement">
<code class="literal">
ALTER USER
</code>
</a>
. Provide a
<code class="literal">
WITH
</code>
clause that names each resource to be
limited. The default value for each limit is zero (no limit). For
example, to create a new account that can access the
<code class="literal">
customer
</code>
database, but only in a limited
fashion, issue these statements:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa13477606"><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></span> <span class="token keyword">CREATE</span> <span class="token keyword">USER</span> <span class="token string">'francis'</span>@<span class="token string">'localhost'</span> <span class="token keyword">IDENTIFIED</span> <span class="token keyword">BY</span> <span class="token string">'frank'</span>
<span class="token prompt"> -></span> <span class="token keyword">WITH</span> <span class="token keyword">MAX_QUERIES_PER_HOUR</span> <span class="token number">20</span>
<span class="token prompt"> -></span> <span class="token keyword">MAX_UPDATES_PER_HOUR</span> <span class="token number">10</span>
<span class="token prompt"> -></span> <span class="token keyword">MAX_CONNECTIONS_PER_HOUR</span> <span class="token number">5</span>
<span class="token prompt"> -></span> <span class="token keyword">MAX_USER_CONNECTIONS</span> <span class="token number">2</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The limit types need not all be named in the
<code class="literal">
WITH
</code>
clause, but those named can be present in
any order. The value for each per-hour limit should be an integer
representing a count per hour. For
<code class="literal">
MAX_USER_CONNECTIONS
</code>
, the limit is an integer
representing the maximum number of simultaneous connections by the
account. If this limit is set to zero, the global
<a class="link" href="server-system-variables.html#sysvar_max_user_connections">
<code class="literal">
max_user_connections
</code>
</a>
system
variable value determines the number of simultaneous connections.
If
<a class="link" href="server-system-variables.html#sysvar_max_user_connections">
<code class="literal">
max_user_connections
</code>
</a>
is also
zero, there is no limit for the account.
</p>
<p>
To modify limits for an existing account, use an
<a class="link" href="alter-user.html" title="15.7.1.1 ALTER USER Statement">
<code class="literal">
ALTER USER
</code>
</a>
statement. The following
statement changes the query limit for
<code class="literal">
francis
</code>
to 100:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa33754116"><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></span> <span class="token keyword">ALTER</span> <span class="token keyword">USER</span> <span class="token string">'francis'</span>@<span class="token string">'localhost'</span> <span class="token keyword">WITH</span> <span class="token keyword">MAX_QUERIES_PER_HOUR</span> <span class="token number">100</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The statement modifies only the limit value specified and leaves
the account otherwise unchanged.
</p>
<p>
To remove a limit, set its value to zero. For example, to remove
the limit on how many times per hour
<code class="literal">
francis
</code>
can connect, use this statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa75778326"><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></span> <span class="token keyword">ALTER</span> <span class="token keyword">USER</span> <span class="token string">'francis'</span>@<span class="token string">'localhost'</span> <span class="token keyword">WITH</span> <span class="token keyword">MAX_CONNECTIONS_PER_HOUR</span> <span class="token number">0</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
As mentioned previously, the simultaneous-connection limit for an
account is determined from the
<code class="literal">
MAX_USER_CONNECTIONS
</code>
limit and the
<a class="link" href="server-system-variables.html#sysvar_max_user_connections">
<code class="literal">
max_user_connections
</code>
</a>
system
variable. Suppose that the global
<a class="link" href="server-system-variables.html#sysvar_max_user_connections">
<code class="literal">
max_user_connections
</code>
</a>
value is 10
and three accounts have individual resource limits specified as
follows:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa28048466"><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">ALTER</span> <span class="token keyword">USER</span> <span class="token string">'user1'</span>@<span class="token string">'localhost'</span> <span class="token keyword">WITH</span> <span class="token keyword">MAX_USER_CONNECTIONS</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token keyword">ALTER</span> <span class="token keyword">USER</span> <span class="token string">'user2'</span>@<span class="token string">'localhost'</span> <span class="token keyword">WITH</span> <span class="token keyword">MAX_USER_CONNECTIONS</span> <span class="token number">5</span><span class="token punctuation">;</span>
<span class="token keyword">ALTER</span> <span class="token keyword">USER</span> <span class="token string">'user3'</span>@<span class="token string">'localhost'</span> <span class="token keyword">WITH</span> <span class="token keyword">MAX_USER_CONNECTIONS</span> <span class="token number">20</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
<code class="literal">
user1
</code>
has a connection limit of 10 (the global
<a class="link" href="server-system-variables.html#sysvar_max_user_connections">
<code class="literal">
max_user_connections
</code>
</a>
value)
because it has a
<code class="literal">
MAX_USER_CONNECTIONS
</code>
limit of
zero.
<code class="literal">
user2
</code>
and
<code class="literal">
user3
</code>
have
connection limits of 5 and 20, respectively, because they have
nonzero
<code class="literal">
MAX_USER_CONNECTIONS
</code>
limits.
</p>
<p>
The server stores resource limits for an account in the
<code class="literal">
user
</code>
table row corresponding to the account.
The
<code class="literal">
max_questions
</code>
,
<code class="literal">
max_updates
</code>
, and
<code class="literal">
max_connections
</code>
columns store the per-hour
limits, and the
<code class="literal">
max_user_connections
</code>
column
stores the
<code class="literal">
MAX_USER_CONNECTIONS
</code>
limit. (See
<a class="xref" href="grant-tables.html" title="8.2.3 Grant Tables">
Section 8.2.3, “Grant Tables”
</a>
.)
</p>
<p>
Resource-use counting takes place when any account has a nonzero
limit placed on its use of any of the resources.
</p>
<p>
As the server runs, it counts the number of times each account
uses resources. If an account reaches its limit on number of
connections within the last hour, the server rejects further
connections for the account until that hour is up. Similarly, if
the account reaches its limit on the number of queries or updates,
the server rejects further queries or updates until the hour is
up. In all such cases, the server issues appropriate error
messages.
</p>
<p>
Resource counting occurs per account, not per client. For example,
if your account has a query limit of 50, you cannot increase your
limit to 100 by making two simultaneous client connections to the
server. Queries issued on both connections are counted together.
</p>
<p>
The current per-hour resource-use counts can be reset globally for
all accounts, or individually for a given account:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
To reset the current counts to zero for all accounts, issue a
<a class="link" href="flush.html#flush-user-resources">
<code class="literal">
FLUSH USER_RESOURCES
</code>
</a>
statement.
The counts also can be reset by reloading the grant tables
(for example, with a
<a class="link" href="flush.html#flush-privileges">
<code class="literal">
FLUSH
PRIVILEGES
</code>
</a>
statement or a
<a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
<span class="command">
<strong>
mysqladmin
reload
</strong>
</span>
</a>
command).
</p>
</li>
<li class="listitem">
<p>
The counts for an individual account can be reset to zero by
setting any of its limits again. Specify a limit value equal
to the value currently assigned to the account.
</p>
</li>
</ul>
</div>
<p>
Per-hour counter resets do not affect the
<code class="literal">
MAX_USER_CONNECTIONS
</code>
limit.
</p>
<p>
All counts begin at zero when the server starts. Counts do not
carry over through server restarts.
</p>
<p>
For the
<code class="literal">
MAX_USER_CONNECTIONS
</code>
limit, an edge
case can occur if the account currently has open the maximum
number of connections permitted to it: A disconnect followed
quickly by a connect can result in an error
(
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_too_many_user_connections" target="_top">
<code class="literal">
ER_TOO_MANY_USER_CONNECTIONS
</code>
</a>
or
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_user_limit_reached" target="_top">
<code class="literal">
ER_USER_LIMIT_REACHED
</code>
</a>
) if the
server has not fully processed the disconnect by the time the
connect occurs. When the server finishes disconnect processing,
another connection is once more permitted.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/performance-schema-options.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="performance-schema-options">
</a>
29.14 Performance Schema Command Options
</h2>
</div>
</div>
</div>
<p>
Performance Schema parameters can be specified at server startup
on the command line or in option files to configure Performance
Schema instruments and consumers. Runtime configuration is also
possible in many cases (see
<a class="xref" href="performance-schema-runtime-configuration.html" title="29.4 Performance Schema Runtime Configuration">
Section 29.4, “Performance Schema Runtime Configuration”
</a>
), but
startup configuration must be used when runtime configuration is
too late to affect instruments that have already been initialized
during the startup process.
</p>
<p>
Performance Schema consumers and instruments can be configured at
startup using the following syntax. For additional details, see
<a class="xref" href="performance-schema-startup-configuration.html" title="29.3 Performance Schema Startup Configuration">
Section 29.3, “Performance Schema Startup Configuration”
</a>
.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-xxx">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-xxx">
<code class="option">
--performance-schema-consumer-
<em class="replaceable">
<code>
consumer_name
</code>
</em>
=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066283216">
</a>
<a class="indexterm" name="idm46045066281712">
</a>
<p>
Configure a Performance Schema consumer. Consumer names in the
<a class="link" href="performance-schema-setup-consumers-table.html" title="29.12.2.2 The setup_consumers Table">
<code class="literal">
setup_consumers
</code>
</a>
table use
underscores, but for consumers set at startup, dashes and
underscores within the name are equivalent. Options for
configuring individual consumers are detailed later in this
section.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-instrument">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-instrument">
<code class="option">
--performance-schema-instrument=
<em class="replaceable">
<code>
instrument_name
</code>
</em>
=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066275056">
</a>
<a class="indexterm" name="idm46045066273552">
</a>
<p>
Configure a Performance Schema instrument. The name may be
given as a pattern to configure instruments that match the
pattern.
</p>
</li>
</ul>
</div>
<p>
The following items configure individual consumers:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-stages-current">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-stages-current">
<code class="option">
--performance-schema-consumer-events-stages-current=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066267792">
</a>
<a class="indexterm" name="idm46045066266336">
</a>
<p>
Configure the
<code class="literal">
events-stages-current
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-stages-history">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-stages-history">
<code class="option">
--performance-schema-consumer-events-stages-history=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066260640">
</a>
<a class="indexterm" name="idm46045066259184">
</a>
<p>
Configure the
<code class="literal">
events-stages-history
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-stages-history-long">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-stages-history-long">
<code class="option">
--performance-schema-consumer-events-stages-history-long=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066253552">
</a>
<a class="indexterm" name="idm46045066252016">
</a>
<p>
Configure the
<code class="literal">
events-stages-history-long
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-statements-cpu">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-statements-cpu">
<code class="option">
--performance-schema-consumer-events-statements-cpu=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066246304">
</a>
<a class="indexterm" name="idm46045066244848">
</a>
<p>
Configure the
<code class="literal">
events-statements-cpu
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-statements-current">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-statements-current">
<code class="option">
--performance-schema-consumer-events-statements-current=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066239280">
</a>
<a class="indexterm" name="idm46045066237744">
</a>
<p>
Configure the
<code class="literal">
events-statements-current
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-statements-history">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-statements-history">
<code class="option">
--performance-schema-consumer-events-statements-history=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066232160">
</a>
<a class="indexterm" name="idm46045066230624">
</a>
<p>
Configure the
<code class="literal">
events-statements-history
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-statements-history-long">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-statements-history-long">
<code class="option">
--performance-schema-consumer-events-statements-history-long=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066224880">
</a>
<a class="indexterm" name="idm46045066223344">
</a>
<p>
Configure the
<code class="literal">
events-statements-history-long
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-transactions-current">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-transactions-current">
<code class="option">
--performance-schema-consumer-events-transactions-current=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066217776">
</a>
<a class="indexterm" name="idm46045066216240">
</a>
<p>
Configure the Performance Schema
<code class="literal">
events-transactions-current
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-transactions-history">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-transactions-history">
<code class="option">
--performance-schema-consumer-events-transactions-history=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066210592">
</a>
<a class="indexterm" name="idm46045066209056">
</a>
<p>
Configure the Performance Schema
<code class="literal">
events-transactions-history
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-transactions-history-long">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-transactions-history-long">
<code class="option">
--performance-schema-consumer-events-transactions-history-long=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066203408">
</a>
<a class="indexterm" name="idm46045066201872">
</a>
<p>
Configure the Performance Schema
<code class="literal">
events-transactions-history-long
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-waits-current">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-waits-current">
<code class="option">
--performance-schema-consumer-events-waits-current=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066196224">
</a>
<a class="indexterm" name="idm46045066194704">
</a>
<p>
Configure the
<code class="literal">
events-waits-current
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-waits-history">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-waits-history">
<code class="option">
--performance-schema-consumer-events-waits-history=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066189168">
</a>
<a class="indexterm" name="idm46045066187648">
</a>
<p>
Configure the
<code class="literal">
events-waits-history
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-events-waits-history-long">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-events-waits-history-long">
<code class="option">
--performance-schema-consumer-events-waits-history-long=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066182112">
</a>
<a class="indexterm" name="idm46045066180576">
</a>
<p>
Configure the
<code class="literal">
events-waits-history-long
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-global-instrumentation">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-global-instrumentation">
<code class="option">
--performance-schema-consumer-global-instrumentation=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066174928">
</a>
<a class="indexterm" name="idm46045066173472">
</a>
<p>
Configure the
<code class="literal">
global-instrumentation
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-statements-digest">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-statements-digest">
<code class="option">
--performance-schema-consumer-statements-digest=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066167840">
</a>
<a class="indexterm" name="idm46045066166320">
</a>
<p>
Configure the
<code class="literal">
statements-digest
</code>
consumer.
</p>
</li>
<li class="listitem">
<p>
<a name="option_mysqld_performance-schema-consumer-thread-instrumentation">
</a>
<a class="link" href="performance-schema-options.html#option_mysqld_performance-schema-consumer-thread-instrumentation">
<code class="option">
--performance-schema-consumer-thread-instrumentation=
<code class="literal">
value
</code>
</code>
</a>
</p>
<a class="indexterm" name="idm46045066160800">
</a>
<a class="indexterm" name="idm46045066159344">
</a>
<p>
Configure the
<code class="literal">
thread-instrumentation
</code>
consumer.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/macos-installation-launchd.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="macos-installation-launchd">
</a>
2.4.3 Installing and Using the MySQL Launch Daemon
</h3>
</div>
</div>
</div>
<p>
macOS uses launch daemons to automatically start, stop, and manage
processes and applications such as MySQL.
</p>
<p>
By default, the installation package (DMG) on macOS installs a
launchd file named
<code class="filename">
/Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
</code>
that contains a plist definition similar to:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa57676519"><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"><?xml version=<span class="token atrule">"1.0"</span> encoding=<span class="token atrule">"UTF-8"</span>?>
<!DOCTYPE plist PUBLIC <span class="token atrule">"-//Apple Computer//DTD PLIST 1.0//EN"</span> <span class="token atrule">"http://www.apple.com/DTDs/PropertyList-1.0.dtd"</span>>
<plist version=<span class="token atrule">"1.0"</span>>
<dict>
<key>Label</key> <string>com<span class="token punctuation">.</span>oracle<span class="token punctuation">.</span>oss<span class="token punctuation">.</span>mysql<span class="token punctuation">.</span>mysqld</string>
<key>ProcessType</key> <string>Interactive</string>
<key>Disabled</key> <false/>
<key>RunAtLoad</key> <true/>
<key>KeepAlive</key> <true/>
<key>SessionCreate</key> <true/>
<key>LaunchOnlyOnce</key> <false/>
<key>UserName</key> <string>_mysql</string>
<key>GroupName</key> <string>_mysql</string>
<key>ExitTimeOut</key> <integer>600</integer>
<key>Program</key> <string>/usr/local/mysql/bin/mysqld</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/mysql/bin/mysqld</string>
<string><span class="token constant">--user</span><span class="token attr-value"><span class="token punctuation">=</span>_mysql</string></span>
<string><span class="token constant">--basedir</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql</string></span>
<string><span class="token constant">--datadir</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/data</string></span>
<string><span class="token constant">--plugin-dir</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/lib/plugin</string></span>
<string><span class="token constant">--log-error</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/data/mysqld.local.err</string></span>
<string><span class="token constant">--pid-file</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/data/mysqld.local.pid</string></span>
<string><span class="token constant">--keyring-file-data</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/keyring/keyring</string></span>
<string><span class="token constant">--early-plugin-load</span><span class="token attr-value"><span class="token punctuation">=</span>keyring_okv=keyring_okv.so</string></span>
</array>
<key>WorkingDirectory</key> <string>/usr/local/mysql</string>
</dict>
</plist></code></pre>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Some users report that adding a plist DOCTYPE declaration causes
the launchd operation to fail, despite it passing the lint
check. We suspect it's a copy-n-paste error. The md5 checksum of
a file containing the above snippet is
<span class="emphasis">
<em>
d925f05f6d1b6ee5ce5451b596d6baed
</em>
</span>
.
</p>
</div>
<p>
To enable the launchd service, you can either:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Open macOS system preferences and select the MySQL preference
panel, and then execute
<span class="guibutton">
Start MySQL
Server
</span>
.
</p>
<div class="figure">
<a name="mac-installer-preference-pane-location-launchd">
</a>
<p class="title">
<b>
Figure 2.6 MySQL Preference Pane: Location
</b>
</p>
<div class="figure-contents">
<div class="mediaobject">
<img alt='Shows "MySQL" typed into the macOS System Preferences search box, and a highlighted "MySQL" icon in the bottom left portion of the MySQL Preference Pane.' src="images/mac-installer-preference-pane-location.png" style="width: 100%; max-width: 668px;"/>
</div>
</div>
</div>
<br class="figure-break"/>
<p>
The
<span class="guilabel">
Instances
</span>
page includes an option to
start or stop MySQL, and
<span class="guibutton">
Initialize
Database
</span>
recreates the
<code class="filename">
data/
</code>
directory.
<span class="guibutton">
Uninstall
</span>
uninstalls MySQL
Server and optionally the MySQL preference panel and launchd
information.
</p>
<div class="figure">
<a name="mac-installer-preference-pane-instances-launchd">
</a>
<p class="title">
<b>
Figure 2.7 MySQL Preference Pane: Instances
</b>
</p>
<div class="figure-contents">
<div class="mediaobject">
<img alt='The left side shows a list of MySQL instances separated by "Active Instance", "Installed Instances", and "Data Directories" sections. The right side shows a "Stop MySQL Server" button, a check box titled "Start MySQL when your computer starts up", and "Initialize Database" and "Uninstall" buttons.' src="images/mac-installer-preference-pane-instances.png" style="width: 100%; max-width: 780px;"/>
</div>
</div>
</div>
<br class="figure-break"/>
</li>
<li class="listitem">
<p>
Or, manually load the launchd file.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa93315048"><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">$> </span><span class="token command">cd</span> /Library/LaunchDaemons
<span class="token prompt">$> </span><span class="token command">sudo</span> launchctl load <span class="token property">-F</span> com<span class="token punctuation">.</span>oracle<span class="token punctuation">.</span>oss<span class="token punctuation">.</span>mysql<span class="token punctuation">.</span>mysqld<span class="token punctuation">.</span>plist</code></pre>
</div>
</li>
<li class="listitem">
<p>
To configure MySQL to automatically start at bootup, you can:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa79745492"><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">$> </span><span class="token command">sudo</span> launchctl load <span class="token property">-w</span> com<span class="token punctuation">.</span>oracle<span class="token punctuation">.</span>oss<span class="token punctuation">.</span>mysql<span class="token punctuation">.</span>mysqld<span class="token punctuation">.</span>plist</code></pre>
</div>
</li>
</ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
The upgrade process replaces your existing launchd file named
<code class="filename">
com.oracle.oss.mysql.mysqld.plist
</code>
.
</p>
</div>
<p>
Additional launchd related information:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The plist entries override
<code class="filename">
my.cnf
</code>
entries, because they are passed in as command line arguments.
For additional information about passing in program options,
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
<span class="bold">
<strong>
ProgramArguments
</strong>
</span>
section
defines the command line options that are passed into the
program, which is the
<code class="filename">
mysqld
</code>
binary in
this case.
</p>
</li>
<li class="listitem">
<p>
The default plist definition is written with less
sophisticated use cases in mind. For more complicated setups,
you may want to remove some of the arguments and instead rely
on a MySQL configuration file, such as
<code class="filename">
my.cnf
</code>
.
</p>
</li>
<li class="listitem">
<p>
If you edit the plist file, then uncheck the installer option
when reinstalling or upgrading MySQL. Otherwise, your edited
plist file is overwritten, and all edits are lost.
</p>
</li>
</ul>
</div>
<p>
Because the default plist definition defines several
<span class="bold">
<strong>
ProgramArguments
</strong>
</span>
, you might
remove most of these arguments and instead rely upon your
<code class="filename">
my.cnf
</code>
MySQL configuration file to define
them. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa44509856"><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"><?xml version=<span class="token atrule">"1.0"</span> encoding=<span class="token atrule">"UTF-8"</span>?>
<!DOCTYPE plist PUBLIC <span class="token atrule">"-//Apple Computer//DTD PLIST 1.0//EN"</span> <span class="token atrule">"http://www.apple.com/DTDs/PropertyList-1.0.dtd"</span>>
<plist version=<span class="token atrule">"1.0"</span>>
<dict>
<key>Label</key> <string>com<span class="token punctuation">.</span>oracle<span class="token punctuation">.</span>oss<span class="token punctuation">.</span>mysql<span class="token punctuation">.</span>mysqld</string>
<key>ProcessType</key> <string>Interactive</string>
<key>Disabled</key> <false/>
<key>RunAtLoad</key> <true/>
<key>KeepAlive</key> <true/>
<key>SessionCreate</key> <true/>
<key>LaunchOnlyOnce</key> <false/>
<key>UserName</key> <string>_mysql</string>
<key>GroupName</key> <string>_mysql</string>
<key>ExitTimeOut</key> <integer>600</integer>
<key>Program</key> <string>/usr/local/mysql/bin/mysqld</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/mysql/bin/mysqld</string>
<string><span class="token constant">--user</span><span class="token attr-value"><span class="token punctuation">=</span>_mysql</string></span>
<string><span class="token constant">--basedir</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql</string></span>
<string><span class="token constant">--datadir</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/data</string></span>
<string><span class="token constant">--plugin-dir</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/lib/plugin</string></span>
<string><span class="token constant">--log-error</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/data/mysqld.local.err</string></span>
<string><span class="token constant">--pid-file</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/data/mysqld.local.pid</string></span>
<string><span class="token constant">--keyring-file-data</span><span class="token attr-value"><span class="token punctuation">=</span>/usr/local/mysql/keyring/keyring</string></span>
<string><span class="token constant">--early-plugin-load</span><span class="token attr-value"><span class="token punctuation">=</span>keyring_okv=keyring_okv.so</string></span>
</array>
<key>WorkingDirectory</key> <string>/usr/local/mysql</string>
</dict>
</plist></code></pre>
</div>
<p>
In this case, the
<a class="link" href="server-system-variables.html#sysvar_basedir">
<code class="literal">
basedir
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_datadir">
<code class="literal">
datadir
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_plugin_dir">
<code class="literal">
plugin_dir
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_log_error">
<code class="literal">
log_error
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_pid_file">
<code class="literal">
pid_file
</code>
</a>
, and
<a class="link" href="server-options.html#option_mysqld_early-plugin-load">
<code class="option">
--early-plugin-load
</code>
</a>
options were
removed from the default plist
<span class="emphasis">
<em>
ProgramArguments
</em>
</span>
definition, which you might
have defined in
<code class="filename">
my.cnf
</code>
instead.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/glossary.html | <div id="docs-body">
<div class="glossary">
<div class="titlepage">
<div>
<div>
<h1 class="title">
<a name="glossary">
</a>
MySQL Glossary
</h1>
</div>
</div>
</div>
<p>
These terms are commonly used in information about the MySQL
database server.
</p>
<div class="glossdiv">
<h3 class="title">
A
</h3>
<dl>
<dt>
<a name="glos_arm_file">
</a>
<span class="glossterm">
.ARM file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033925152">
</a>
Metadata for
<code class="literal">
ARCHIVE
</code>
tables. Contrast with
<span class="bold">
<strong>
.ARZ file
</strong>
</span>
. Files with this
extension are always included in backups produced by the
<code class="literal">
mysqlbackup
</code>
command of the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_arz_file">
.ARZ file
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqlbackup_command">
mysqlbackup command
</a>
.
</p>
</dd>
<dt>
<a name="glos_arz_file">
</a>
<span class="glossterm">
.ARZ file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033917984">
</a>
Data for ARCHIVE tables. Contrast with
<span class="bold">
<strong>
.ARM file
</strong>
</span>
. Files with this
extension are always included in backups produced by the
<code class="literal">
mysqlbackup
</code>
command of the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_arm_file">
.ARM file
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqlbackup_command">
mysqlbackup command
</a>
.
</p>
</dd>
<dt>
<a name="glos_acid">
</a>
<span class="glossterm">
ACID
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045034012848">
</a>
An acronym standing for atomicity, consistency, isolation, and
durability. These properties are all desirable in a database
system, and are all closely tied to the notion of a
<span class="bold">
<strong>
transaction
</strong>
</span>
. The transactional
features of
<code class="literal">
InnoDB
</code>
adhere to the ACID
principles.
</p>
<p>
Transactions are
<span class="bold">
<strong>
atomic
</strong>
</span>
units
of work that can be
<span class="bold">
<strong>
committed
</strong>
</span>
or
<span class="bold">
<strong>
rolled back
</strong>
</span>
. When a
transaction makes multiple changes to the database, either all
the changes succeed when the transaction is committed, or all
the changes are undone when the transaction is rolled back.
</p>
<p>
The database remains in a consistent state at all times —
after each commit or rollback, and while transactions are in
progress. If related data is being updated across multiple
tables, queries see either all old values or all new values, not
a mix of old and new values.
</p>
<p>
Transactions are protected (isolated) from each other while they
are in progress; they cannot interfere with each other or see
each other's uncommitted data. This isolation is achieved
through the
<span class="bold">
<strong>
locking
</strong>
</span>
mechanism.
Experienced users can adjust the
<span class="bold">
<strong>
isolation
level
</strong>
</span>
, trading off less protection in favor of
increased performance and
<span class="bold">
<strong>
concurrency
</strong>
</span>
, when they can be
sure that the transactions really do not interfere with each
other.
</p>
<p>
The results of transactions are durable: once a commit operation
succeeds, the changes made by that transaction are safe from
power failures, system crashes, race conditions, or other
potential dangers that many non-database applications are
vulnerable to. Durability typically involves writing to disk
storage, with a certain amount of redundancy to protect against
power failures or software crashes during write operations. (In
<code class="literal">
InnoDB
</code>
, the
<span class="bold">
<strong>
doublewrite
buffer
</strong>
</span>
assists with durability.)
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_atomic">
atomic
</a>
,
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_doublewrite_buffer">
doublewrite buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_adaptive_flushing">
</a>
<span class="glossterm">
adaptive flushing
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033995584">
</a>
An algorithm for
<span class="bold">
<strong>
InnoDB
</strong>
</span>
tables
that smooths out the I/O overhead introduced by
<span class="bold">
<strong>
checkpoints
</strong>
</span>
. Instead of
<span class="bold">
<strong>
flushing
</strong>
</span>
all modified
<span class="bold">
<strong>
pages
</strong>
</span>
from the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
to the
<span class="bold">
<strong>
data files
</strong>
</span>
at once, MySQL
periodically flushes small sets of modified pages. The adaptive
flushing algorithm extends this process by estimating the
optimal rate to perform these periodic flushes, based on the
rate of flushing and how fast
<span class="bold">
<strong>
redo
</strong>
</span>
information is generated.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_checkpoint">
checkpoint
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_adaptive_hash_index">
</a>
<span class="glossterm">
adaptive hash index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033984336">
</a>
An optimization for
<code class="literal">
InnoDB
</code>
tables that can
speed up lookups using
<code class="literal">
=
</code>
and
<code class="literal">
IN
</code>
operators, by constructing a
<span class="bold">
<strong>
hash index
</strong>
</span>
in memory. MySQL
monitors index searches for
<code class="literal">
InnoDB
</code>
tables,
and if queries could benefit from a hash index, it builds one
automatically for index
<span class="bold">
<strong>
pages
</strong>
</span>
that are frequently accessed. In a sense, the adaptive hash
index configures MySQL at runtime to take advantage of ample
main memory, coming closer to the architecture of main-memory
databases. This feature is controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_adaptive_hash_index">
<code class="literal">
innodb_adaptive_hash_index
</code>
</a>
configuration option. Because this feature benefits some
workloads and not others, and the memory used for the hash index
is reserved in the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
,
typically you should benchmark with this feature both enabled
and disabled.
</p>
<p>
The hash index is always built based on an existing
<span class="bold">
<strong>
B-tree
</strong>
</span>
index on the table.
MySQL can build a hash index on a prefix of any length of the
key defined for the B-tree, depending on the pattern of searches
against the index. A hash index can be partial; the whole B-tree
index does not need to be cached in the buffer pool.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_b_tree">
B-tree
</a>
,
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_hash_index">
hash index
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_secondary_index">
secondary index
</a>
.
</p>
</dd>
<dt>
<a name="glos_ado_net">
</a>
<span class="glossterm">
ADO.NET
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033971440">
</a>
An object-relational mapping (ORM) framework for applications
built using .NET technologies such as
<span class="bold">
<strong>
ASP.NET
</strong>
</span>
. Such applications can
interface with MySQL through the
<span class="bold">
<strong>
Connector/NET
</strong>
</span>
component.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos__net">
.NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_asp_net">
ASP.net
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_mono">
Mono
</a>
,
<a class="glossseealso" href="glossary.html#glos_visual_studio">
Visual Studio
</a>
.
</p>
</dd>
<dt>
<a name="glos_aio">
</a>
<span class="glossterm">
AIO
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033964384">
</a>
Acronym for
<span class="bold">
<strong>
asynchronous I/O
</strong>
</span>
.
You might see this acronym in
<code class="literal">
InnoDB
</code>
messages
or keywords.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_asynchronous_io">
asynchronous I/O
</a>
.
</p>
</dd>
<dt>
<a name="glos_ansi">
</a>
<span class="glossterm">
ANSI
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033953712">
</a>
In
<span class="bold">
<strong>
ODBC
</strong>
</span>
, an alternative method
of supporting character sets and other internationalization
aspects. Contrast with
<span class="bold">
<strong>
Unicode
</strong>
</span>
.
<span class="bold">
<strong>
Connector/ODBC
</strong>
</span>
3.51 is an ANSI
driver, while Connector/ODBC 5.1 is a Unicode driver.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_odbc">
Connector/ODBC
</a>
,
<a class="glossseealso" href="glossary.html#glos_odbc">
ODBC
</a>
,
<a class="glossseealso" href="glossary.html#glos_unicode">
Unicode
</a>
.
</p>
</dd>
<dt>
<a name="glos_api">
</a>
<span class="glossterm">
API
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033947248">
</a>
APIs provide low-level access to the MySQL protocol and MySQL
resources from
<span class="bold">
<strong>
client
</strong>
</span>
programs.
Contrast with the higher-level access provided by a
<span class="bold">
<strong>
Connector
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_c_api">
C API
</a>
,
<a class="glossseealso" href="glossary.html#glos_client">
client
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector">
connector
</a>
,
<a class="glossseealso" href="glossary.html#glos_native_c_api">
native C API
</a>
,
<a class="glossseealso" href="glossary.html#glos_perl_api">
Perl API
</a>
,
<a class="glossseealso" href="glossary.html#glos_php_api">
PHP API
</a>
,
<a class="glossseealso" href="glossary.html#glos_python_api">
Python API
</a>
,
<a class="glossseealso" href="glossary.html#glos_ruby_api">
Ruby API
</a>
.
</p>
</dd>
<dt>
<a name="glos_application_programming_interface">
</a>
<span class="glossterm">
application programming interface (API)
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033938400">
</a>
A set of functions or procedures. An API provides a stable set
of names and types for functions, procedures, parameters, and
return values.
</p>
</dd>
<dt>
<a name="glos_apply">
</a>
<span class="glossterm">
apply
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033936192">
</a>
When a backup produced by the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product does not include the most
recent changes that occurred while the backup was underway, the
process of updating the backup files to include those changes is
known as the
<span class="bold">
<strong>
apply
</strong>
</span>
step. It is
specified by the
<code class="literal">
apply-log
</code>
option of the
<code class="literal">
mysqlbackup
</code>
command.
</p>
<p>
Before the changes are applied, we refer to the files as a
<span class="bold">
<strong>
raw backup
</strong>
</span>
. After the changes
are applied, we refer to the files as a
<span class="bold">
<strong>
prepared backup
</strong>
</span>
. The changes
are recorded in the
<span class="bold">
<strong>
ibbackup_logfile
</strong>
</span>
file; once the
apply step is finished, this file is no longer necessary.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibbackup_logfile">
ibbackup_logfile
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_prepared_backup">
prepared backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_raw_backup">
raw backup
</a>
.
</p>
</dd>
<dt>
<a name="glos_as">
</a>
<span class="glossterm">
AS
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033911712">
</a>
A Kerberos authentication server. AS can also refer to the
authentication service provided by an authentication server.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_authentication_server">
authentication server
</a>
.
</p>
</dd>
<dt>
<a name="glos_asp_net">
</a>
<span class="glossterm">
ASP.net
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033908976">
</a>
A framework for developing web-based applications using
<span class="bold">
<strong>
.NET
</strong>
</span>
technologies and
languages. Such applications can interface with MySQL through
the
<span class="bold">
<strong>
Connector/NET
</strong>
</span>
component.
</p>
<p>
Another technology for writing server-side web pages with MySQL
is
<span class="bold">
<strong>
PHP
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos__net">
.NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_ado_net">
ADO.NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_mono">
Mono
</a>
,
<a class="glossseealso" href="glossary.html#glos_php">
PHP
</a>
,
<a class="glossseealso" href="glossary.html#glos_visual_studio">
Visual Studio
</a>
.
</p>
</dd>
<dt>
<a name="glos_assembly">
</a>
<span class="glossterm">
assembly
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033900896">
</a>
A library of compiled code in a
<span class="bold">
<strong>
.NET
</strong>
</span>
system, accessed through
<span class="bold">
<strong>
Connector/NET
</strong>
</span>
. Stored in the
<span class="bold">
<strong>
GAC
</strong>
</span>
to allow versioning without
naming conflicts.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos__net">
.NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_gac">
GAC
</a>
.
</p>
</dd>
<dt>
<a name="glos_asynchronous_io">
</a>
<span class="glossterm">
asynchronous I/O
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033895392">
</a>
A type of I/O operation that allows other processing to proceed
before the I/O is completed. Also known as
<span class="bold">
<strong>
nonblocking I/O
</strong>
</span>
and abbreviated
as
<span class="bold">
<strong>
AIO
</strong>
</span>
.
<code class="literal">
InnoDB
</code>
uses this type of I/O for certain
operations that can run in parallel without affecting the
reliability of the database, such as reading pages into the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
that have not
actually been requested, but might be needed soon.
</p>
<p>
Historically,
<code class="literal">
InnoDB
</code>
used asynchronous I/O on
Windows systems only. Starting with the InnoDB Plugin 1.1 and
MySQL 5.5,
<code class="literal">
InnoDB
</code>
uses asynchronous I/O on
Linux systems. This change introduces a dependency on
<code class="literal">
libaio
</code>
. Asynchronous I/O on Linux systems is
configured using the
<a class="link" href="innodb-parameters.html#sysvar_innodb_use_native_aio">
<code class="literal">
innodb_use_native_aio
</code>
</a>
option,
which is enabled by default. On other Unix-like systems, InnoDB
uses synchronous I/O only.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_non_blocking_io">
nonblocking I/O
</a>
.
</p>
</dd>
<dt>
<a name="glos_atomic">
</a>
<span class="glossterm">
atomic
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033884848">
</a>
In the SQL context,
<span class="bold">
<strong>
transactions
</strong>
</span>
are units of work
that either succeed entirely (when
<span class="bold">
<strong>
committed
</strong>
</span>
) or have no effect at
all (when
<span class="bold">
<strong>
rolled back
</strong>
</span>
). The
indivisible ("atomic") property of transactions is the
<span class="quote">
“
<span class="quote">
A
</span>
”
</span>
in the acronym
<span class="bold">
<strong>
ACID
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_atomic_ddl">
</a>
<span class="glossterm">
atomic DDL
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033877200">
</a>
An atomic
<span class="emphasis">
<em>
DDL
</em>
</span>
statement is one that
combines the
<span class="emphasis">
<em>
data dictionary
</em>
</span>
updates,
<span class="emphasis">
<em>
storage engine
</em>
</span>
operations, and
<span class="emphasis">
<em>
binary log
</em>
</span>
writes associated with a DDL
operation into a single, atomic transaction. The transaction is
either fully committed or rolled back, even if the server halts
during the operation. Atomic DDL support was added in MySQL 8.0.
For more information, see
<a class="xref" href="atomic-ddl.html" title="15.1.1 Atomic Data Definition Statement Support">
Section 15.1.1, “Atomic Data Definition Statement Support”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_binary_log">
binary log
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_dictionary">
data dictionary
</a>
,
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_storage_engine">
storage engine
</a>
.
</p>
</dd>
<dt>
<a name="glos_atomic_instruction">
</a>
<span class="glossterm">
atomic instruction
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033870384">
</a>
Special instructions provided by the CPU, to ensure that
critical low-level operations cannot be interrupted.
</p>
</dd>
<dt>
<a name="glos_authentication_server">
</a>
<span class="glossterm">
authentication server
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033868112">
</a>
In Kerberos, a service that provides the initial ticket needed
to obtain a ticket-granting ticket (TGT) that is needed to
obtain other tickets from the ticket-granting server (TGS). The
authentication server (AS) combined with a TGS make up a key
distribution center (KDC).
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_key_distribution_center">
key distribution center
</a>
,
<a class="glossseealso" href="glossary.html#glos_ticket_granting_server">
ticket-granting server
</a>
.
</p>
</dd>
<dt>
<a name="glos_auto_increment">
</a>
<span class="glossterm">
auto-increment
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033864704">
</a>
A property of a table column (specified by the
<code class="literal">
AUTO_INCREMENT
</code>
keyword) that automatically
adds an ascending sequence of values in the column.
</p>
<p>
It saves work for the developer, not to have to produce new
unique values when inserting new rows. It provides useful
information for the query optimizer, because the column is known
to be not null and with unique values. The values from such a
column can be used as lookup keys in various contexts, and
because they are auto-generated there is no reason to ever
change them; for this reason, primary key columns are often
specified as auto-incrementing.
</p>
<p>
Auto-increment columns can be problematic with statement-based
replication, because replaying the statements on a replica might
not produce the same set of column values as on the source, due
to timing issues. When you have an auto-incrementing primary
key, you can use statement-based replication only with the
setting
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode=1
</code>
</a>
. If
you have
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode=2
</code>
</a>
,
which allows higher concurrency for insert operations, use
<span class="bold">
<strong>
row-based replication
</strong>
</span>
rather
than
<span class="bold">
<strong>
statement-based
replication
</strong>
</span>
. The setting
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode=0
</code>
</a>
should not be used except for compatibility purposes.
</p>
<p>
Consecutive lock mode
(
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode=1
</code>
</a>
) is
the default setting prior to MySQL 8.0.3. As of MySQL 8.0.3,
interleaved lock mode
(
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode=2
</code>
</a>
) is
the default, which reflects the change from statement-based to
row-based replication as the default replication type.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_auto_increment_locking">
auto-increment locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_autoinc_lock_mode">
innodb_autoinc_lock_mode
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_based_replication">
row-based replication
</a>
,
<a class="glossseealso" href="glossary.html#glos_statement_based_replication">
statement-based replication
</a>
.
</p>
</dd>
<dt>
<a name="glos_auto_increment_locking">
</a>
<span class="glossterm">
auto-increment locking
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033848176">
</a>
The convenience of an
<span class="bold">
<strong>
auto-increment
</strong>
</span>
primary key
involves some tradeoff with concurrency. In the simplest case,
if one transaction is inserting values into the table, any other
transactions must wait to do their own inserts into that table,
so that rows inserted by the first transaction receive
consecutive primary key values.
<code class="literal">
InnoDB
</code>
includes optimizations and the
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode
</code>
</a>
option
so that you can configure and optimal balance between
predictable sequences of auto-increment values and maximum
<span class="bold">
<strong>
concurrency
</strong>
</span>
for insert
operations.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_auto_increment">
auto-increment
</a>
,
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_autoinc_lock_mode">
innodb_autoinc_lock_mode
</a>
.
</p>
</dd>
<dt>
<a name="glos_autocommit">
</a>
<span class="glossterm">
autocommit
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033840640">
</a>
A setting that causes a
<span class="bold">
<strong>
commit
</strong>
</span>
operation after each
<span class="bold">
<strong>
SQL
</strong>
</span>
statement. This mode is not recommended for working with
<code class="literal">
InnoDB
</code>
tables with
<span class="bold">
<strong>
transactions
</strong>
</span>
that span several
statements. It can help performance for
<span class="bold">
<strong>
read-only transactions
</strong>
</span>
on
<code class="literal">
InnoDB
</code>
tables, where it minimizes overhead
from
<span class="bold">
<strong>
locking
</strong>
</span>
and generation of
<span class="bold">
<strong>
undo
</strong>
</span>
data, especially in MySQL
5.6.4 and up. It is also appropriate for working with
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
tables, where transactions
are not applicable.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_only_transaction">
read-only transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo">
undo
</a>
.
</p>
</dd>
<dt>
<a name="glos_availability">
</a>
<span class="glossterm">
availability
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033827872">
</a>
The ability to cope with, and if necessary recover from,
failures on the host, including failures of MySQL, the operating
system, or the hardware and maintenance activity that may
otherwise cause downtime. Often paired with
<span class="bold">
<strong>
scalability
</strong>
</span>
as critical aspects
of a large-scale deployment.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_scalability">
scalability
</a>
.
</p>
</dd>
<dt>
<a name="glos_mysql_enterprise_backup">
</a>
<span class="glossterm">
MySQL Enterprise Backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033960352">
</a>
A licensed product that performs
<span class="bold">
<strong>
hot
backups
</strong>
</span>
of MySQL databases. It offers the most
efficiency and flexibility when backing up
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
tables, but can also back up
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
and other kinds of tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
B
</h3>
<dl>
<dt>
<a name="glos_b_tree">
</a>
<span class="glossterm">
B-tree
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033823568">
</a>
A tree data structure that is popular for use in database
indexes. The structure is kept sorted at all times, enabling
fast lookup for exact matches (equals operator) and ranges (for
example, greater than, less than, and
<code class="literal">
BETWEEN
</code>
operators). This type of index is available for most storage
engines, such as
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
and
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
.
</p>
<p>
Because B-tree nodes can have many children, a B-tree is not the
same as a binary tree, which is limited to 2 children per node.
</p>
<p>
Contrast with
<span class="bold">
<strong>
hash index
</strong>
</span>
, which
is only available in the
<a class="link" href="memory-storage-engine.html" title="18.3 The MEMORY Storage Engine">
<code class="literal">
MEMORY
</code>
</a>
storage engine. The
<code class="literal">
MEMORY
</code>
storage engine can
also use B-tree indexes, and you should choose B-tree indexes
for
<code class="literal">
MEMORY
</code>
tables if some queries use range
operators.
</p>
<p>
The use of the term B-tree is intended as a reference to the
general class of index design. B-tree structures used by MySQL
storage engines may be regarded as variants due to
sophistications not present in a classic B-tree design. For
related information, refer to the
<code class="literal">
InnoDB
</code>
Page
Structure
<a class="ulink" href="/doc/internals/en/innodb-fil-header.html" target="_top">
Fil
Header
</a>
section of the
<a class="ulink" href="/doc/internals/en/index.html" target="_top">
MySQL
Internals Manual
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_hash_index">
hash index
</a>
.
</p>
</dd>
<dt>
<a name="glos_backticks">
</a>
<span class="glossterm">
backticks
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033809952">
</a>
Identifiers within MySQL SQL statements must be quoted using the
backtick character (
<code class="literal">
`
</code>
) if they contain
special characters or reserved words. For example, to refer to a
table named
<code class="literal">
FOO#BAR
</code>
or a column named
<code class="literal">
SELECT
</code>
, you would specify the identifiers as
<code class="literal">
`FOO#BAR`
</code>
and
<code class="literal">
`SELECT`
</code>
.
Since the backticks provide an extra level of safety, they are
used extensively in program-generated SQL statements, where the
identifier names might not be known in advance.
</p>
<p>
Many other database systems use double quotation marks
(
<code class="literal">
"
</code>
) around such special names. For
portability, you can enable
<code class="literal">
ANSI_QUOTES
</code>
mode
in MySQL and use double quotation marks instead of backticks to
qualify identifier names.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
.
</p>
</dd>
<dt>
<a name="glos_backup">
</a>
<span class="glossterm">
backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033801296">
</a>
The process of copying some or all table data and metadata from
a MySQL instance, for safekeeping. Can also refer to the set of
copied files. This is a crucial task for DBAs. The reverse of
this process is the
<span class="bold">
<strong>
restore
</strong>
</span>
operation.
</p>
<p>
With MySQL,
<span class="bold">
<strong>
physical backups
</strong>
</span>
are performed by the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product, and
<span class="bold">
<strong>
logical
backups
</strong>
</span>
are performed by the
<code class="literal">
mysqldump
</code>
command. These techniques have
different characteristics in terms of size and representation of
the backup data, and speed (especially speed of the restore
operation).
</p>
<p>
Backups are further classified as
<span class="bold">
<strong>
hot
</strong>
</span>
,
<span class="bold">
<strong>
warm
</strong>
</span>
, or
<span class="bold">
<strong>
cold
</strong>
</span>
depending on how much they
interfere with normal database operation. (Hot backups have the
least interference, cold backups the most.)
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cold_backup">
cold backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_logical_backup">
logical backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqldump">
mysqldump
</a>
,
<a class="glossseealso" href="glossary.html#glos_physical_backup">
physical backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_warm_backup">
warm backup
</a>
.
</p>
</dd>
<dt>
<a name="glos_base_column">
</a>
<span class="glossterm">
base column
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033788256">
</a>
A non-generated table column upon which a stored generated
column or virtual generated column is based. In other words, a
base column is a non-generated table column that is part of a
generated column definition.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_generated_column">
generated column
</a>
,
<a class="glossseealso" href="glossary.html#glos_stored_generated_column">
stored generated column
</a>
,
<a class="glossseealso" href="glossary.html#glos_virtual_generated_column">
virtual generated column
</a>
.
</p>
</dd>
<dt>
<a name="glos_beta">
</a>
<span class="glossterm">
beta
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033784288">
</a>
An early stage in the life of a software product, when it is
available only for evaluation, typically without a definite
release number or a number less than 1.
<code class="literal">
InnoDB
</code>
does not use the beta designation,
preferring an
<span class="bold">
<strong>
early adopter
</strong>
</span>
phase that can extend over several point releases, leading to a
<span class="bold">
<strong>
GA
</strong>
</span>
release.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_early_adopter">
early adopter
</a>
,
<a class="glossseealso" href="glossary.html#glos_ga">
GA
</a>
.
</p>
</dd>
<dt>
<a name="glos_binary_log">
</a>
<span class="glossterm">
binary log
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033778480">
</a>
A file containing a record of all statements or row changes that
attempt to change table data. The contents of the binary log can
be replayed to bring replicas up to date in a
<span class="bold">
<strong>
replication
</strong>
</span>
scenario, or to
bring a database up to date after restoring table data from a
backup. The binary logging feature can be turned on and off,
although Oracle recommends always enabling it if you use
replication or perform backups.
</p>
<p>
You can examine the contents of the binary log, or replay it
during replication or recovery, by using the
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
command. For full information
about the binary log, see
<a class="xref" href="binary-log.html" title="7.4.4 The Binary Log">
Section 7.4.4, “The Binary Log”
</a>
. For
MySQL configuration options related to the binary log, see
<a class="xref" href="replication-options-binary-log.html" title="19.1.6.4 Binary Logging Options and Variables">
Section 19.1.6.4, “Binary Logging Options and Variables”
</a>
.
</p>
<p>
For the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product, the file name of the binary log and the current
position within the file are important details. To record this
information for the source when taking a backup in a replication
context, you can specify the
<code class="literal">
--slave-info
</code>
option.
</p>
<p>
Prior to MySQL 5.0, a similar capability was available, known as
the update log. In MySQL 5.0 and higher, the binary log replaces
the update log.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_binlog">
binlog
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_replication">
replication
</a>
.
</p>
</dd>
<dt>
<a name="glos_binlog">
</a>
<span class="glossterm">
binlog
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033767600">
</a>
An informal name for the
<span class="bold">
<strong>
binary
log
</strong>
</span>
file. For example, you might see this
abbreviation used in e-mail messages or forum discussions.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_binary_log">
binary log
</a>
.
</p>
</dd>
<dt>
<a name="glos_blind_query_expansion">
</a>
<span class="glossterm">
blind query expansion
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033764112">
</a>
A special mode of
<span class="bold">
<strong>
full-text
search
</strong>
</span>
enabled by the
<code class="literal">
WITH QUERY
EXPANSION
</code>
clause. It performs the search twice, where
the search phrase for the second search is the original search
phrase concatenated with the few most highly relevant documents
from the first search. This technique is mainly applicable for
short search phrases, perhaps only a single word. It can uncover
relevant matches where the precise search term does not occur in
the document.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_full_text_search">
full-text search
</a>
.
</p>
</dd>
<dt>
<a name="glos_blob">
</a>
<span class="glossterm">
BLOB
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033759504">
</a>
An SQL data type (
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
TINYBLOB
</code>
</a>
,
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
BLOB
</code>
</a>
,
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
MEDIUMBLOB
</code>
</a>
, and
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
LONGBLOB
</code>
</a>
) for objects containing
any kind of binary data, of arbitrary size. Used for storing
documents, images, sound files, and other kinds of information
that cannot easily be decomposed to rows and columns within a
MySQL table. The techniques for handling BLOBs within a MySQL
application vary with each
<span class="bold">
<strong>
Connector
</strong>
</span>
and
<span class="bold">
<strong>
API
</strong>
</span>
. MySQL
<code class="literal">
Connector/ODBC
</code>
defines
<code class="literal">
BLOB
</code>
values as
<code class="literal">
LONGVARBINARY
</code>
. For large, free-form
collections of character data, the industry term is
<span class="bold">
<strong>
CLOB
</strong>
</span>
, represented by the MySQL
<code class="literal">
TEXT
</code>
data types.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
,
<a class="glossseealso" href="glossary.html#glos_clob">
CLOB
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector">
connector
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_odbc">
Connector/ODBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_bottleneck">
</a>
<span class="glossterm">
bottleneck
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033744752">
</a>
A portion of a system that is constrained in size or capacity,
that has the effect of limiting overall throughput. For example,
a memory area might be smaller than necessary; access to a
single required resource might prevent multiple CPU cores from
running simultaneously; or waiting for disk I/O to complete
might prevent the CPU from running at full capacity. Removing
bottlenecks tends to improve
<span class="bold">
<strong>
concurrency
</strong>
</span>
. For example, the
ability to have multiple
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
buffer pool
</strong>
</span>
instances reduces
contention when multiple sessions read from and write to the
buffer pool simultaneously.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
.
</p>
</dd>
<dt>
<a name="glos_bounce">
</a>
<span class="glossterm">
bounce
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033738944">
</a>
A
<span class="bold">
<strong>
shutdown
</strong>
</span>
operation
immediately followed by a restart. Ideally with a relatively
short
<span class="bold">
<strong>
warmup
</strong>
</span>
period so that
performance and throughput quickly return to a high level.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_shutdown">
shutdown
</a>
.
</p>
</dd>
<dt>
<a name="glos_buddy_allocator">
</a>
<span class="glossterm">
buddy allocator
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033734816">
</a>
A mechanism for managing different-sized
<span class="bold">
<strong>
pages
</strong>
</span>
in the InnoDB
<span class="bold">
<strong>
buffer pool
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_page_size">
page size
</a>
.
</p>
</dd>
<dt>
<a name="glos_buffer">
</a>
<span class="glossterm">
buffer
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033729728">
</a>
A memory or disk area used for temporary storage. Data is
buffered in memory so that it can be written to disk
efficiently, with a few large I/O operations rather than many
small ones. Data is buffered on disk for greater reliability, so
that it can be recovered even when a
<span class="bold">
<strong>
crash
</strong>
</span>
or other failure occurs
at the worst possible time. The main types of buffers used by
InnoDB are the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
, the
<span class="bold">
<strong>
doublewrite buffer
</strong>
</span>
, and the
<span class="bold">
<strong>
change buffer
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_change_buffer">
change buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_crash">
crash
</a>
,
<a class="glossseealso" href="glossary.html#glos_doublewrite_buffer">
doublewrite buffer
</a>
.
</p>
</dd>
<dt>
<a name="glos_buffer_pool">
</a>
<span class="glossterm">
buffer pool
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033722272">
</a>
The memory area that holds cached
<code class="literal">
InnoDB
</code>
data
for both tables and indexes. For efficiency of high-volume read
operations, the buffer pool is divided into
<span class="bold">
<strong>
pages
</strong>
</span>
that can potentially hold
multiple rows. For efficiency of cache management, the buffer
pool is implemented as a linked list of pages; data that is
rarely used is aged out of the cache, using a variation of the
<span class="bold">
<strong>
LRU
</strong>
</span>
algorithm. On systems with
large memory, you can improve concurrency by dividing the buffer
pool into multiple
<span class="bold">
<strong>
buffer pool
instances
</strong>
</span>
.
</p>
<p>
Several
<code class="literal">
InnoDB
</code>
status variables,
<code class="literal">
INFORMATION_SCHEMA
</code>
tables, and
<code class="literal">
performance_schema
</code>
tables help to monitor the
internal workings of the buffer pool. Starting in MySQL 5.6, you
can avoid a lengthy warmup period after restarting the server,
particularly for instances with large buffer pools, by saving
the buffer pool state at server shutdown and restoring the
buffer pool to the same state at server startup. See
<a class="xref" href="innodb-preload-buffer-pool.html" title="17.8.3.6 Saving and Restoring the Buffer Pool State">
Section 17.8.3.6, “Saving and Restoring the Buffer Pool State”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool_instance">
buffer pool instance
</a>
,
<a class="glossseealso" href="glossary.html#glos_lru">
LRU
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_warm_up">
warm up
</a>
.
</p>
</dd>
<dt>
<a name="glos_buffer_pool_instance">
</a>
<span class="glossterm">
buffer pool instance
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033711008">
</a>
Any of the multiple regions into which the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
can be divided,
controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_instances">
<code class="literal">
innodb_buffer_pool_instances
</code>
</a>
configuration option. The total memory size specified by
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_size">
<code class="literal">
innodb_buffer_pool_size
</code>
</a>
is
divided among all buffer pool instances. Typically, having
multiple buffer pool instances is appropriate for systems that
allocate multiple gigabytes to the
<code class="literal">
InnoDB
</code>
buffer pool, with each instance being one gigabyte or larger. On
systems loading or looking up large amounts of data in the
buffer pool from many concurrent sessions, having multiple
buffer pool instances reduces contention for exclusive access to
data structures that manage the buffer pool.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
.
</p>
</dd>
<dt>
<a name="glos_built_in">
</a>
<span class="glossterm">
built-in
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033703856">
</a>
The built-in
<code class="literal">
InnoDB
</code>
storage engine within
MySQL is the original form of distribution for the storage
engine. Contrast with the
<span class="bold">
<strong>
InnoDB
Plugin
</strong>
</span>
. Starting with MySQL 5.5, the InnoDB Plugin is
merged back into the MySQL code base as the built-in
<code class="literal">
InnoDB
</code>
storage engine (known as InnoDB 1.1).
</p>
<p>
This distinction is important mainly in MySQL 5.1, where a
feature or bug fix might apply to the InnoDB Plugin but not the
built-in
<code class="literal">
InnoDB
</code>
, or vice versa.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
.
</p>
</dd>
<dt>
<a name="glos_business_rules">
</a>
<span class="glossterm">
business rules
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033697600">
</a>
The relationships and sequences of actions that form the basis
of business software, used to run a commercial company.
Sometimes these rules are dictated by law, other times by
company policy. Careful planning ensures that the relationships
encoded and enforced by the database, and the actions performed
through application logic, accurately reflect the real policies
of the company and can handle real-life situations.
</p>
<p>
For example, an employee leaving a company might trigger a
sequence of actions from the human resources department. The
human resources database might also need the flexibility to
represent data about a person who has been hired, but not yet
started work. Closing an account at an online service might
result in data being removed from a database, or the data might
be moved or flagged so that it could be recovered if the account
is re-opened. A company might establish policies regarding
salary maximums, minimums, and adjustments, in addition to basic
sanity checks such as the salary not being a negative number. A
retail database might not allow a purchase with the same serial
number to be returned more than once, or might not allow credit
card purchases above a certain value, while a database used to
detect fraud might allow these kinds of things.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_relational">
relational
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
C
</h3>
<dl>
<dt>
<a name="glos_cfg_file">
</a>
<span class="glossterm">
.cfg file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033643792">
</a>
A metadata file used with the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
transportable tablespace
</strong>
</span>
feature. It is produced by the command
<code class="literal">
FLUSH TABLES ...
FOR EXPORT
</code>
, puts one or more tables in a consistent
state that can be copied to another server. The
<code class="literal">
.cfg
</code>
file is copied along with the
corresponding
<span class="bold">
<strong>
.ibd file
</strong>
</span>
, and
used to adjust the internal values of the
<code class="literal">
.ibd
</code>
file, such as the
<span class="bold">
<strong>
space ID
</strong>
</span>
, during the
<code class="literal">
ALTER TABLE ... IMPORT TABLESPACE
</code>
step.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_space_id">
space ID
</a>
,
<a class="glossseealso" href="glossary.html#glos_transportable_tablespace">
transportable tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_c">
</a>
<span class="glossterm">
C
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033692368">
</a>
A programming language that combines portability with
performance and access to low-level hardware features, making it
a popular choice for writing operating systems, drivers, and
other kinds of system software. Many complex applications,
languages, and reusable modules feature pieces written in C,
tied together with high-level components written in other
languages. Its core syntax is familiar to
<span class="bold">
<strong>
C++
</strong>
</span>
,
<span class="bold">
<strong>
Java
</strong>
</span>
, and
<span class="bold">
<strong>
C#
</strong>
</span>
developers.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_c_api">
C API
</a>
,
<a class="glossseealso" href="glossary.html#glos_cplusplus">
C++
</a>
,
<a class="glossseealso" href="glossary.html#glos_csharp">
C#
</a>
,
<a class="glossseealso" href="glossary.html#glos_java">
Java
</a>
.
</p>
</dd>
<dt>
<a name="glos_c_api">
</a>
<span class="glossterm">
C API
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033685440">
</a>
The C
<span class="bold">
<strong>
API
</strong>
</span>
code is distributed
with MySQL. It is included in the
<span class="bold">
<strong>
libmysqlclient
</strong>
</span>
library and
enables
<span class="bold">
<strong>
C
</strong>
</span>
programs to access a
database.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
,
<a class="glossseealso" href="glossary.html#glos_c">
C
</a>
,
<a class="glossseealso" href="glossary.html#glos_libmysqlclient">
libmysqlclient
</a>
.
</p>
</dd>
<dt>
<a name="glos_csharp">
</a>
<span class="glossterm">
C#
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033679504">
</a>
A programming language combining strong typing and
object-oriented features, running within the Microsoft
<span class="bold">
<strong>
.NET
</strong>
</span>
framework or its
open-source counterpart
<span class="bold">
<strong>
Mono
</strong>
</span>
.
Often used for creating applications with the
<span class="bold">
<strong>
ASP.net
</strong>
</span>
framework. Its syntax
is familiar to
<span class="bold">
<strong>
C
</strong>
</span>
,
<span class="bold">
<strong>
C++
</strong>
</span>
and
<span class="bold">
<strong>
Java
</strong>
</span>
developers.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos__net">
.NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_asp_net">
ASP.net
</a>
,
<a class="glossseealso" href="glossary.html#glos_c">
C
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_cplusplus">
C++
</a>
,
<a class="glossseealso" href="glossary.html#glos_java">
Java
</a>
,
<a class="glossseealso" href="glossary.html#glos_mono">
Mono
</a>
.
</p>
</dd>
<dt>
<a name="glos_cplusplus">
</a>
<span class="glossterm">
C++
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033669424">
</a>
A programming language with core syntax familiar to
<span class="bold">
<strong>
C
</strong>
</span>
developers. Provides access
to low-level operations for performance, combined with
higher-level data types, object-oriented features, and garbage
collection. To write C++ applications for MySQL, you use the
<span class="bold">
<strong>
Connector/C++
</strong>
</span>
component.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_c">
C
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_c__">
Connector/C++
</a>
.
</p>
</dd>
<dt>
<a name="glos_cache">
</a>
<span class="glossterm">
cache
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033664480">
</a>
The general term for any memory area that stores copies of data
for frequent or high-speed retrieval. In
<code class="literal">
InnoDB
</code>
, the primary kind of cache structure
is the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer">
buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
.
</p>
</dd>
<dt>
<a name="glos_cardinality">
</a>
<span class="glossterm">
cardinality
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033659728">
</a>
The number of different values in a table
<span class="bold">
<strong>
column
</strong>
</span>
. When queries refer to
columns that have an associated
<span class="bold">
<strong>
index
</strong>
</span>
, the cardinality of each
column influences which access method is most efficient. For
example, for a column with a
<span class="bold">
<strong>
unique
constraint
</strong>
</span>
, the number of different values is equal
to the number of rows in the table. If a table has a million
rows but only 10 different values for a particular column, each
value occurs (on average) 100,000 times. A query such as
<code class="literal">
SELECT c1 FROM t1 WHERE c1 = 50;
</code>
thus might
return 1 row or a huge number of rows, and the database server
might process the query differently depending on the cardinality
of
<code class="literal">
c1
</code>
.
</p>
<p>
If the values in a column have a very uneven distribution, the
cardinality might not be a good way to determine the best query
plan. For example,
<code class="literal">
SELECT c1 FROM t1 WHERE c1 =
x;
</code>
might return 1 row when
<code class="literal">
x=50
</code>
and
a million rows when
<code class="literal">
x=30
</code>
. In such a case, you
might need to use
<span class="bold">
<strong>
index hints
</strong>
</span>
to pass along advice about which lookup method is more efficient
for a particular query.
</p>
<p>
Cardinality can also apply to the number of distinct values
present in multiple columns, as in a
<span class="bold">
<strong>
composite index
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_column">
column
</a>
,
<a class="glossseealso" href="glossary.html#glos_composite_index">
composite index
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_index_hint">
index hint
</a>
,
<a class="glossseealso" href="glossary.html#glos_persistent_statistics">
persistent statistics
</a>
,
<a class="glossseealso" href="glossary.html#glos_random_dive">
random dive
</a>
,
<a class="glossseealso" href="glossary.html#glos_selectivity">
selectivity
</a>
,
<a class="glossseealso" href="glossary.html#glos_unique_constraint">
unique constraint
</a>
.
</p>
</dd>
<dt>
<a name="glos_change_buffer">
</a>
<span class="glossterm">
change buffer
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033633696">
</a>
A special data structure that records changes to
<span class="bold">
<strong>
pages
</strong>
</span>
in
<span class="bold">
<strong>
secondary indexes
</strong>
</span>
. These values
could result from SQL
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
,
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
, or
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
statements
(
<span class="bold">
<strong>
DML
</strong>
</span>
). The set of features
involving the change buffer is known collectively as
<span class="bold">
<strong>
change buffering
</strong>
</span>
, consisting of
<span class="bold">
<strong>
insert buffering
</strong>
</span>
,
<span class="bold">
<strong>
delete buffering
</strong>
</span>
, and
<span class="bold">
<strong>
purge buffering
</strong>
</span>
.
</p>
<p>
Changes are only recorded in the change buffer when the relevant
page from the secondary index is not in the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
. When the relevant
index page is brought into the buffer pool while associated
changes are still in the change buffer, the changes for that
page are applied in the buffer pool
(
<span class="bold">
<strong>
merged
</strong>
</span>
) using the data from
the change buffer. Periodically, the
<span class="bold">
<strong>
purge
</strong>
</span>
operation that runs
during times when the system is mostly idle, or during a slow
shutdown, writes the new index pages to disk. The purge
operation can write the disk blocks for a series of index values
more efficiently than if each value were written to disk
immediately.
</p>
<p>
Physically, the change buffer is part of the
<span class="bold">
<strong>
system tablespace
</strong>
</span>
, so that the
index changes remain buffered across database restarts. The
changes are only applied
(
<span class="bold">
<strong>
merged
</strong>
</span>
) when the pages are
brought into the buffer pool due to some other read operation.
</p>
<p>
The kinds and amount of data stored in the change buffer are
governed by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_change_buffering">
<code class="literal">
innodb_change_buffering
</code>
</a>
and
<a class="link" href="innodb-parameters.html#sysvar_innodb_change_buffer_max_size">
<code class="literal">
innodb_change_buffer_max_size
</code>
</a>
configuration options. To see information about the current data
in the change buffer, issue the
<a class="link" href="show-engine.html" title="15.7.7.16 SHOW ENGINE Statement">
<code class="literal">
SHOW ENGINE INNODB
STATUS
</code>
</a>
command.
</p>
<p>
Formerly known as the
<span class="bold">
<strong>
insert
buffer
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_change_buffering">
change buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_delete_buffering">
delete buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_insert_buffer">
insert buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_insert_buffering">
insert buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_merge">
merge
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge">
purge
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge_buffering">
purge buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_secondary_index">
secondary index
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_change_buffering">
</a>
<span class="glossterm">
change buffering
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033605104">
</a>
The general term for the features involving the
<span class="bold">
<strong>
change buffer
</strong>
</span>
, consisting of
<span class="bold">
<strong>
insert buffering
</strong>
</span>
,
<span class="bold">
<strong>
delete buffering
</strong>
</span>
, and
<span class="bold">
<strong>
purge buffering
</strong>
</span>
. Index changes
resulting from SQL statements, which could normally involve
random I/O operations, are held back and performed periodically
by a background
<span class="bold">
<strong>
thread
</strong>
</span>
. This
sequence of operations can write the disk blocks for a series of
index values more efficiently than if each value were written to
disk immediately. Controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_change_buffering">
<code class="literal">
innodb_change_buffering
</code>
</a>
and
<a class="link" href="innodb-parameters.html#sysvar_innodb_change_buffer_max_size">
<code class="literal">
innodb_change_buffer_max_size
</code>
</a>
configuration options.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_change_buffer">
change buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_delete_buffering">
delete buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_insert_buffering">
insert buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge_buffering">
purge buffering
</a>
.
</p>
</dd>
<dt>
<a name="glos_checkpoint">
</a>
<span class="glossterm">
checkpoint
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033594464">
</a>
As changes are made to data pages that are cached in the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
, those changes are
written to the
<span class="bold">
<strong>
data files
</strong>
</span>
sometime later, a process known as
<span class="bold">
<strong>
flushing
</strong>
</span>
. The checkpoint is a
record of the latest changes (represented by an
<span class="bold">
<strong>
LSN
</strong>
</span>
value) that have been
successfully written to the data files.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_fuzzy_checkpointing">
fuzzy checkpointing
</a>
,
<a class="glossseealso" href="glossary.html#glos_lsn">
LSN
</a>
.
</p>
</dd>
<dt>
<a name="glos_checksum">
</a>
<span class="glossterm">
checksum
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033586752">
</a>
In
<code class="literal">
InnoDB
</code>
, a validation mechanism to detect
corruption when a
<span class="bold">
<strong>
page
</strong>
</span>
in a
<span class="bold">
<strong>
tablespace
</strong>
</span>
is read from disk
into the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
buffer
pool
</strong>
</span>
. This feature is controlled by the
<code class="literal">
innodb_checksums
</code>
configuration option in
MySQL 5.5.
<code class="literal">
innodb_checksums
</code>
is deprecated in
MySQL 5.6.3, replaced by
<a class="link" href="innodb-parameters.html#sysvar_innodb_checksum_algorithm">
<code class="literal">
innodb_checksum_algorithm
</code>
</a>
.
</p>
<p>
The
<a class="link" href="innochecksum.html" title="6.6.2 innochecksum — Offline InnoDB File Checksum Utility">
<span class="command">
<strong>
innochecksum
</strong>
</span>
</a>
command helps diagnose
corruption problems by testing the checksum values for a
specified
<span class="bold">
<strong>
tablespace
</strong>
</span>
file while
the MySQL server is shut down.
</p>
<p>
MySQL also uses checksums for replication purposes. For details,
see the configuration options
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_checksum">
<code class="literal">
binlog_checksum
</code>
</a>
,
<a class="link" href="replication-options-binary-log.html#sysvar_source_verify_checksum">
<code class="literal">
source_verify_checksum
</code>
</a>
or
<a class="link" href="replication-options-binary-log.html#sysvar_master_verify_checksum">
<code class="literal">
master_verify_checksum
</code>
</a>
, and
<a class="link" href="replication-options-replica.html#sysvar_replica_sql_verify_checksum">
<code class="literal">
replica_sql_verify_checksum
</code>
</a>
or
<a class="link" href="replication-options-replica.html#sysvar_slave_sql_verify_checksum">
<code class="literal">
slave_sql_verify_checksum
</code>
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_child_table">
</a>
<span class="glossterm">
child table
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033567312">
</a>
In a
<span class="bold">
<strong>
foreign key
</strong>
</span>
relationship,
a child table is one whose rows refer (or point) to rows in
another table with an identical value for a specific column.
This is the table that contains the
<code class="literal">
FOREIGN KEY ...
REFERENCES
</code>
clause and optionally
<code class="literal">
ON
UPDATE
</code>
and
<code class="literal">
ON DELETE
</code>
clauses. The
corresponding row in the
<span class="bold">
<strong>
parent
table
</strong>
</span>
must exist before the row can be created in the
child table. The values in the child table can prevent delete or
update operations on the parent table, or can cause automatic
deletion or updates in the child table, based on the
<code class="literal">
ON
CASCADE
</code>
option used when creating the foreign key.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_foreign_key">
foreign key
</a>
,
<a class="glossseealso" href="glossary.html#glos_parent_table">
parent table
</a>
.
</p>
</dd>
<dt>
<a name="glos_clean_page">
</a>
<span class="glossterm">
clean page
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033559408">
</a>
A
<span class="bold">
<strong>
page
</strong>
</span>
in the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
buffer
pool
</strong>
</span>
where all changes made in memory have also been
written (
<span class="bold">
<strong>
flushed
</strong>
</span>
) to the
<a class="link" href="glossary.html#glos_data_files" title="data files">
data files
</a>
. The opposite
of a
<span class="bold">
<strong>
dirty page
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_dirty_page">
dirty page
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
.
</p>
</dd>
<dt>
<a name="glos_clean_shutdown">
</a>
<span class="glossterm">
clean shutdown
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033550256">
</a>
A
<span class="bold">
<strong>
shutdown
</strong>
</span>
that completes
without errors and applies all changes to
<code class="literal">
InnoDB
</code>
tables before finishing, as opposed to
a
<span class="bold">
<strong>
crash
</strong>
</span>
or a
<span class="bold">
<strong>
fast shutdown
</strong>
</span>
. Synonym for
<span class="bold">
<strong>
slow shutdown
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_crash">
crash
</a>
,
<a class="glossseealso" href="glossary.html#glos_fast_shutdown">
fast shutdown
</a>
,
<a class="glossseealso" href="glossary.html#glos_shutdown">
shutdown
</a>
,
<a class="glossseealso" href="glossary.html#glos_slow_shutdown">
slow shutdown
</a>
.
</p>
</dd>
<dt>
<a name="glos_client">
</a>
<span class="glossterm">
client
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033542496">
</a>
A program that runs outside the database server, communicating
with the database by sending requests through a
<span class="bold">
<strong>
Connector
</strong>
</span>
, or an
<span class="bold">
<strong>
API
</strong>
</span>
made available through
<span class="bold">
<strong>
client libraries
</strong>
</span>
. It can run on
the same physical machine as the database server, or on a remote
machine connected over a network. It can be a special-purpose
database application, or a general-purpose program like the
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
command-line processor.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
,
<a class="glossseealso" href="glossary.html#glos_client_libraries">
client libraries
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector">
connector
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql">
mysql
</a>
,
<a class="glossseealso" href="glossary.html#glos_server">
server
</a>
.
</p>
</dd>
<dt>
<a name="glos_client_libraries">
</a>
<span class="glossterm">
client libraries
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033533712">
</a>
Files containing collections of functions for working with
databases. By compiling your program with these libraries, or
installing them on the same system as your application, you can
run a database application (known as a
<span class="bold">
<strong>
client
</strong>
</span>
) on a machine that does
not have the MySQL server installed; the application accesses
the database over a network. With MySQL, you can use the
<span class="bold">
<strong>
libmysqlclient
</strong>
</span>
library from the
MySQL server itself.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_client">
client
</a>
,
<a class="glossseealso" href="glossary.html#glos_libmysqlclient">
libmysqlclient
</a>
.
</p>
</dd>
<dt>
<a name="glos_client_side_prepared_statement">
</a>
<span class="glossterm">
client-side prepared statement
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033528592">
</a>
A type of
<span class="bold">
<strong>
prepared statement
</strong>
</span>
where the caching and reuse are managed locally, emulating the
functionality of
<span class="bold">
<strong>
server-side prepared
statements
</strong>
</span>
. Historically, used by some
<span class="bold">
<strong>
Connector/J
</strong>
</span>
,
<span class="bold">
<strong>
Connector/ODBC
</strong>
</span>
, and
<span class="bold">
<strong>
Connector/PHP
</strong>
</span>
developers to
work around issues with server-side stored procedures. With
modern MySQL server versions, server-side prepared statements
are recommended for performance, scalability, and memory
efficiency.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_odbc">
Connector/ODBC
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_php">
Connector/PHP
</a>
,
<a class="glossseealso" href="glossary.html#glos_prepared_statement">
prepared statement
</a>
.
</p>
</dd>
<dt>
<a name="glos_clob">
</a>
<span class="glossterm">
CLOB
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033520208">
</a>
An SQL data type (
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
TINYTEXT
</code>
</a>
,
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
TEXT
</code>
</a>
,
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
MEDIUMTEXT
</code>
</a>
, or
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
LONGTEXT
</code>
</a>
) for objects containing
any kind of character data, of arbitrary size. Used for storing
text-based documents, with associated character set and
collation order. The techniques for handling CLOBs within a
MySQL application vary with each
<span class="bold">
<strong>
Connector
</strong>
</span>
and
<span class="bold">
<strong>
API
</strong>
</span>
. MySQL Connector/ODBC
defines
<code class="literal">
TEXT
</code>
values as
<code class="literal">
LONGVARCHAR
</code>
. For storing binary data, the
equivalent is the
<span class="bold">
<strong>
BLOB
</strong>
</span>
type.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
,
<a class="glossseealso" href="glossary.html#glos_blob">
BLOB
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector">
connector
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_odbc">
Connector/ODBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_clustered_index">
</a>
<span class="glossterm">
clustered index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033507248">
</a>
The
<code class="literal">
InnoDB
</code>
term for a
<span class="bold">
<strong>
primary key
</strong>
</span>
index.
<code class="literal">
InnoDB
</code>
table storage is organized based on
the values of the primary key columns, to speed up queries and
sorts involving the primary key columns. For best performance,
choose the primary key columns carefully based on the most
performance-critical queries. Because modifying the columns of
the clustered index is an expensive operation, choose primary
columns that are rarely or never updated.
</p>
<p>
In the Oracle Database product, this type of table is known as
an
<span class="bold">
<strong>
index-organized table
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
,
<a class="glossseealso" href="glossary.html#glos_secondary_index">
secondary index
</a>
.
</p>
</dd>
<dt>
<a name="glos_cold_backup">
</a>
<span class="glossterm">
cold backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033499904">
</a>
A
<span class="bold">
<strong>
backup
</strong>
</span>
taken while the
database is shut down. For busy applications and websites, this
might not be practical, and you might prefer a
<span class="bold">
<strong>
warm backup
</strong>
</span>
or a
<span class="bold">
<strong>
hot backup
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_backup">
backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_warm_backup">
warm backup
</a>
.
</p>
</dd>
<dt>
<a name="glos_column">
</a>
<span class="glossterm">
column
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033493920">
</a>
A data item within a
<span class="bold">
<strong>
row
</strong>
</span>
, whose
storage and semantics are defined by a data type. Each
<span class="bold">
<strong>
table
</strong>
</span>
and
<span class="bold">
<strong>
index
</strong>
</span>
is largely defined by the
set of columns it contains.
</p>
<p>
Each column has a
<span class="bold">
<strong>
cardinality
</strong>
</span>
value. A column can be the
<span class="bold">
<strong>
primary
key
</strong>
</span>
for its table, or part of the primary key. A
column can be subject to a
<span class="bold">
<strong>
unique
constraint
</strong>
</span>
, a
<span class="bold">
<strong>
NOT NULL
constraint
</strong>
</span>
, or both. Values in different columns,
even across different tables, can be linked by a
<span class="bold">
<strong>
foreign key
</strong>
</span>
relationship.
</p>
<p>
In discussions of MySQL internal operations, sometimes
<span class="bold">
<strong>
field
</strong>
</span>
is used as a synonym.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cardinality">
cardinality
</a>
,
<a class="glossseealso" href="glossary.html#glos_foreign_key">
foreign key
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_not_null_constraint">
NOT NULL constraint
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
,
<a class="glossseealso" href="glossary.html#glos_row">
row
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
,
<a class="glossseealso" href="glossary.html#glos_unique_constraint">
unique constraint
</a>
.
</p>
</dd>
<dt>
<a name="glos_column_index">
</a>
<span class="glossterm">
column index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033479664">
</a>
An
<span class="bold">
<strong>
index
</strong>
</span>
on a single column.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_composite_index">
composite index
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
.
</p>
</dd>
<dt>
<a name="glos_column_prefix">
</a>
<span class="glossterm">
column prefix
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033475888">
</a>
When an
<span class="bold">
<strong>
index
</strong>
</span>
is created with a
length specification, such as
<code class="literal">
CREATE INDEX idx ON t1
(c1(N))
</code>
, only the first N characters of the column
value are stored in the index. Keeping the index prefix small
makes the index compact, and the memory and disk I/O savings
help performance. (Although making the index prefix too small
can hinder query optimization by making rows with different
values appear to the query optimizer to be duplicates.)
</p>
<p>
For columns containing binary values or long text strings, where
sorting is not a major consideration and storing the entire
value in the index would waste space, the index automatically
uses the first N (typically 768) characters of the value to do
lookups and sorts.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
.
</p>
</dd>
<dt>
<a name="glos_command_interceptor">
</a>
<span class="glossterm">
command interceptor
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033470640">
</a>
Synonym for
<span class="bold">
<strong>
statement
interceptor
</strong>
</span>
. One aspect of the
<span class="bold">
<strong>
interceptor
</strong>
</span>
design pattern
available for both
<span class="bold">
<strong>
Connector/NET
</strong>
</span>
and
<span class="bold">
<strong>
Connector/J
</strong>
</span>
. What Connector/NET calls
a command, Connector/J refers to as a statement. Contrast with
<span class="bold">
<strong>
exception interceptor
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_exception_interceptor">
exception interceptor
</a>
,
<a class="glossseealso" href="glossary.html#glos_interceptor">
interceptor
</a>
,
<a class="glossseealso" href="glossary.html#glos_statement_interceptor">
statement interceptor
</a>
.
</p>
</dd>
<dt>
<a name="glos_commit">
</a>
<span class="glossterm">
commit
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033461776">
</a>
A
<span class="bold">
<strong>
SQL
</strong>
</span>
statement that ends a
<span class="bold">
<strong>
transaction
</strong>
</span>
, making permanent
any changes made by the transaction. It is the opposite of
<span class="bold">
<strong>
rollback
</strong>
</span>
, which undoes any
changes made in the transaction.
</p>
<p>
<code class="literal">
InnoDB
</code>
uses an
<span class="bold">
<strong>
optimistic
</strong>
</span>
mechanism for
commits, so that changes can be written to the data files before
the commit actually occurs. This technique makes the commit
itself faster, with the tradeoff that more work is required in
case of a rollback.
</p>
<p>
By default, MySQL uses the
<span class="bold">
<strong>
autocommit
</strong>
</span>
setting, which
automatically issues a commit following each SQL statement.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_autocommit">
autocommit
</a>
,
<a class="glossseealso" href="glossary.html#glos_optimistic">
optimistic
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_compact_row_format">
</a>
<span class="glossterm">
compact row format
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033451600">
</a>
A
<span class="bold">
<strong>
row format
</strong>
</span>
for InnoDB tables.
It was the default row format from MySQL 5.0.3 to MySQL 5.7.8.
In MySQL 8.0, the default row format is defined by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_default_row_format">
<code class="literal">
innodb_default_row_format
</code>
</a>
configuration option, which has a default setting of
<span class="bold">
<strong>
DYNAMIC
</strong>
</span>
. The
<span class="bold">
<strong>
COMPACT
</strong>
</span>
row format provides a
more compact representation for nulls and variable-length
columns than the
<span class="bold">
<strong>
REDUNDANT
</strong>
</span>
row
format.
</p>
<p>
For additional information about
<code class="literal">
InnoDB
</code>
<code class="literal">
COMPACT
</code>
row format, see
<a class="xref" href="innodb-row-format.html" title="17.10 InnoDB Row Formats">
Section 17.10, “InnoDB Row Formats”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_dynamic_row_format">
dynamic row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_format">
file format
</a>
,
<a class="glossseealso" href="glossary.html#glos_redundant_row_format">
redundant row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_format">
row format
</a>
.
</p>
</dd>
<dt>
<a name="glos_composite_index">
</a>
<span class="glossterm">
composite index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033440208">
</a>
An
<span class="bold">
<strong>
index
</strong>
</span>
that includes multiple
columns.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
.
</p>
</dd>
<dt>
<a name="glos_compressed_backup">
</a>
<span class="glossterm">
compressed backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033436928">
</a>
The compression feature of the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product makes a compressed copy of
each tablespace, changing the extension from
<code class="literal">
.ibd
</code>
to
<code class="literal">
.ibz
</code>
. Compressing
backup data allows you to keep more backups on hand, and reduces
the time to transfer backups to a different server. The data is
uncompressed during the restore operation. When a compressed
backup operation processes a table that is already compressed,
it skips the compression step for that table, because
compressing again would result in little or no space savings.
</p>
<p>
A set of files produced by the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product, where each
<span class="bold">
<strong>
tablespace
</strong>
</span>
is compressed. The
compressed files are renamed with a
<code class="literal">
.ibz
</code>
file
extension.
</p>
<p>
Applying
<span class="bold">
<strong>
compression
</strong>
</span>
at the
start of the backup process helps to avoid storage overhead
during the compression process, and to avoid network overhead
when transferring the backup files to another server. The
process of
<span class="bold">
<strong>
applying
</strong>
</span>
the
<span class="bold">
<strong>
binary log
</strong>
</span>
takes longer, and
requires uncompressing the backup files.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_apply">
apply
</a>
,
<a class="glossseealso" href="glossary.html#glos_binary_log">
binary log
</a>
,
<a class="glossseealso" href="glossary.html#glos_compression">
compression
</a>
,
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_compressed_row_format">
</a>
<span class="glossterm">
compressed row format
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033423440">
</a>
A
<span class="bold">
<strong>
row format
</strong>
</span>
that enables data
and index
<span class="bold">
<strong>
compression
</strong>
</span>
for
<code class="literal">
InnoDB
</code>
tables. Large fields are stored away
from the page that holds the rest of the row data, as in
<span class="bold">
<strong>
dynamic row format
</strong>
</span>
. Both index
pages and the large fields are compressed, yielding memory and
disk savings. Depending on the structure of the data, the
decrease in memory and disk usage might or might not outweigh
the performance overhead of uncompressing the data as it is
used. See
<a class="xref" href="innodb-compression.html" title="17.9 InnoDB Table and Page Compression">
Section 17.9, “InnoDB Table and Page Compression”
</a>
for usage
details.
</p>
<p>
For additional information about
<code class="literal">
InnoDB
</code>
<code class="literal">
COMPRESSED
</code>
row format, see
<a class="xref" href="innodb-row-format.html#innodb-row-format-dynamic" title="DYNAMIC Row Format">
DYNAMIC Row Format
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_compression">
compression
</a>
,
<a class="glossseealso" href="glossary.html#glos_dynamic_row_format">
dynamic row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_format">
row format
</a>
.
</p>
</dd>
<dt>
<a name="glos_compressed_table">
</a>
<span class="glossterm">
compressed table
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033413392">
</a>
A table for which the data is stored in compressed form. For
<code class="literal">
InnoDB
</code>
, it is a table created with
<code class="literal">
ROW_FORMAT=COMPRESSED
</code>
. See
<a class="xref" href="innodb-compression.html" title="17.9 InnoDB Table and Page Compression">
Section 17.9, “InnoDB Table and Page Compression”
</a>
for more information.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_compressed_row_format">
compressed row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_compression">
compression
</a>
.
</p>
</dd>
<dt>
<a name="glos_compression">
</a>
<span class="glossterm">
compression
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033408112">
</a>
A feature with wide-ranging benefits from using less disk space,
performing less I/O, and using less memory for caching.
</p>
<p>
<code class="literal">
InnoDB
</code>
supports both table-level and
page-level compression.
<code class="literal">
InnoDB
</code>
page
compression is also referred to as
<span class="bold">
<strong>
transparent page compression
</strong>
</span>
.
For more information about
<code class="literal">
InnoDB
</code>
compression, see
<a class="xref" href="innodb-compression.html" title="17.9 InnoDB Table and Page Compression">
Section 17.9, “InnoDB Table and Page Compression”
</a>
.
</p>
<p>
Another type of compression is the
<span class="bold">
<strong>
compressed backup
</strong>
</span>
feature of
the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_compressed_backup">
compressed backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_compressed_row_format">
compressed row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_transparent_page_compression">
transparent page compression
</a>
.
</p>
</dd>
<dt>
<a name="glos_compression_failure">
</a>
<span class="glossterm">
compression failure
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033397200">
</a>
Not actually an error, rather an expensive operation that can
occur when using
<span class="bold">
<strong>
compression
</strong>
</span>
in
combination with
<span class="bold">
<strong>
DML
</strong>
</span>
operations. It occurs when: updates to a compressed
<span class="bold">
<strong>
page
</strong>
</span>
overflow the area on the
page reserved for recording modifications; the page is
compressed again, with all changes applied to the table data;
the re-compressed data does not fit on the original page,
requiring MySQL to split the data into two new pages and
compress each one separately. To check the frequency of this
condition, query the
<a class="link" href="information-schema-innodb-cmp-table.html" title="28.4.6 The INFORMATION_SCHEMA INNODB_CMP and INNODB_CMP_RESET Tables">
<code class="literal">
INFORMATION_SCHEMA.INNODB_CMP
</code>
</a>
table
and check how much the value of the
<code class="literal">
COMPRESS_OPS
</code>
column exceeds the value of the
<code class="literal">
COMPRESS_OPS_OK
</code>
column. Ideally, compression
failures do not occur often; when they do, you can adjust the
<a class="link" href="innodb-parameters.html#sysvar_innodb_compression_level">
<code class="literal">
innodb_compression_level
</code>
</a>
,
<a class="link" href="innodb-parameters.html#sysvar_innodb_compression_failure_threshold_pct">
<code class="literal">
innodb_compression_failure_threshold_pct
</code>
</a>
,
and
<a class="link" href="innodb-parameters.html#sysvar_innodb_compression_pad_pct_max">
<code class="literal">
innodb_compression_pad_pct_max
</code>
</a>
configuration options.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_compression">
compression
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
.
</p>
</dd>
<dt>
<a name="glos_concatenated_index">
</a>
<span class="glossterm">
concatenated index
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_composite_index">
composite index
</a>
.
</p>
</dd>
<dt>
<a name="glos_concurrency">
</a>
<span class="glossterm">
concurrency
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033382880">
</a>
The ability of multiple operations (in database terminology,
<span class="bold">
<strong>
transactions
</strong>
</span>
) to run
simultaneously, without interfering with each other. Concurrency
is also involved with performance, because ideally the
protection for multiple simultaneous transactions works with a
minimum of performance overhead, using efficient mechanisms for
<span class="bold">
<strong>
locking
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_configuration_file">
</a>
<span class="glossterm">
configuration file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033377472">
</a>
The file that holds the
<span class="bold">
<strong>
option
</strong>
</span>
values used by MySQL at startup. Traditionally, on Linux and
Unix this file is named
<code class="literal">
my.cnf
</code>
, and on
Windows it is named
<code class="literal">
my.ini
</code>
. You can set a
number of options related to InnoDB under the
<code class="literal">
[mysqld]
</code>
section of the file.
</p>
<p>
See
<a class="xref" href="option-files.html" title="6.2.2.2 Using Option Files">
Section 6.2.2.2, “Using Option Files”
</a>
for information about where
MySQL searches for configuration files.
</p>
<p>
When you use the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product, you typically use two configuration
files: one that specifies where the data comes from and how it
is structured (which could be the original configuration file
for your server), and a stripped-down one containing only a
small set of options that specify where the backup data goes and
how it is structured. The configuration files used with the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product
must contain certain options that are typically left out of
regular configuration files, so you might need to add options to
your existing configuration file for use with
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_my_cnf">
my.cnf
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_option">
option
</a>
,
<a class="glossseealso" href="glossary.html#glos_option_file">
option file
</a>
.
</p>
</dd>
<dt>
<a name="glos_connection">
</a>
<span class="glossterm">
connection
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033365472">
</a>
The communication channel between an application and a MySQL
server. The performance and scalability of a database
applications is influenced by on how quickly a database
connection can be established, how many can be made
simultaneously, and how long they persist. The parameters such
as
<span class="bold">
<strong>
host
</strong>
</span>
,
<span class="bold">
<strong>
port
</strong>
</span>
, and so on are represented
as a
<span class="bold">
<strong>
connection string
</strong>
</span>
in
<span class="bold">
<strong>
Connector/NET
</strong>
</span>
, and as a
<span class="bold">
<strong>
DSN
</strong>
</span>
in
<span class="bold">
<strong>
Connector/ODBC
</strong>
</span>
. High-traffic
systems make use of an optimization known as the
<span class="bold">
<strong>
connection pool
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connection_pool">
connection pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_connection_string">
connection string
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_odbc">
Connector/ODBC
</a>
,
<a class="glossseealso" href="glossary.html#glos_dsn">
DSN
</a>
,
<a class="glossseealso" href="glossary.html#glos_host">
host
</a>
,
<a class="glossseealso" href="glossary.html#glos_port">
port
</a>
.
</p>
</dd>
<dt>
<a name="glos_connection_pool">
</a>
<span class="glossterm">
connection pool
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033353568">
</a>
A cache area that allows database
<span class="bold">
<strong>
connections
</strong>
</span>
to be reused within
the same application or across different applications, rather
than setting up and tearing down a new connection for every
database operation. This technique is common with
<span class="bold">
<strong>
J2EE
</strong>
</span>
application servers.
<span class="bold">
<strong>
Java
</strong>
</span>
applications using
<span class="bold">
<strong>
Connector/J
</strong>
</span>
can use the
connection pool features of
<span class="bold">
<strong>
Tomcat
</strong>
</span>
and other application
servers. The reuse is transparent to applications; the
application still opens and closes the connection as usual.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connection">
connection
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_j2ee">
J2EE
</a>
,
<a class="glossseealso" href="glossary.html#glos_tomcat">
Tomcat
</a>
.
</p>
</dd>
<dt>
<a name="glos_connection_string">
</a>
<span class="glossterm">
connection string
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033344960">
</a>
A representation of the parameters for a database
<span class="bold">
<strong>
connection
</strong>
</span>
, encoded as a string
literal so that it can be used in program code. The parts of the
string represent connection parameters such as
<span class="bold">
<strong>
host
</strong>
</span>
and
<span class="bold">
<strong>
port
</strong>
</span>
. A connection string
contains several key-value pairs, separated by semicolons. Each
key-value pair is joined with an equal sign. Frequently used
with
<span class="bold">
<strong>
Connector/NET
</strong>
</span>
applications; see
<a class="ulink" href="/doc/connector-net/en/connector-net-connections-string.html" target="_top">
Creating a Connector/NET Connection String
</a>
for details.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connection">
connection
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_host">
host
</a>
,
<a class="glossseealso" href="glossary.html#glos_port">
port
</a>
.
</p>
</dd>
<dt>
<a name="glos_connector">
</a>
<span class="glossterm">
connector
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033336832">
</a>
MySQL Connectors provide connectivity to the MySQL server for
<span class="bold">
<strong>
client
</strong>
</span>
programs. Several
programming languages and frameworks each have their own
associated Connector. Contrast with the lower-level access
provided by an
<span class="bold">
<strong>
API
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
,
<a class="glossseealso" href="glossary.html#glos_client">
client
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_c__">
Connector/C++
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_odbc">
Connector/ODBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_connector_c__">
</a>
<span class="glossterm">
Connector/C++
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033330048">
</a>
Connector/C++ 8.0 can be used to access MySQL servers that implement a
<a class="link" href="document-store.html" title="Chapter 22 Using MySQL as a Document Store">
document store
</a>
, or in a
traditional way using SQL queries. It enables development of C++
applications using X DevAPI, or plain C applications using
X DevAPI for C. It also enables development of C++ applications that
use the legacy JDBC-based API from Connector/C++ 1.1. For more
information, see
<a class="ulink" href="/doc/connector-cpp/9.1/en/" target="_top">
MySQL Connector/C++ 9.1 Developer Guide
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_client">
client
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector">
connector
</a>
,
<a class="glossseealso" href="glossary.html#glos_jdbc">
JDBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_connector_j">
</a>
<span class="glossterm">
Connector/J
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033324336">
</a>
A
<span class="bold">
<strong>
JDBC
</strong>
</span>
driver that provides
connectivity for
<span class="bold">
<strong>
client
</strong>
</span>
applications developed in the
<span class="bold">
<strong>
Java
</strong>
</span>
programming language.
MySQL Connector/J is a JDBC Type 4 driver: a pure-Java
implementation of the MySQL protocol that does not rely on the
MySQL
<span class="bold">
<strong>
client libraries
</strong>
</span>
. For
full details, see
<a class="ulink" href="/doc/connector-j/en/" target="_top">
MySQL Connector/J Developer Guide
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_client">
client
</a>
,
<a class="glossseealso" href="glossary.html#glos_client_libraries">
client libraries
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector">
connector
</a>
,
<a class="glossseealso" href="glossary.html#glos_java">
Java
</a>
,
<a class="glossseealso" href="glossary.html#glos_jdbc">
JDBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_connector_net">
</a>
<span class="glossterm">
Connector/NET
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033315872">
</a>
A MySQL
<span class="bold">
<strong>
connector
</strong>
</span>
for
developers writing applications using languages, technologies,
and frameworks such as
<span class="bold">
<strong>
C#
</strong>
</span>
,
<span class="bold">
<strong>
.NET
</strong>
</span>
,
<span class="bold">
<strong>
Mono
</strong>
</span>
,
<span class="bold">
<strong>
Visual Studio
</strong>
</span>
,
<span class="bold">
<strong>
ASP.net
</strong>
</span>
, and
<span class="bold">
<strong>
ADO.net
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ado_net">
ADO.NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_asp_net">
ASP.net
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector">
connector
</a>
,
<a class="glossseealso" href="glossary.html#glos_csharp">
C#
</a>
,
<a class="glossseealso" href="glossary.html#glos_mono">
Mono
</a>
,
<a class="glossseealso" href="glossary.html#glos_visual_studio">
Visual Studio
</a>
.
</p>
</dd>
<dt>
<a name="glos_connector_odbc">
</a>
<span class="glossterm">
Connector/ODBC
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033305616">
</a>
The family of MySQL ODBC drivers that provide access to a MySQL
database using the industry standard Open Database Connectivity
(
<span class="bold">
<strong>
ODBC
</strong>
</span>
) API. Formerly called
MyODBC drivers. For full details, see
<a class="ulink" href="/doc/connector-odbc/en/" target="_top">
MySQL Connector/ODBC Developer Guide
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector">
connector
</a>
,
<a class="glossseealso" href="glossary.html#glos_odbc">
ODBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_connector_php">
</a>
<span class="glossterm">
Connector/PHP
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033300880">
</a>
A version of the
<code class="literal">
mysql
</code>
and
<code class="literal">
mysqli
</code>
<span class="bold">
<strong>
APIs
</strong>
</span>
for
<span class="bold">
<strong>
PHP
</strong>
</span>
optimized for the
Windows operating system.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector">
connector
</a>
,
<a class="glossseealso" href="glossary.html#glos_php">
PHP
</a>
,
<a class="glossseealso" href="glossary.html#glos_php_api">
PHP API
</a>
.
</p>
</dd>
<dt>
<a name="glos_consistent_read">
</a>
<span class="glossterm">
consistent read
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033294448">
</a>
A read operation that uses
<span class="bold">
<strong>
snapshot
</strong>
</span>
information to present
query results based on a point in time, regardless of changes
performed by other transactions running at the same time. If
queried data has been changed by another transaction, the
original data is reconstructed based on the contents of the
<span class="bold">
<strong>
undo log
</strong>
</span>
. This technique avoids
some of the
<span class="bold">
<strong>
locking
</strong>
</span>
issues that
can reduce
<span class="bold">
<strong>
concurrency
</strong>
</span>
by
forcing transactions to wait for other transactions to finish.
</p>
<p>
With
<span class="bold">
<strong>
REPEATABLE READ
</strong>
</span>
<span class="bold">
<strong>
isolation level
</strong>
</span>
, the snapshot
is based on the time when the first read operation is performed.
With
<span class="bold">
<strong>
READ COMMITTED
</strong>
</span>
isolation
level, the snapshot is reset to the time of each consistent read
operation.
</p>
<p>
Consistent read is the default mode in which
<code class="literal">
InnoDB
</code>
processes
<code class="literal">
SELECT
</code>
statements in
<span class="bold">
<strong>
READ COMMITTED
</strong>
</span>
and
<span class="bold">
<strong>
REPEATABLE READ
</strong>
</span>
isolation
levels. Because a consistent read does not set any locks on the
tables it accesses, other sessions are free to modify those
tables while a consistent read is being performed on the table.
</p>
<p>
For technical details about the applicable isolation levels, see
<a class="xref" href="innodb-consistent-read.html" title="17.7.2.3 Consistent Nonlocking Reads">
Section 17.7.2.3, “Consistent Nonlocking Reads”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_committed">
READ COMMITTED
</a>
,
<a class="glossseealso" href="glossary.html#glos_repeatable_read">
REPEATABLE READ
</a>
,
<a class="glossseealso" href="glossary.html#glos_snapshot">
snapshot
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_constraint">
</a>
<span class="glossterm">
constraint
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033277328">
</a>
An automatic test that can block database changes to prevent
data from becoming inconsistent. (In computer science terms, a
kind of assertion related to an invariant condition.)
Constraints are a crucial component of the
<span class="bold">
<strong>
ACID
</strong>
</span>
philosophy, to maintain
data consistency. Constraints supported by MySQL include
<span class="bold">
<strong>
FOREIGN KEY constraints
</strong>
</span>
and
<span class="bold">
<strong>
unique constraints
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_foreign_key">
foreign key
</a>
,
<a class="glossseealso" href="glossary.html#glos_unique_constraint">
unique constraint
</a>
.
</p>
</dd>
<dt>
<a name="glos_counter">
</a>
<span class="glossterm">
counter
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033271248">
</a>
A value that is incremented by a particular kind of
<code class="literal">
InnoDB
</code>
operation. Useful for measuring how
busy a server is, troubleshooting the sources of performance
issues, and testing whether changes (for example, to
configuration settings or indexes used by queries) have the
desired low-level effects. Different kinds of counters are
available through
<span class="bold">
<strong>
Performance
Schema
</strong>
</span>
tables and
<span class="bold">
<strong>
INFORMATION_SCHEMA
</strong>
</span>
tables,
particularly
<code class="literal">
INFORMATION_SCHEMA.INNODB_METRICS
</code>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_information_schema">
INFORMATION_SCHEMA
</a>
,
<a class="glossseealso" href="glossary.html#glos_metrics_counter">
metrics counter
</a>
,
<a class="glossseealso" href="glossary.html#glos_performance_schema">
Performance Schema
</a>
.
</p>
</dd>
<dt>
<a name="glos_covering_index">
</a>
<span class="glossterm">
covering index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033264224">
</a>
An
<span class="bold">
<strong>
index
</strong>
</span>
that includes all the
columns retrieved by a query. Instead of using the index values
as pointers to find the full table rows, the query returns
values from the index structure, saving disk I/O.
<code class="literal">
InnoDB
</code>
can apply this optimization technique
to more indexes than MyISAM can, because
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
secondary
indexes
</strong>
</span>
also include the
<span class="bold">
<strong>
primary key
</strong>
</span>
columns.
<code class="literal">
InnoDB
</code>
cannot apply this technique for
queries against tables modified by a transaction, until that
transaction ends.
</p>
<p>
Any
<span class="bold">
<strong>
column index
</strong>
</span>
or
<span class="bold">
<strong>
composite index
</strong>
</span>
could act as a
covering index, given the right query. Design your indexes and
queries to take advantage of this optimization technique
wherever possible.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_column_index">
column index
</a>
,
<a class="glossseealso" href="glossary.html#glos_composite_index">
composite index
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
,
<a class="glossseealso" href="glossary.html#glos_secondary_index">
secondary index
</a>
.
</p>
</dd>
<dt>
<a name="glos_cpu_bound">
</a>
<span class="glossterm">
CPU-bound
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033252704">
</a>
A type of
<span class="bold">
<strong>
workload
</strong>
</span>
where the
primary
<span class="bold">
<strong>
bottleneck
</strong>
</span>
is CPU
operations in memory. Typically involves read-intensive
operations where the results can all be cached in the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_bottleneck">
bottleneck
</a>
,
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_workload">
workload
</a>
.
</p>
</dd>
<dt>
<a name="glos_crash">
</a>
<span class="glossterm">
crash
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033246784">
</a>
MySQL uses the term
<span class="quote">
“
<span class="quote">
crash
</span>
”
</span>
to refer generally to
any unexpected
<span class="bold">
<strong>
shutdown
</strong>
</span>
operation where the server cannot do its normal cleanup. For
example, a crash could happen due to a hardware fault on the
database server machine or storage device; a power failure; a
potential data mismatch that causes the MySQL server to halt; a
<span class="bold">
<strong>
fast shutdown
</strong>
</span>
initiated by the
DBA; or many other reasons. The robust, automatic
<span class="bold">
<strong>
crash recovery
</strong>
</span>
for
<span class="bold">
<strong>
InnoDB
</strong>
</span>
tables ensures that data
is made consistent when the server is restarted, without any
extra work for the DBA.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_crash_recovery">
crash recovery
</a>
,
<a class="glossseealso" href="glossary.html#glos_fast_shutdown">
fast shutdown
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_shutdown">
shutdown
</a>
.
</p>
</dd>
<dt>
<a name="glos_crash_recovery">
</a>
<span class="glossterm">
crash recovery
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033238896">
</a>
The cleanup activities that occur when MySQL is started again
after a
<span class="bold">
<strong>
crash
</strong>
</span>
. For
<span class="bold">
<strong>
InnoDB
</strong>
</span>
tables, changes from
incomplete transactions are replayed using data from the
<span class="bold">
<strong>
redo log
</strong>
</span>
. Changes that were
<span class="bold">
<strong>
committed
</strong>
</span>
before the crash, but
not yet written into the
<span class="bold">
<strong>
data
files
</strong>
</span>
, are reconstructed from the
<span class="bold">
<strong>
doublewrite buffer
</strong>
</span>
. When the
database is shut down normally, this type of activity is
performed during shutdown by the
<span class="bold">
<strong>
purge
</strong>
</span>
operation.
</p>
<p>
During normal operation, committed data can be stored in the
<span class="bold">
<strong>
change buffer
</strong>
</span>
for a period of
time before being written to the data files. There is always a
tradeoff between keeping the data files up-to-date, which
introduces performance overhead during normal operation, and
buffering the data, which can make shutdown and crash recovery
take longer.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_change_buffer">
change buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_crash">
crash
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_doublewrite_buffer">
doublewrite buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge">
purge
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_crud">
</a>
<span class="glossterm">
CRUD
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033225856">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
create, read, update, delete
</span>
”
</span>
, a
common sequence of operations in database applications. Often
denotes a class of applications with relatively simple database
usage (basic
<span class="bold">
<strong>
DDL
</strong>
</span>
,
<span class="bold">
<strong>
DML
</strong>
</span>
and
<span class="bold">
<strong>
query
</strong>
</span>
statements in
<span class="bold">
<strong>
SQL
</strong>
</span>
) that can be implemented
quickly in any language.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
.
</p>
</dd>
<dt>
<a name="glos_cursor">
</a>
<span class="glossterm">
cursor
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033218176">
</a>
An internal MySQL data structure that represents the result set
of an SQL statement. Often used with
<span class="bold">
<strong>
prepared statements
</strong>
</span>
and
<span class="bold">
<strong>
dynamic SQL
</strong>
</span>
. It works like an
iterator in other high-level languages, producing each value
from the result set as requested.
</p>
<p>
Although SQL usually handles the processing of cursors for you,
you might delve into the inner workings when dealing with
performance-critical code.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_dynamic_sql">
dynamic SQL
</a>
,
<a class="glossseealso" href="glossary.html#glos_prepared_statement">
prepared statement
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
D
</h3>
<dl>
<dt>
<a name="glos_data_definition_language">
</a>
<span class="glossterm">
data definition language
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_ddl">
DDL
</a>
.
</p>
</dd>
<dt>
<a name="glos_data_dictionary">
</a>
<span class="glossterm">
data dictionary
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033210096">
</a>
Metadata that keeps track of database objects such as
<span class="bold">
<strong>
tables
</strong>
</span>
,
<span class="bold">
<strong>
indexes
</strong>
</span>
, and table
<span class="bold">
<strong>
columns
</strong>
</span>
. For the MySQL data
dictionary, introduced in MySQL 8.0, metadata is physically
located in
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
file-per-table
</strong>
</span>
tablespace files
in the
<code class="literal">
mysql
</code>
database directory. For the
<code class="literal">
InnoDB
</code>
data dictionary, metadata is
physically located in the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
system tablespace
</strong>
</span>
.
</p>
<p>
Because the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product always backs up the
<code class="literal">
InnoDB
</code>
system tablespace, all backups include
the contents of the
<code class="literal">
InnoDB
</code>
data dictionary.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_column">
column
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_frm_file">
.frm file
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_data_directory">
</a>
<span class="glossterm">
data directory
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033194992">
</a>
The directory under which each MySQL
<span class="bold">
<strong>
instance
</strong>
</span>
keeps the
<span class="bold">
<strong>
data files
</strong>
</span>
for
<code class="literal">
InnoDB
</code>
and the directories representing
individual databases. Controlled by the
<a class="link" href="server-system-variables.html#sysvar_datadir">
<code class="literal">
datadir
</code>
</a>
configuration option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_instance">
instance
</a>
.
</p>
</dd>
<dt>
<a name="glos_data_files">
</a>
<span class="glossterm">
data files
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033188368">
</a>
The files that physically contain
<span class="bold">
<strong>
table
</strong>
</span>
and
<span class="bold">
<strong>
index
</strong>
</span>
data.
</p>
<p>
The
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
system
tablespace
</strong>
</span>
, which holds the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
data dictionary
</strong>
</span>
and is capable
of holding data for multiple
<code class="literal">
InnoDB
</code>
tables,
is represented by one or more
<code class="filename">
.ibdata
</code>
data
files.
</p>
<p>
File-per-table tablespaces, which hold data for a single
<code class="literal">
InnoDB
</code>
table, are represented by a
<code class="filename">
.ibd
</code>
data file.
</p>
<p>
General tablespaces (introduced in MySQL 5.7.6), which can hold
data for multiple
<code class="literal">
InnoDB
</code>
tables, are also
represented by a
<code class="literal">
.ibd
</code>
data file.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_data_dictionary">
data dictionary
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_general_tablespace">
general tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibdata_file">
ibdata file
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_data_manipulation_language">
</a>
<span class="glossterm">
data manipulation language
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_dml">
DML
</a>
.
</p>
</dd>
<dt>
<a name="glos_data_warehouse">
</a>
<span class="glossterm">
data warehouse
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033170144">
</a>
A database system or application that primarily runs large
<span class="bold">
<strong>
queries
</strong>
</span>
. The read-only or
read-mostly data might be organized in
<span class="bold">
<strong>
denormalized
</strong>
</span>
form for query
efficiency. Can benefit from the optimizations for
<span class="bold">
<strong>
read-only transactions
</strong>
</span>
in MySQL
5.6 and higher. Contrast with
<span class="bold">
<strong>
OLTP
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_denormalized">
denormalized
</a>
,
<a class="glossseealso" href="glossary.html#glos_oltp">
OLTP
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_only_transaction">
read-only transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_database">
</a>
<span class="glossterm">
database
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033162704">
</a>
Within the MySQL
<span class="bold">
<strong>
data
directory
</strong>
</span>
, each database is represented by a separate
directory. The InnoDB
<span class="bold">
<strong>
system
tablespace
</strong>
</span>
, which can hold table data from multiple
databases within a MySQL
<span class="bold">
<strong>
instance
</strong>
</span>
, is kept in
<span class="bold">
<strong>
data files
</strong>
</span>
that reside outside
of individual database directories. When
<span class="bold">
<strong>
file-per-table
</strong>
</span>
mode is enabled,
the
<span class="bold">
<strong>
.ibd files
</strong>
</span>
representing
individual InnoDB tables are stored inside the database
directories unless created elsewhere using the
<code class="literal">
DATA
DIRECTORY
</code>
clause. General tablespaces, introduced in
MySQL 5.7.6, also hold table data in
<span class="bold">
<strong>
.ibd
files
</strong>
</span>
. Unlike file-per-table
<span class="bold">
<strong>
.ibd files
</strong>
</span>
, general tablespace
<span class="bold">
<strong>
.ibd files
</strong>
</span>
can hold table data
from multiple databases within a MySQL
<span class="bold">
<strong>
instance
</strong>
</span>
, and can be assigned
to directories relative to or independent of the MySQL data
directory.
</p>
<p>
For long-time MySQL users, a database is a familiar notion.
Users coming from an Oracle Database background may find that
the MySQL meaning of a database is closer to what Oracle
Database calls a
<span class="bold">
<strong>
schema
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_instance">
instance
</a>
,
<a class="glossseealso" href="glossary.html#glos_schema">
schema
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_dcl">
</a>
<span class="glossterm">
DCL
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033147504">
</a>
Data control language, a set of
<span class="bold">
<strong>
SQL
</strong>
</span>
statements for managing
privileges. In MySQL, consists of the
<a class="link" href="grant.html" title="15.7.1.6 GRANT Statement">
<code class="literal">
GRANT
</code>
</a>
and
<a class="link" href="revoke.html" title="15.7.1.8 REVOKE Statement">
<code class="literal">
REVOKE
</code>
</a>
statements. Contrast with
<span class="bold">
<strong>
DDL
</strong>
</span>
and
<span class="bold">
<strong>
DML
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
.
</p>
</dd>
<dt>
<a name="glos_ddex_provider">
</a>
<span class="glossterm">
DDEX provider
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033139328">
</a>
A feature that lets you use the data design tools within
<span class="bold">
<strong>
Visual Studio
</strong>
</span>
to manipulate the
schema and objects within a MySQL database. For MySQL
applications using
<span class="bold">
<strong>
Connector/NET
</strong>
</span>
, the
MySQL Visual Studio Plugin acts as a DDEX provider with MySQL
5.0 and later.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_visual_studio">
Visual Studio
</a>
.
</p>
</dd>
<dt>
<a name="glos_ddl">
</a>
<span class="glossterm">
DDL
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033135104">
</a>
Data definition language, a set of
<span class="bold">
<strong>
SQL
</strong>
</span>
statements for manipulating
the database itself rather than individual table rows. Includes
all forms of the
<code class="literal">
CREATE
</code>
,
<code class="literal">
ALTER
</code>
, and
<code class="literal">
DROP
</code>
statements. Also includes the
<code class="literal">
TRUNCATE
</code>
statement, because it works differently than a
<code class="literal">
DELETE
FROM
<em class="replaceable">
<code>
table_name
</code>
</em>
</code>
statement,
even though the ultimate effect is similar.
</p>
<p>
DDL statements automatically
<span class="bold">
<strong>
commit
</strong>
</span>
the current
<span class="bold">
<strong>
transaction
</strong>
</span>
; they cannot be
<span class="bold">
<strong>
rolled back
</strong>
</span>
.
</p>
<p>
The
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_online_ddl" title="online DDL">
online DDL
</a>
feature
enhances performance for
<a class="link" href="create-index.html" title="15.1.15 CREATE INDEX Statement">
<code class="literal">
CREATE
INDEX
</code>
</a>
,
<a class="link" href="drop-index.html" title="15.1.27 DROP INDEX Statement">
<code class="literal">
DROP INDEX
</code>
</a>
, and
many types of
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
operations. See
<a class="xref" href="innodb-online-ddl.html" title="17.12 InnoDB and Online DDL">
Section 17.12, “InnoDB and Online DDL”
</a>
for more
information. Also, the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_file_per_table" title="file-per-table">
file-per-table
</a>
setting can affect the behavior of
<a class="link" href="drop-table.html" title="15.1.32 DROP TABLE Statement">
<code class="literal">
DROP
TABLE
</code>
</a>
and
<a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
<code class="literal">
TRUNCATE
TABLE
</code>
</a>
operations.
</p>
<p>
Contrast with
<span class="bold">
<strong>
DML
</strong>
</span>
and
<span class="bold">
<strong>
DCL
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_dcl">
DCL
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_deadlock">
</a>
<span class="glossterm">
deadlock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033109872">
</a>
A situation where different
<span class="bold">
<strong>
transactions
</strong>
</span>
are unable to
proceed, because each holds a
<span class="bold">
<strong>
lock
</strong>
</span>
that the other needs.
Because both transactions are waiting for a resource to become
available, neither one ever releases the locks it holds.
</p>
<p>
A deadlock can occur when the transactions lock rows in multiple
tables (through statements such as
<code class="literal">
UPDATE
</code>
or
<code class="literal">
SELECT ... FOR UPDATE
</code>
), but in the opposite
order. A deadlock can also occur when such statements lock
ranges of index records and
<span class="bold">
<strong>
gaps
</strong>
</span>
, with each transaction
acquiring some locks but not others due to a timing issue.
</p>
<p>
For background information on how deadlocks are automatically
detected and handled, see
<a class="xref" href="innodb-deadlock-detection.html" title="17.7.5.2 Deadlock Detection">
Section 17.7.5.2, “Deadlock Detection”
</a>
. For tips on
avoiding and recovering from deadlock conditions, see
<a class="xref" href="innodb-deadlocks-handling.html" title="17.7.5.3 How to Minimize and Handle Deadlocks">
Section 17.7.5.3, “How to Minimize and Handle Deadlocks”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_gap">
gap
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_deadlock_detection">
</a>
<span class="glossterm">
deadlock detection
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033099632">
</a>
A mechanism that automatically detects when a
<span class="bold">
<strong>
deadlock
</strong>
</span>
occurs, and
automatically
<span class="bold">
<strong>
rolls back
</strong>
</span>
one of
the
<span class="bold">
<strong>
transactions
</strong>
</span>
involved (the
<span class="bold">
<strong>
victim
</strong>
</span>
). Deadlock detection can
be disabled using the
<a class="link" href="innodb-parameters.html#sysvar_innodb_deadlock_detect">
<code class="literal">
innodb_deadlock_detect
</code>
</a>
configuration option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_deadlock">
deadlock
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_victim">
victim
</a>
.
</p>
</dd>
<dt>
<a name="glos_delete">
</a>
<span class="glossterm">
delete
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033091136">
</a>
When
<code class="literal">
InnoDB
</code>
processes a
<code class="literal">
DELETE
</code>
statement, the rows are immediately
marked for deletion and no longer are returned by queries. The
storage is reclaimed sometime later, during the periodic garbage
collection known as the
<span class="bold">
<strong>
purge
</strong>
</span>
operation. For removing large quantities of data, related
operations with their own performance characteristics are
<span class="bold">
<strong>
TRUNCATE
</strong>
</span>
and
<span class="bold">
<strong>
DROP
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_drop">
drop
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge">
purge
</a>
,
<a class="glossseealso" href="glossary.html#glos_truncate">
truncate
</a>
.
</p>
</dd>
<dt>
<a name="glos_delete_buffering">
</a>
<span class="glossterm">
delete buffering
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033083536">
</a>
The technique of storing changes to secondary index pages,
resulting from
<code class="literal">
DELETE
</code>
operations, in the
<span class="bold">
<strong>
change buffer
</strong>
</span>
rather than
writing the changes immediately, so that the physical writes can
be performed to minimize random I/O. (Because delete operations
are a two-step process, this operation buffers the write that
normally marks an index record for deletion.) It is one of the
types of
<span class="bold">
<strong>
change buffering
</strong>
</span>
; the
others are
<span class="bold">
<strong>
insert buffering
</strong>
</span>
and
<span class="bold">
<strong>
purge buffering
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_change_buffer">
change buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_change_buffering">
change buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_insert_buffer">
insert buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_insert_buffering">
insert buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge_buffering">
purge buffering
</a>
.
</p>
</dd>
<dt>
<a name="glos_denormalized">
</a>
<span class="glossterm">
denormalized
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033074944">
</a>
A data storage strategy that duplicates data across different
tables, rather than linking the tables with
<span class="bold">
<strong>
foreign keys
</strong>
</span>
and
<span class="bold">
<strong>
join
</strong>
</span>
queries. Typically used in
<span class="bold">
<strong>
data warehouse
</strong>
</span>
applications,
where the data is not updated after loading. In such
applications, query performance is more important than making it
simple to maintain consistent data during updates. Contrast with
<span class="bold">
<strong>
normalized
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_data_warehouse">
data warehouse
</a>
,
<a class="glossseealso" href="glossary.html#glos_foreign_key">
foreign key
</a>
,
<a class="glossseealso" href="glossary.html#glos_join">
join
</a>
,
<a class="glossseealso" href="glossary.html#glos_normalized">
normalized
</a>
.
</p>
</dd>
<dt>
<a name="glos_descending_index">
</a>
<span class="glossterm">
descending index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033067376">
</a>
A type of
<span class="bold">
<strong>
index
</strong>
</span>
where index
storage is optimized to process
<code class="literal">
ORDER BY
<em class="replaceable">
<code>
column
</code>
</em>
DESC
</code>
clauses.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
.
</p>
</dd>
<dt>
<a name="glos_dictionary_object_cache">
</a>
<span class="glossterm">
dictionary object cache
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033062784">
</a>
The dictionary object cache stores previously accessed
<span class="bold">
<strong>
data dictionary
</strong>
</span>
objects in
memory to enable object reuse and minimize disk I/O. An
<span class="bold">
<strong>
LRU
</strong>
</span>
-based eviction strategy is
used to evict least recently used objects from memory. The cache
is comprised of several partitions that store different object
types.
</p>
<p>
For more information, see
<a class="xref" href="data-dictionary-object-cache.html" title="16.4 Dictionary Object Cache">
Section 16.4, “Dictionary Object Cache”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_data_dictionary">
data dictionary
</a>
,
<a class="glossseealso" href="glossary.html#glos_lru">
LRU
</a>
.
</p>
</dd>
<dt>
<a name="glos_dirty_page">
</a>
<span class="glossterm">
dirty page
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033056864">
</a>
A
<span class="bold">
<strong>
page
</strong>
</span>
in the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
buffer
pool
</strong>
</span>
that has been updated in memory, where the
changes are not yet written
(
<span class="bold">
<strong>
flushed
</strong>
</span>
) to the
<span class="bold">
<strong>
data files
</strong>
</span>
. The opposite of a
<span class="bold">
<strong>
clean page
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_clean_page">
clean page
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
.
</p>
</dd>
<dt>
<a name="glos_dirty_read">
</a>
<span class="glossterm">
dirty read
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033047776">
</a>
An operation that retrieves unreliable data, data that was
updated by another transaction but not yet
<span class="bold">
<strong>
committed
</strong>
</span>
. It is only possible
with the
<span class="bold">
<strong>
isolation level
</strong>
</span>
known
as
<span class="bold">
<strong>
read uncommitted
</strong>
</span>
.
</p>
<p>
This kind of operation does not adhere to the
<span class="bold">
<strong>
ACID
</strong>
</span>
principle of database
design. It is considered very risky, because the data could be
<span class="bold">
<strong>
rolled back
</strong>
</span>
, or updated further
before being committed; then, the transaction doing the dirty
read would be using data that was never confirmed as accurate.
</p>
<p>
Its opposite is
<span class="bold">
<strong>
consistent
read
</strong>
</span>
, where
<code class="literal">
InnoDB
</code>
ensures that a
transaction does not read information updated by another
transaction, even if the other transaction commits in the
meantime.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_consistent_read">
consistent read
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_uncommitted">
READ UNCOMMITTED
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
.
</p>
</dd>
<dt>
<a name="glos_disk_based">
</a>
<span class="glossterm">
disk-based
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033036000">
</a>
A kind of database that primarily organizes data on disk storage
(hard drives or equivalent). Data is brought back and forth
between disk and memory to be operated upon. It is the opposite
of an
<span class="bold">
<strong>
in-memory database
</strong>
</span>
.
Although
<code class="literal">
InnoDB
</code>
is disk-based, it also
contains features such as he
<span class="bold">
<strong>
buffer
pool
</strong>
</span>
, multiple buffer pool instances, and the
<span class="bold">
<strong>
adaptive hash index
</strong>
</span>
that allow
certain kinds of workloads to work primarily from memory.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_adaptive_hash_index">
adaptive hash index
</a>
,
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_in_memory_database">
in-memory database
</a>
.
</p>
</dd>
<dt>
<a name="glos_disk_bound">
</a>
<span class="glossterm">
disk-bound
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033029008">
</a>
A type of
<span class="bold">
<strong>
workload
</strong>
</span>
where the
primary
<span class="bold">
<strong>
bottleneck
</strong>
</span>
is disk I/O.
(Also known as
<span class="bold">
<strong>
I/O-bound
</strong>
</span>
.)
Typically involves frequent writes to disk, or random reads of
more data than can fit into the
<span class="bold">
<strong>
buffer
pool
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_bottleneck">
bottleneck
</a>
,
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_workload">
workload
</a>
.
</p>
</dd>
<dt>
<a name="glos_dml">
</a>
<span class="glossterm">
DML
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033022384">
</a>
Data manipulation language, a set of
<span class="bold">
<strong>
SQL
</strong>
</span>
statements for performing
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
,
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
, and
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
operations. The
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statement is sometimes
considered as a DML statement, because the
<code class="literal">
SELECT ...
FOR UPDATE
</code>
form is subject to the same considerations
for
<span class="bold">
<strong>
locking
</strong>
</span>
as
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
,
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
, and
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
.
</p>
<p>
DML statements for an
<code class="literal">
InnoDB
</code>
table operate in
the context of a
<span class="bold">
<strong>
transaction
</strong>
</span>
,
so their effects can be
<span class="bold">
<strong>
committed
</strong>
</span>
or
<span class="bold">
<strong>
rolled back
</strong>
</span>
as a single unit.
</p>
<p>
Contrast with
<span class="bold">
<strong>
DDL
</strong>
</span>
and
<span class="bold">
<strong>
DCL
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_dcl">
DCL
</a>
,
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_document_id">
</a>
<span class="glossterm">
document id
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045033000608">
</a>
In the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
full-text
search
</strong>
</span>
feature, a special column in the table
containing the
<span class="bold">
<strong>
FULLTEXT index
</strong>
</span>
,
to uniquely identify the document associated with each
<span class="bold">
<strong>
ilist
</strong>
</span>
value. Its name is
<code class="literal">
FTS_DOC_ID
</code>
(uppercase required). The column
itself must be of
<code class="literal">
BIGINT UNSIGNED NOT NULL
</code>
type, with a unique index named
<code class="literal">
FTS_DOC_ID_INDEX
</code>
. Preferably, you define this
column when creating the table. If
<code class="literal">
InnoDB
</code>
must add the column to the table while creating a
<code class="literal">
FULLTEXT
</code>
index, the indexing operation is
considerably more expensive.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_full_text_search">
full-text search
</a>
,
<a class="glossseealso" href="glossary.html#glos_fulltext_index">
FULLTEXT index
</a>
,
<a class="glossseealso" href="glossary.html#glos_ilist">
ilist
</a>
.
</p>
</dd>
<dt>
<a name="glos_doublewrite_buffer">
</a>
<span class="glossterm">
doublewrite buffer
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032990080">
</a>
<code class="literal">
InnoDB
</code>
uses a file flush technique called
doublewrite. Before writing
<span class="bold">
<strong>
pages
</strong>
</span>
to the
<span class="bold">
<strong>
data files
</strong>
</span>
,
<code class="literal">
InnoDB
</code>
first writes them to a storage area
called the doublewrite buffer. Only after the write and the
flush to the doublewrite buffer have completed, does
<code class="literal">
InnoDB
</code>
write the pages to their proper
positions in the data file. If there is an operating system,
storage subsystem or
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
process crash in
the middle of a page write,
<code class="literal">
InnoDB
</code>
can find a
good copy of the page from the doublewrite buffer during
<span class="bold">
<strong>
crash recovery
</strong>
</span>
.
</p>
<p>
Although data is always written twice, the doublewrite buffer
does not require twice as much I/O overhead or twice as many I/O
operations. Data is written to the buffer itself as a large
sequential chunk, with a single
<code class="literal">
fsync()
</code>
call
to the operating system.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_crash_recovery">
crash recovery
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge">
purge
</a>
.
</p>
</dd>
<dt>
<a name="glos_drop">
</a>
<span class="glossterm">
drop
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032977936">
</a>
A kind of
<span class="bold">
<strong>
DDL
</strong>
</span>
operation that
removes a schema object, through a statement such as
<a class="link" href="drop-table.html" title="15.1.32 DROP TABLE Statement">
<code class="literal">
DROP TABLE
</code>
</a>
or
<a class="link" href="drop-index.html" title="15.1.27 DROP INDEX Statement">
<code class="literal">
DROP INDEX
</code>
</a>
. It maps internally to
an
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
statement. From an
<code class="literal">
InnoDB
</code>
perspective, the performance
considerations of such operations involve the time that the
<span class="bold">
<strong>
data dictionary
</strong>
</span>
is locked to
ensure that interrelated objects are all updated, and the time
to update memory structures such as the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
. For a
<span class="bold">
<strong>
table
</strong>
</span>
, the drop operation has
somewhat different characteristics than a
<span class="bold">
<strong>
truncate
</strong>
</span>
operation
(
<a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
<code class="literal">
TRUNCATE TABLE
</code>
</a>
statement).
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_dictionary">
data dictionary
</a>
,
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
,
<a class="glossseealso" href="glossary.html#glos_truncate">
truncate
</a>
.
</p>
</dd>
<dt>
<a name="glos_dsn">
</a>
<span class="glossterm">
DSN
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032963696">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
Database Source Name
</span>
”
</span>
. It is the
encoding for
<span class="bold">
<strong>
connection
</strong>
</span>
information within
<span class="bold">
<strong>
Connector/ODBC
</strong>
</span>
. See
<a class="ulink" href="/doc/connector-odbc/en/connector-odbc-configuration-dsn-windows.html" target="_top">
Configuring a Connector/ODBC DSN on Windows
</a>
for
full details. It is the equivalent of the
<span class="bold">
<strong>
connection string
</strong>
</span>
used by
<span class="bold">
<strong>
Connector/NET
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connection">
connection
</a>
,
<a class="glossseealso" href="glossary.html#glos_connection_string">
connection string
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_odbc">
Connector/ODBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_dynamic_cursor">
</a>
<span class="glossterm">
dynamic cursor
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032955344">
</a>
A type of
<span class="bold">
<strong>
cursor
</strong>
</span>
supported by
<span class="bold">
<strong>
ODBC
</strong>
</span>
that can pick up new and
changed results when the rows are read again. Whether and how
quickly the changes are visible to the cursor depends on the
type of table involved (transactional or non-transactional) and
the isolation level for transactional tables. Support for
dynamic cursors must be explicitly enabled.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cursor">
cursor
</a>
,
<a class="glossseealso" href="glossary.html#glos_odbc">
ODBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_dynamic_row_format">
</a>
<span class="glossterm">
dynamic row format
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032950512">
</a>
An
<code class="literal">
InnoDB
</code>
row format. Because long
variable-length column values are stored outside of the page
that holds the row data, it is very efficient for rows that
include large objects. Since the large fields are typically not
accessed to evaluate query conditions, they are not brought into
the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
as often,
resulting in fewer I/O operations and better utilization of
cache memory.
</p>
<p>
As of MySQL 5.7.9, the default row format is defined by
<a class="link" href="innodb-parameters.html#sysvar_innodb_default_row_format">
<code class="literal">
innodb_default_row_format
</code>
</a>
,
which has a default value of
<code class="literal">
DYNAMIC
</code>
.
</p>
<p>
For additional information about
<code class="literal">
InnoDB
</code>
<code class="literal">
DYNAMIC
</code>
row format, see
<a class="xref" href="innodb-row-format.html#innodb-row-format-dynamic" title="DYNAMIC Row Format">
DYNAMIC Row Format
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_format">
file format
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_format">
row format
</a>
.
</p>
</dd>
<dt>
<a name="glos_dynamic_sql">
</a>
<span class="glossterm">
dynamic SQL
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032939984">
</a>
A feature that lets you create and execute
<span class="bold">
<strong>
prepared statements
</strong>
</span>
using more
robust, secure, and efficient methods to substitute parameter
values than the naive technique of concatenating the parts of
the statement into a string variable.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_prepared_statement">
prepared statement
</a>
.
</p>
</dd>
<dt>
<a name="glos_dynamic_statement">
</a>
<span class="glossterm">
dynamic statement
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032936448">
</a>
A
<span class="bold">
<strong>
prepared statement
</strong>
</span>
created
and executed through
<span class="bold">
<strong>
dynamic
SQL
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_dynamic_sql">
dynamic SQL
</a>
,
<a class="glossseealso" href="glossary.html#glos_prepared_statement">
prepared statement
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
E
</h3>
<dl>
<dt>
<a name="glos_early_adopter">
</a>
<span class="glossterm">
early adopter
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032931312">
</a>
A stage similar to
<span class="bold">
<strong>
beta
</strong>
</span>
, when a
software product is typically evaluated for performance,
functionality, and compatibility in a non-mission-critical
setting.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_beta">
beta
</a>
.
</p>
</dd>
<dt>
<a name="glos_eiffel">
</a>
<span class="glossterm">
Eiffel
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032927792">
</a>
A programming language including many object-oriented features.
Some of its concepts are familiar to
<span class="bold">
<strong>
Java
</strong>
</span>
and
<span class="bold">
<strong>
C#
</strong>
</span>
developers. For the
open-source Eiffel
<span class="bold">
<strong>
API
</strong>
</span>
for
MySQL, see
<a class="xref" href="apis-eiffel.html" title="31.13 MySQL Eiffel Wrapper">
Section 31.13, “MySQL Eiffel Wrapper”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
,
<a class="glossseealso" href="glossary.html#glos_csharp">
C#
</a>
,
<a class="glossseealso" href="glossary.html#glos_java">
Java
</a>
.
</p>
</dd>
<dt>
<a name="glos_embedded">
</a>
<span class="glossterm">
embedded
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032921264">
</a>
The embedded MySQL server library
(
<span class="bold">
<strong>
libmysqld
</strong>
</span>
) makes it possible
to run a full-featured MySQL server inside a
<span class="bold">
<strong>
client
</strong>
</span>
application. The main
benefits are increased speed and more simple management for
embedded applications.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_client">
client
</a>
,
<a class="glossseealso" href="glossary.html#glos_libmysqld">
libmysqld
</a>
.
</p>
</dd>
<dt>
<a name="glos_error_log">
</a>
<span class="glossterm">
error log
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032916464">
</a>
A type of
<span class="bold">
<strong>
log
</strong>
</span>
showing
information about MySQL startup and critical runtime errors and
<span class="bold">
<strong>
crash
</strong>
</span>
information. For details,
see
<a class="xref" href="error-log.html" title="7.4.2 The Error Log">
Section 7.4.2, “The Error Log”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_crash">
crash
</a>
,
<a class="glossseealso" href="glossary.html#glos_log">
log
</a>
.
</p>
</dd>
<dt>
<a name="glos_eviction">
</a>
<span class="glossterm">
eviction
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032911072">
</a>
The process of removing an item from a cache or other temporary
storage area, such as the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
buffer pool
</strong>
</span>
. Often, but not
always, uses the
<span class="bold">
<strong>
LRU
</strong>
</span>
algorithm
to determine which item to remove. When a
<span class="bold">
<strong>
dirty page
</strong>
</span>
is evicted, its
contents are
<span class="bold">
<strong>
flushed
</strong>
</span>
to disk,
and any dirty
<span class="bold">
<strong>
neighbor pages
</strong>
</span>
might be flushed also.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_dirty_page">
dirty page
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_lru">
LRU
</a>
,
<a class="glossseealso" href="glossary.html#glos_neighbor_page">
neighbor page
</a>
.
</p>
</dd>
<dt>
<a name="glos_exception_interceptor">
</a>
<span class="glossterm">
exception interceptor
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032901936">
</a>
A type of
<span class="bold">
<strong>
interceptor
</strong>
</span>
for
tracing, debugging, or augmenting SQL errors encountered by a
database application. For example, the interceptor code could
issue a
<code class="literal">
SHOW WARNINGS
</code>
statement to retrieve
additional information, and add descriptive text or even change
the type of the exception returned to the application. Because
the interceptor code is only called when SQL statements return
errors, it does not impose any performance penalty on the
application during normal (error-free) operation.
</p>
<p>
In
<span class="bold">
<strong>
Java
</strong>
</span>
applications using
<span class="bold">
<strong>
Connector/J
</strong>
</span>
, setting up this
type of interceptor involves implementing the
<code class="literal">
com.mysql.jdbc.ExceptionInterceptor
</code>
interface, and adding a
<code class="literal">
exceptionInterceptors
</code>
property to the
<span class="bold">
<strong>
connection
string
</strong>
</span>
.
</p>
<p>
In
<span class="bold">
<strong>
Visual Studio
</strong>
</span>
applications
using
<span class="bold">
<strong>
Connector/NET
</strong>
</span>
, setting up this
type of interceptor involves defining a class that inherits from
the
<code class="literal">
BaseExceptionInterceptor
</code>
class and
specifying that class name as part of the connection string.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_interceptor">
interceptor
</a>
,
<a class="glossseealso" href="glossary.html#glos_java">
Java
</a>
,
<a class="glossseealso" href="glossary.html#glos_visual_studio">
Visual Studio
</a>
.
</p>
</dd>
<dt>
<a name="glos_exclusive_lock">
</a>
<span class="glossterm">
exclusive lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032888496">
</a>
A kind of
<span class="bold">
<strong>
lock
</strong>
</span>
that prevents
any other
<span class="bold">
<strong>
transaction
</strong>
</span>
from
locking the same row. Depending on the transaction
<span class="bold">
<strong>
isolation level
</strong>
</span>
, this kind of
lock might block other transactions from writing to the same
row, or might also block other transactions from reading the
same row. The default
<code class="literal">
InnoDB
</code>
isolation level,
<span class="bold">
<strong>
REPEATABLE READ
</strong>
</span>
, enables higher
<span class="bold">
<strong>
concurrency
</strong>
</span>
by allowing
transactions to read rows that have exclusive locks, a technique
known as
<span class="bold">
<strong>
consistent read
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_consistent_read">
consistent read
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_repeatable_read">
REPEATABLE READ
</a>
,
<a class="glossseealso" href="glossary.html#glos_shared_lock">
shared lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_extent">
</a>
<span class="glossterm">
extent
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032877504">
</a>
A group of
<span class="bold">
<strong>
pages
</strong>
</span>
within a
<span class="bold">
<strong>
tablespace
</strong>
</span>
. For the default
<span class="bold">
<strong>
page size
</strong>
</span>
of 16KB, an extent
contains 64 pages. In MySQL 5.6, the page size for an
<code class="literal">
InnoDB
</code>
instance can be 4KB, 8KB, or 16KB,
controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_page_size">
<code class="literal">
innodb_page_size
</code>
</a>
configuration
option. For 4KB, 8KB, and 16KB pages sizes, the extent size is
always 1MB (or 1048576 bytes).
</p>
<p>
Support for 32KB and 64KB
<code class="literal">
InnoDB
</code>
page sizes
was added in MySQL 5.7.6. For a 32KB page size, the extent size
is 2MB. For a 64KB page size, the extent size is 4MB.
</p>
<p>
<code class="literal">
InnoDB
</code>
features such as
<span class="bold">
<strong>
segments
</strong>
</span>
,
<span class="bold">
<strong>
read-ahead
</strong>
</span>
requests and the
<span class="bold">
<strong>
doublewrite buffer
</strong>
</span>
use I/O
operations that read, write, allocate, or free data one extent
at a time.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_doublewrite_buffer">
doublewrite buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_page_size">
page size
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_ahead">
read-ahead
</a>
,
<a class="glossseealso" href="glossary.html#glos_segment">
segment
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
F
</h3>
<dl>
<dt>
<a name="glos_frm_file">
</a>
<span class="glossterm">
.frm file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032747136">
</a>
A file containing the metadata, such as the table definition, of
a MySQL table.
<code class="filename">
.frm
</code>
files were removed in
MySQL 8.0 but are still used in earlier MySQL releases. In MySQL
8.0, data previously stored in
<code class="filename">
.frm
</code>
files
is stored in
<span class="bold">
<strong>
data dictionary
</strong>
</span>
tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_data_dictionary">
data dictionary
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_failover">
</a>
<span class="glossterm">
failover
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032862672">
</a>
The ability to automatically switch to a standby server in the
event of a failure. In the MySQL context, failover involves a
standby database server. Often supported within
<span class="bold">
<strong>
J2EE
</strong>
</span>
environments by the
application server or framework.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_j2ee">
J2EE
</a>
.
</p>
</dd>
<dt>
<a name="glos_fast_index_creation">
</a>
<span class="glossterm">
Fast Index Creation
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032858544">
</a>
A capability first introduced in the InnoDB Plugin, now part of
MySQL in 5.5 and higher, that speeds up creation of
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
secondary
indexes
</strong>
</span>
by avoiding the need to completely rewrite
the associated table. The speedup applies to dropping secondary
indexes also.
</p>
<p>
Because index maintenance can add performance overhead to many
data transfer operations, consider doing operations such as
<code class="literal">
ALTER TABLE ... ENGINE=INNODB
</code>
or
<code class="literal">
INSERT INTO ... SELECT * FROM ...
</code>
without any
secondary indexes in place, and creating the indexes afterward.
</p>
<p>
In MySQL 5.6, this feature becomes more general. You can read
and write to tables while an index is being created, and many
more kinds of
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
operations can be performed without copying the table, without
blocking
<span class="bold">
<strong>
DML
</strong>
</span>
operations, or
both. Thus in MySQL 5.6 and higher, this set of features is
referred to as
<span class="bold">
<strong>
online DDL
</strong>
</span>
rather than Fast Index Creation.
</p>
<p>
For related information, see
<a class="xref" href="innodb-online-ddl.html" title="17.12 InnoDB and Online DDL">
Section 17.12, “InnoDB and Online DDL”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_online_ddl">
online DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_secondary_index">
secondary index
</a>
.
</p>
</dd>
<dt>
<a name="glos_fast_shutdown">
</a>
<span class="glossterm">
fast shutdown
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032846160">
</a>
The default
<span class="bold">
<strong>
shutdown
</strong>
</span>
procedure
for
<code class="literal">
InnoDB
</code>
, based on the configuration
setting
<a class="link" href="innodb-parameters.html#sysvar_innodb_fast_shutdown">
<code class="literal">
innodb_fast_shutdown=1
</code>
</a>
.
To save time, certain
<span class="bold">
<strong>
flush
</strong>
</span>
operations are skipped. This type of shutdown is safe during
normal usage, because the flush operations are performed during
the next startup, using the same mechanism as in
<span class="bold">
<strong>
crash recovery
</strong>
</span>
. In cases where
the database is being shut down for an upgrade or downgrade, do
a
<span class="bold">
<strong>
slow shutdown
</strong>
</span>
instead to
ensure that all relevant changes are applied to the
<span class="bold">
<strong>
data files
</strong>
</span>
during the shutdown.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_crash_recovery">
crash recovery
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_shutdown">
shutdown
</a>
,
<a class="glossseealso" href="glossary.html#glos_slow_shutdown">
slow shutdown
</a>
.
</p>
</dd>
<dt>
<a name="glos_file_format">
</a>
<span class="glossterm">
file format
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032835600">
</a>
The file format for
<code class="literal">
InnoDB
</code>
tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibdata_file">
ibdata file
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_format">
row format
</a>
.
</p>
</dd>
<dt>
<a name="glos_file_per_table">
</a>
<span class="glossterm">
file-per-table
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032830736">
</a>
A general name for the setting controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_file_per_table">
<code class="literal">
innodb_file_per_table
</code>
</a>
option,
which is an important configuration option that affects aspects
of
<code class="literal">
InnoDB
</code>
file storage, availability of
features, and I/O characteristics. As of MySQL 5.6.7,
<a class="link" href="innodb-parameters.html#sysvar_innodb_file_per_table">
<code class="literal">
innodb_file_per_table
</code>
</a>
is
enabled by default.
</p>
<p>
With the
<a class="link" href="innodb-parameters.html#sysvar_innodb_file_per_table">
<code class="literal">
innodb_file_per_table
</code>
</a>
option enabled, you can create a table in its own
<span class="bold">
<strong>
.ibd file
</strong>
</span>
rather than in the
shared
<span class="bold">
<strong>
ibdata files
</strong>
</span>
of the
<span class="bold">
<strong>
system tablespace
</strong>
</span>
. When table
data is stored in an individual
<span class="bold">
<strong>
.ibd
file
</strong>
</span>
, you have more flexibility to choose
<span class="bold">
<strong>
row formats
</strong>
</span>
required for
features such as data
<span class="bold">
<strong>
compression
</strong>
</span>
. The
<code class="literal">
TRUNCATE TABLE
</code>
operation is also faster, and
reclaimed space can be used by the operating system rather than
remaining reserved for
<code class="literal">
InnoDB
</code>
.
</p>
<p>
The
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product is more flexible for tables that are in their own files.
For example, tables can be excluded from a backup, but only if
they are in separate files. Thus, this setting is suitable for
tables that are backed up less frequently or on a different
schedule.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_compressed_row_format">
compressed row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_compression">
compression
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_format">
file format
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibdata_file">
ibdata file
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_file_per_table">
innodb_file_per_table
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_format">
row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_fill_factor">
</a>
<span class="glossterm">
fill factor
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032811232">
</a>
In an
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
index
</strong>
</span>
, the proportion of a
<span class="bold">
<strong>
page
</strong>
</span>
that is taken up by index
data before the page is split. The unused space when index data
is first divided between pages allows for rows to be updated
with longer string values without requiring expensive index
maintenance operations. If the fill factor is too low, the index
consumes more space than needed, causing extra I/O overhead when
reading the index. If the fill factor is too high, any update
that increases the length of column values can cause extra I/O
overhead for index maintenance. See
<a class="xref" href="innodb-physical-structure.html" title="17.6.2.2 The Physical Structure of an InnoDB Index">
Section 17.6.2.2, “The Physical Structure of an InnoDB Index”
</a>
for more
information.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
.
</p>
</dd>
<dt>
<a name="glos_fixed_row_format">
</a>
<span class="glossterm">
fixed row format
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032804720">
</a>
This row format is used by the
<code class="literal">
MyISAM
</code>
storage
engine, not by
<code class="literal">
InnoDB
</code>
. If you create an
<code class="literal">
InnoDB
</code>
table with the option
<code class="literal">
ROW_FORMAT=FIXED
</code>
in MySQL 5.7.6 or earlier,
<code class="literal">
InnoDB
</code>
uses the
<span class="bold">
<strong>
compact
row format
</strong>
</span>
instead, although the
<code class="literal">
FIXED
</code>
value might still show up in output
such as
<code class="literal">
SHOW TABLE STATUS
</code>
reports. As of
MySQL 5.7.7,
<code class="literal">
InnoDB
</code>
returns an error if
<code class="literal">
ROW_FORMAT=FIXED
</code>
is specified.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_compact_row_format">
compact row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_format">
row format
</a>
.
</p>
</dd>
<dt>
<a name="glos_flush">
</a>
<span class="glossterm">
flush
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032794288">
</a>
To write changes to the database files, that had been buffered
in a memory area or a temporary disk storage area. The
<code class="literal">
InnoDB
</code>
storage structures that are
periodically flushed include the
<span class="bold">
<strong>
redo
log
</strong>
</span>
, the
<span class="bold">
<strong>
undo log
</strong>
</span>
,
and the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
.
</p>
<p>
Flushing can happen because a memory area becomes full and the
system needs to free some space, because a
<span class="bold">
<strong>
commit
</strong>
</span>
operation means the
changes from a transaction can be finalized, or because a
<span class="bold">
<strong>
slow shutdown
</strong>
</span>
operation means
that all outstanding work should be finalized. When it is not
critical to flush all the buffered data at once,
<code class="literal">
InnoDB
</code>
can use a technique called
<span class="bold">
<strong>
fuzzy checkpointing
</strong>
</span>
to flush
small batches of pages to spread out the I/O overhead.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_fuzzy_checkpointing">
fuzzy checkpointing
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
,
<a class="glossseealso" href="glossary.html#glos_slow_shutdown">
slow shutdown
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_flush_list">
</a>
<span class="glossterm">
flush list
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032782336">
</a>
An internal
<code class="literal">
InnoDB
</code>
data structure that tracks
<span class="bold">
<strong>
dirty pages
</strong>
</span>
in the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
: that is,
<span class="bold">
<strong>
pages
</strong>
</span>
that have been changed
and need to be written back out to disk. This data structure is
updated frequently by
<code class="literal">
InnoDB
</code>
internal
<span class="bold">
<strong>
mini-transactions
</strong>
</span>
, and so is
protected by its own
<span class="bold">
<strong>
mutex
</strong>
</span>
to
allow concurrent access to the buffer pool.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_dirty_page">
dirty page
</a>
,
<a class="glossseealso" href="glossary.html#glos_lru">
LRU
</a>
,
<a class="glossseealso" href="glossary.html#glos_mini_transaction">
mini-transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_mutex">
mutex
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_page_cleaner">
page cleaner
</a>
.
</p>
</dd>
<dt>
<a name="glos_foreign_key">
</a>
<span class="glossterm">
foreign key
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032771248">
</a>
A type of pointer relationship, between rows in separate
<code class="literal">
InnoDB
</code>
tables. The foreign key relationship
is defined on one column in both the
<span class="bold">
<strong>
parent table
</strong>
</span>
and the
<span class="bold">
<strong>
child table
</strong>
</span>
.
</p>
<p>
In addition to enabling fast lookup of related information,
foreign keys help to enforce
<span class="bold">
<strong>
referential
integrity
</strong>
</span>
, by preventing any of these pointers from
becoming invalid as data is inserted, updated, and deleted. This
enforcement mechanism is a type of
<span class="bold">
<strong>
constraint
</strong>
</span>
. A row that points
to another table cannot be inserted if the associated foreign
key value does not exist in the other table. If a row is deleted
or its foreign key value changed, and rows in another table
point to that foreign key value, the foreign key can be set up
to prevent the deletion, cause the corresponding column values
in the other table to become
<span class="bold">
<strong>
null
</strong>
</span>
, or automatically delete
the corresponding rows in the other table.
</p>
<p>
One of the stages in designing a
<span class="bold">
<strong>
normalized
</strong>
</span>
database is to
identify data that is duplicated, separate that data into a new
table, and set up a foreign key relationship so that the
multiple tables can be queried like a single table, using a
<span class="bold">
<strong>
join
</strong>
</span>
operation.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_child_table">
child table
</a>
,
<a class="glossseealso" href="glossary.html#glos_foreign_key_constraint">
FOREIGN KEY constraint
</a>
,
<a class="glossseealso" href="glossary.html#glos_join">
join
</a>
,
<a class="glossseealso" href="glossary.html#glos_normalized">
normalized
</a>
,
<a class="glossseealso" href="glossary.html#glos_null">
NULL
</a>
,
<a class="glossseealso" href="glossary.html#glos_parent_table">
parent table
</a>
,
<a class="glossseealso" href="glossary.html#glos_referential_integrity">
referential integrity
</a>
,
<a class="glossseealso" href="glossary.html#glos_relational">
relational
</a>
.
</p>
</dd>
<dt>
<a name="glos_foreign_key_constraint">
</a>
<span class="glossterm">
FOREIGN KEY constraint
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032757184">
</a>
The type of
<span class="bold">
<strong>
constraint
</strong>
</span>
that
maintains database consistency through a
<span class="bold">
<strong>
foreign key
</strong>
</span>
relationship. Like
other kinds of constraints, it can prevent data from being
inserted or updated if data would become inconsistent; in this
case, the inconsistency being prevented is between data in
multiple tables. Alternatively, when a
<span class="bold">
<strong>
DML
</strong>
</span>
operation is performed,
<code class="literal">
FOREIGN KEY
</code>
constraints can cause data in
<span class="bold">
<strong>
child rows
</strong>
</span>
to be deleted,
changed to different values, or set to
<span class="bold">
<strong>
null
</strong>
</span>
, based on the
<code class="literal">
ON
CASCADE
</code>
option specified when creating the foreign
key.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_child_table">
child table
</a>
,
<a class="glossseealso" href="glossary.html#glos_constraint">
constraint
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_foreign_key">
foreign key
</a>
,
<a class="glossseealso" href="glossary.html#glos_null">
NULL
</a>
.
</p>
</dd>
<dt>
<a name="glos_fts">
</a>
<span class="glossterm">
FTS
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032740816">
</a>
In most contexts, an acronym for
<span class="bold">
<strong>
full-text
search
</strong>
</span>
. Sometimes in performance discussions, an
acronym for
<span class="bold">
<strong>
full table scan
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_full_table_scan">
full table scan
</a>
,
<a class="glossseealso" href="glossary.html#glos_full_text_search">
full-text search
</a>
.
</p>
</dd>
<dt>
<a name="glos_full_backup">
</a>
<span class="glossterm">
full backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032736256">
</a>
A
<span class="bold">
<strong>
backup
</strong>
</span>
that includes all the
<span class="bold">
<strong>
tables
</strong>
</span>
in each MySQL
<span class="bold">
<strong>
database
</strong>
</span>
, and all the databases
in a MySQL
<span class="bold">
<strong>
instance
</strong>
</span>
. Contrast
with
<span class="bold">
<strong>
partial backup
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_backup">
backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_database">
database
</a>
,
<a class="glossseealso" href="glossary.html#glos_instance">
instance
</a>
,
<a class="glossseealso" href="glossary.html#glos_partial_backup">
partial backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_full_table_scan">
</a>
<span class="glossterm">
full table scan
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032727840">
</a>
An operation that requires reading the entire contents of a
table, rather than just selected portions using an
<span class="bold">
<strong>
index
</strong>
</span>
. Typically performed
either with small lookup tables, or in data warehousing
situations with large tables where all available data is
aggregated and analyzed. How frequently these operations occur,
and the sizes of the tables relative to available memory, have
implications for the algorithms used in query optimization and
managing the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
.
</p>
<p>
The purpose of indexes is to allow lookups for specific values
or ranges of values within a large table, thus avoiding full
table scans when practical.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
.
</p>
</dd>
<dt>
<a name="glos_full_text_search">
</a>
<span class="glossterm">
full-text search
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032722288">
</a>
The MySQL feature for finding words, phrases, Boolean
combinations of words, and so on within table data, in a faster,
more convenient, and more flexible way than using the SQL
<code class="literal">
LIKE
</code>
operator or writing your own
application-level search algorithm. It uses the SQL function
<a class="link" href="fulltext-search.html#function_match">
<code class="literal">
MATCH()
</code>
</a>
and
<span class="bold">
<strong>
FULLTEXT indexes
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_fulltext_index">
FULLTEXT index
</a>
.
</p>
</dd>
<dt>
<a name="glos_fulltext_index">
</a>
<span class="glossterm">
FULLTEXT index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032716800">
</a>
The special kind of
<span class="bold">
<strong>
index
</strong>
</span>
that
holds the
<span class="bold">
<strong>
search index
</strong>
</span>
in the
MySQL
<span class="bold">
<strong>
full-text search
</strong>
</span>
mechanism. Represents the words from values of a column,
omitting any that are specified as
<span class="bold">
<strong>
stopwords
</strong>
</span>
. Originally, only
available for
<code class="literal">
MyISAM
</code>
tables. Starting in
MySQL 5.6.4, it is also available for
<span class="bold">
<strong>
InnoDB
</strong>
</span>
tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_full_text_search">
full-text search
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_search_index">
search index
</a>
,
<a class="glossseealso" href="glossary.html#glos_stopword">
stopword
</a>
.
</p>
</dd>
<dt>
<a name="glos_fuzzy_checkpointing">
</a>
<span class="glossterm">
fuzzy checkpointing
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032707600">
</a>
A technique that
<span class="bold">
<strong>
flushes
</strong>
</span>
small
batches of
<span class="bold">
<strong>
dirty pages
</strong>
</span>
from the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
, rather than
flushing all dirty pages at once which would disrupt database
processing.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_dirty_page">
dirty page
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
G
</h3>
<dl>
<dt>
<a name="glos_ga">
</a>
<span class="glossterm">
GA
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032701168">
</a>
<span class="quote">
“
<span class="quote">
Generally available
</span>
”
</span>
, the stage when a software
product leaves
<span class="bold">
<strong>
beta
</strong>
</span>
and is
available for sale, official support, and production use.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_beta">
beta
</a>
.
</p>
</dd>
<dt>
<a name="glos_gac">
</a>
<span class="glossterm">
GAC
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032697472">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
Global Assembly Cache
</span>
”
</span>
. A central area
for storing libraries
(
<span class="bold">
<strong>
assemblies
</strong>
</span>
) on a
<span class="bold">
<strong>
.NET
</strong>
</span>
system. Physically
consists of nested folders, treated as a single virtual folder
by the
<span class="bold">
<strong>
.NET
</strong>
</span>
CLR.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos__net">
.NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_assembly">
assembly
</a>
.
</p>
</dd>
<dt>
<a name="glos_gap">
</a>
<span class="glossterm">
gap
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032691552">
</a>
A place in an
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
index
</strong>
</span>
data structure where new
values could be inserted. When you lock a set of rows with a
statement such as
<code class="literal">
SELECT ... FOR UPDATE
</code>
,
<code class="literal">
InnoDB
</code>
can create locks that apply to the
gaps as well as the actual values in the index. For example, if
you select all values greater than 10 for update, a gap lock
prevents another transaction from inserting a new value that is
greater than 10. The
<span class="bold">
<strong>
supremum
record
</strong>
</span>
and
<span class="bold">
<strong>
infimum
record
</strong>
</span>
represent the gaps containing all values
greater than or less than all the current index values.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_gap_lock">
gap lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_infimum_record">
infimum record
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_supremum_record">
supremum record
</a>
.
</p>
</dd>
<dt>
<a name="glos_gap_lock">
</a>
<span class="glossterm">
gap lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032681552">
</a>
A
<span class="bold">
<strong>
lock
</strong>
</span>
on a
<span class="bold">
<strong>
gap
</strong>
</span>
between index records, or a
lock on the gap before the first or after the last index record.
For example,
<code class="literal">
SELECT c1 FROM t WHERE c1 BETWEEN 10 and
20 FOR UPDATE;
</code>
prevents other transactions from
inserting a value of 15 into the column
<code class="literal">
t.c1
</code>
,
whether or not there was already any such value in the column,
because the gaps between all existing values in the range are
locked. Contrast with
<span class="bold">
<strong>
record
lock
</strong>
</span>
and
<span class="bold">
<strong>
next-key
lock
</strong>
</span>
.
</p>
<p>
Gap locks are part of the tradeoff between performance and
<span class="bold">
<strong>
concurrency
</strong>
</span>
, and are used in
some transaction
<span class="bold">
<strong>
isolation
levels
</strong>
</span>
and not others.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_gap">
gap
</a>
,
<a class="glossseealso" href="glossary.html#glos_infimum_record">
infimum record
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_next_key_lock">
next-key lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_record_lock">
record lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_supremum_record">
supremum record
</a>
.
</p>
</dd>
<dt>
<a name="glos_general_log">
</a>
<span class="glossterm">
general log
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_general_query_log">
general query log
</a>
.
</p>
</dd>
<dt>
<a name="glos_general_query_log">
</a>
<span class="glossterm">
general query log
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032668128">
</a>
A type of
<span class="bold">
<strong>
log
</strong>
</span>
used for
diagnosis and troubleshooting of SQL statements processed by the
MySQL server. Can be stored in a file or in a database table.
You must enable this feature through the
<a class="link" href="server-system-variables.html#sysvar_general_log">
<code class="literal">
general_log
</code>
</a>
configuration
option to use it. You can disable it for a specific connection
through the
<a class="link" href="server-system-variables.html#sysvar_sql_log_off">
<code class="literal">
sql_log_off
</code>
</a>
configuration option.
</p>
<p>
Records a broader range of queries than the
<span class="bold">
<strong>
slow query log
</strong>
</span>
. Unlike the
<span class="bold">
<strong>
binary log
</strong>
</span>
, which is used for
replication, the general query log contains
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements and does not
maintain strict ordering. For more information, see
<a class="xref" href="query-log.html" title="7.4.3 The General Query Log">
Section 7.4.3, “The General Query Log”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_binary_log">
binary log
</a>
,
<a class="glossseealso" href="glossary.html#glos_log">
log
</a>
,
<a class="glossseealso" href="glossary.html#glos_slow_query_log">
slow query log
</a>
.
</p>
</dd>
<dt>
<a name="glos_general_tablespace">
</a>
<span class="glossterm">
general tablespace
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032656992">
</a>
A shared
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
tablespace
</strong>
</span>
created using
<a class="link" href="create-tablespace.html" title="15.1.21 CREATE TABLESPACE Statement">
<code class="literal">
CREATE TABLESPACE
</code>
</a>
syntax. General
tablespaces can be created outside of the MySQL data directory,
are capable of holding multiple
<span class="bold">
<strong>
tables
</strong>
</span>
, and support tables of
all row formats. General tablespaces were introduced in MySQL
5.7.6.
</p>
<p>
Tables are added to a general tablespace using
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
<em class="replaceable">
<code>
tbl_name
</code>
</em>
... TABLESPACE [=]
<em class="replaceable">
<code>
tablespace_name
</code>
</em>
</code>
</a>
or
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
<em class="replaceable">
<code>
tbl_name
</code>
</em>
TABLESPACE [=]
<em class="replaceable">
<code>
tablespace_name
</code>
</em>
</code>
</a>
syntax.
</p>
<p>
Contrast with
<span class="bold">
<strong>
system tablespace
</strong>
</span>
and
<span class="bold">
<strong>
file-per-table
</strong>
</span>
tablespace.
</p>
<p>
For more information, see
<a class="xref" href="general-tablespaces.html" title="17.6.3.3 General Tablespaces">
Section 17.6.3.3, “General Tablespaces”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_generated_column">
</a>
<span class="glossterm">
generated column
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032641952">
</a>
A column whose values are computed from an expression included
in the column definition. A generated column can be
<span class="bold">
<strong>
virtual
</strong>
</span>
or
<span class="bold">
<strong>
stored
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_base_column">
base column
</a>
,
<a class="glossseealso" href="glossary.html#glos_stored_generated_column">
stored generated column
</a>
,
<a class="glossseealso" href="glossary.html#glos_virtual_generated_column">
virtual generated column
</a>
.
</p>
</dd>
<dt>
<a name="glos_generated_stored_column">
</a>
<span class="glossterm">
generated stored column
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_stored_generated_column">
stored generated column
</a>
.
</p>
</dd>
<dt>
<a name="glos_generated_virtual_column">
</a>
<span class="glossterm">
generated virtual column
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_virtual_generated_column">
virtual generated column
</a>
.
</p>
</dd>
<dt>
<a name="glos_glassfish">
</a>
<span class="glossterm">
Glassfish
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032633696">
</a>
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_j2ee">
J2EE
</a>
.
</p>
</dd>
<dt>
<a name="glos_global_temporary_tablespace">
</a>
<span class="glossterm">
global temporary tablespace
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032631248">
</a>
A
<span class="emphasis">
<em>
temporary tablespace
</em>
</span>
that stores
<span class="emphasis">
<em>
rollback segments
</em>
</span>
for changes made to
user-created temporary tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_temporary_tablespace">
temporary tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_global_transaction">
</a>
<span class="glossterm">
global transaction
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032627712">
</a>
A type of
<span class="bold">
<strong>
transaction
</strong>
</span>
involved
in
<span class="bold">
<strong>
XA
</strong>
</span>
operations. It consists
of several actions that are transactional in themselves, but
that all must either complete successfully as a group, or all be
rolled back as a group. In essence, this extends
<span class="bold">
<strong>
ACID
</strong>
</span>
properties
<span class="quote">
“
<span class="quote">
up a
level
</span>
”
</span>
so that multiple ACID transactions can be executed
in concert as components of a global operation that also has
ACID properties.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_xa">
XA
</a>
.
</p>
</dd>
<dt>
<a name="glos_group_commit">
</a>
<span class="glossterm">
group commit
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032621216">
</a>
An
<code class="literal">
InnoDB
</code>
optimization that performs some
low-level I/O operations (log write) once for a set of
<span class="bold">
<strong>
commit
</strong>
</span>
operations, rather than
flushing and syncing separately for each commit.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_binary_log">
binary log
</a>
,
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
.
</p>
</dd>
<dt>
<a name="glos_guid">
</a>
<span class="glossterm">
GUID
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032616448">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
globally unique identifier
</span>
”
</span>
, an ID
value that can be used to associate data across different
databases, languages, operating systems, and so on. (As an
alternative to using sequential integers, where the same values
could appear in different tables, databases, and so on referring
to different data.) Older MySQL versions represented it as
<code class="literal">
BINARY(16)
</code>
. Currently, it is represented as
<code class="literal">
CHAR(36)
</code>
. MySQL has a
<code class="literal">
UUID()
</code>
function that returns GUID values in
character format, and a
<code class="literal">
UUID_SHORT()
</code>
function
that returns GUID values in integer format. Because successive
GUID values are not necessarily in ascending sort order, it is
not an efficient value to use as a primary key for large InnoDB
tables.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
H
</h3>
<dl>
<dt>
<a name="glos_hash_index">
</a>
<span class="glossterm">
hash index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032609792">
</a>
A type of
<span class="bold">
<strong>
index
</strong>
</span>
intended for
queries that use equality operators, rather than range operators
such as greater-than or
<code class="literal">
BETWEEN
</code>
. It is
available for
<a class="link" href="memory-storage-engine.html" title="18.3 The MEMORY Storage Engine">
<code class="literal">
MEMORY
</code>
</a>
tables.
Although hash indexes are the default for
<a class="link" href="memory-storage-engine.html" title="18.3 The MEMORY Storage Engine">
<code class="literal">
MEMORY
</code>
</a>
tables for historic reasons,
that storage engine also supports
<span class="bold">
<strong>
B-tree
</strong>
</span>
indexes, which are often
a better choice for general-purpose queries.
</p>
<p>
MySQL includes a variant of this index type, the
<span class="bold">
<strong>
adaptive hash index
</strong>
</span>
, that is
constructed automatically for
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
tables if needed based on
runtime conditions.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_adaptive_hash_index">
adaptive hash index
</a>
,
<a class="glossseealso" href="glossary.html#glos_b_tree">
B-tree
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
.
</p>
</dd>
<dt>
<a name="glos_hdd">
</a>
<span class="glossterm">
HDD
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032598272">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
hard disk drive
</span>
”
</span>
. Refers to storage
media using spinning platters, usually when comparing and
contrasting with
<span class="bold">
<strong>
SSD
</strong>
</span>
. Its
performance characteristics can influence the throughput of a
<span class="bold">
<strong>
disk-based
</strong>
</span>
workload.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_disk_based">
disk-based
</a>
,
<a class="glossseealso" href="glossary.html#glos_ssd">
SSD
</a>
.
</p>
</dd>
<dt>
<a name="glos_heartbeat">
</a>
<span class="glossterm">
heartbeat
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032593104">
</a>
A periodic message that is sent to indicate that a system is
functioning properly. In a
<span class="bold">
<strong>
replication
</strong>
</span>
context, if the
<span class="bold">
<strong>
source
</strong>
</span>
stops sending such
messages, one of the
<span class="bold">
<strong>
replicas
</strong>
</span>
can take its place. Similar techniques can be used between the
servers in a cluster environment, to confirm that all of them
are operating properly.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_replication">
replication
</a>
,
<a class="glossseealso" href="glossary.html#glos_source">
source
</a>
.
</p>
</dd>
<dt>
<a name="glos_high_water_mark">
</a>
<span class="glossterm">
high-water mark
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032587440">
</a>
A value representing an upper limit, either a hard limit that
should not be exceeded at runtime, or a record of the maximum
value that was actually reached. Contrast with
<span class="bold">
<strong>
low-water mark
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_low_water_mark">
low-water mark
</a>
.
</p>
</dd>
<dt>
<a name="glos_history_list">
</a>
<span class="glossterm">
history list
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032583888">
</a>
A list of
<span class="bold">
<strong>
transactions
</strong>
</span>
with
delete-marked records scheduled to be processed by the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
purge
</strong>
</span>
operation. Recorded in the
<span class="bold">
<strong>
undo
log
</strong>
</span>
. The length of the history list is reported by
the command
<code class="literal">
SHOW ENGINE INNODB STATUS
</code>
. If the
history list grows longer than the value of the
<a class="link" href="innodb-parameters.html#sysvar_innodb_max_purge_lag">
<code class="literal">
innodb_max_purge_lag
</code>
</a>
configuration option, each
<span class="bold">
<strong>
DML
</strong>
</span>
operation is delayed slightly to allow the purge operation to
finish
<span class="bold">
<strong>
flushing
</strong>
</span>
the deleted
records.
</p>
<p>
Also known as
<span class="bold">
<strong>
purge lag
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge">
purge
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge_lag">
purge lag
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback_segment">
rollback segment
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_hole_punching">
</a>
<span class="glossterm">
hole punching
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032570384">
</a>
Releasing empty blocks from a page. The
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
transparent page
compression
</strong>
</span>
feature relies on hole punching support.
For more information, see
<a class="xref" href="innodb-page-compression.html" title="17.9.2 InnoDB Page Compression">
Section 17.9.2, “InnoDB Page Compression”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_sparse_file">
sparse file
</a>
,
<a class="glossseealso" href="glossary.html#glos_transparent_page_compression">
transparent page compression
</a>
.
</p>
</dd>
<dt>
<a name="glos_host">
</a>
<span class="glossterm">
host
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032564880">
</a>
The network name of a database server, used to establish a
<span class="bold">
<strong>
connection
</strong>
</span>
. Often specified in
conjunction with a
<span class="bold">
<strong>
port
</strong>
</span>
. In
some contexts, the IP address
<code class="literal">
127.0.0.1
</code>
works
better than the special name
<code class="literal">
localhost
</code>
for
accessing a database on the same server as the application.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connection">
connection
</a>
,
<a class="glossseealso" href="glossary.html#glos_localhost">
localhost
</a>
,
<a class="glossseealso" href="glossary.html#glos_port">
port
</a>
.
</p>
</dd>
<dt>
<a name="glos_hot">
</a>
<span class="glossterm">
hot
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032558096">
</a>
A condition where a row, table, or internal data structure is
accessed so frequently, requiring some form of locking or mutual
exclusion, that it results in a performance or scalability
issue.
</p>
<p>
Although
<span class="quote">
“
<span class="quote">
hot
</span>
”
</span>
typically indicates an undesirable
condition, a
<span class="bold">
<strong>
hot backup
</strong>
</span>
is the
preferred type of backup.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
.
</p>
</dd>
<dt>
<a name="glos_hot_backup">
</a>
<span class="glossterm">
hot backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032553712">
</a>
A backup taken while the database is running and applications
are reading and writing to it. The backup involves more than
simply copying data files: it must include any data that was
inserted or updated while the backup was in process; it must
exclude any data that was deleted while the backup was in
process; and it must ignore any changes that were not committed.
</p>
<p>
The Oracle product that performs hot backups, of
<code class="literal">
InnoDB
</code>
tables especially but also tables from
<code class="literal">
MyISAM
</code>
and other storage engines, is known as
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
.
</p>
<p>
The hot backup process consists of two stages. The initial
copying of the data files produces a
<span class="bold">
<strong>
raw
backup
</strong>
</span>
. The
<span class="bold">
<strong>
apply
</strong>
</span>
step incorporates any changes to the database that happened
while the backup was running. Applying the changes produces a
<span class="bold">
<strong>
prepared
</strong>
</span>
backup; these files
are ready to be restored whenever necessary.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_apply">
apply
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_prepared_backup">
prepared backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_raw_backup">
raw backup
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
I
</h3>
<dl>
<dt>
<a name="glos_ibd_file">
</a>
<span class="glossterm">
.ibd file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032509552">
</a>
The data file for
<span class="bold">
<strong>
file-per-table
</strong>
</span>
tablespaces and
general tablespaces. File-per-table tablespace
<code class="literal">
.ibd
</code>
files contain a single table and
associated index data.
<span class="bold">
<strong>
General
tablespace
</strong>
</span>
<code class="literal">
.ibd
</code>
files may contain
table and index data for multiple tables.
</p>
<p>
The
<code class="literal">
.ibd
</code>
file extension does not apply to the
<span class="bold">
<strong>
system tablespace
</strong>
</span>
, which
consists of one or more
<span class="bold">
<strong>
ibdata
files
</strong>
</span>
.
</p>
<p>
If a file-per-table tablespace or general tablespace is created
with the
<code class="literal">
DATA DIRECTORY =
</code>
clause, the
<code class="literal">
.ibd
</code>
file is located at the specified path,
outside the normal data directory.
</p>
<p>
When a
<code class="literal">
.ibd
</code>
file is included in a compressed
backup by the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product, the compressed equivalent is a
<code class="literal">
.ibz
</code>
file.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_database">
database
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_general_tablespace">
general tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibdata_file">
ibdata file
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibz_file">
.ibz file
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_file_per_table">
innodb_file_per_table
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_ibz_file">
</a>
<span class="glossterm">
.ibz file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032467952">
</a>
When the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product performs a
<span class="bold">
<strong>
compressed backup
</strong>
</span>
, it
transforms each
<span class="bold">
<strong>
tablespace
</strong>
</span>
file
that is created using the
<span class="bold">
<strong>
file-per-table
</strong>
</span>
setting from a
<code class="literal">
.ibd
</code>
extension to a
<code class="literal">
.ibz
</code>
extension.
</p>
<p>
The compression applied during backup is distinct from the
<span class="bold">
<strong>
compressed row format
</strong>
</span>
that
keeps table data compressed during normal operation. A
compressed backup operation skips the compression step for a
tablespace that is already in compressed row format, as
compressing a second time would slow down the backup but produce
little or no space savings.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_compressed_backup">
compressed backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_compressed_row_format">
compressed row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_io_bound">
</a>
<span class="glossterm">
I/O-bound
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_disk_bound">
disk-bound
</a>
.
</p>
</dd>
<dt>
<a name="glos_ib_file_set">
</a>
<span class="glossterm">
ib-file set
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032541552">
</a>
The set of files managed by
<code class="literal">
InnoDB
</code>
within a
MySQL database: the
<span class="bold">
<strong>
system
tablespace
</strong>
</span>
,
<span class="bold">
<strong>
file-per-table
</strong>
</span>
tablespace
files, and
<span class="bold">
<strong>
redo log
</strong>
</span>
files.
Depending on MySQL version and
<code class="literal">
InnoDB
</code>
configuration, may also include
<span class="bold">
<strong>
general
tablespace
</strong>
</span>
,
<span class="bold">
<strong>
temporary
tablespace
</strong>
</span>
, and
<span class="bold">
<strong>
undo
tablespace
</strong>
</span>
files. This term is sometimes used in
detailed discussions of
<code class="literal">
InnoDB
</code>
file
structures and formats to refer to the set of files managed by
<code class="literal">
InnoDB
</code>
within a MySQL database.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_database">
database
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_general_tablespace">
general tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_temporary_tablespace">
temporary tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_tablespace">
undo tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_ibbackup_logfile">
</a>
<span class="glossterm">
ibbackup_logfile
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032519696">
</a>
A supplemental backup file created by the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product
during a
<span class="bold">
<strong>
hot backup
</strong>
</span>
operation.
It contains information about any data changes that occurred
while the backup was running. The initial backup files,
including
<code class="literal">
ibbackup_logfile
</code>
, are known as a
<span class="bold">
<strong>
raw backup
</strong>
</span>
, because the changes
that occurred during the backup operation are not yet
incorporated. After you perform the
<span class="bold">
<strong>
apply
</strong>
</span>
step to the raw backup
files, the resulting files do include those final data changes,
and are known as a
<span class="bold">
<strong>
prepared
backup
</strong>
</span>
. At this stage, the
<code class="literal">
ibbackup_logfile
</code>
file is no longer necessary.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_apply">
apply
</a>
,
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_prepared_backup">
prepared backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_raw_backup">
raw backup
</a>
.
</p>
</dd>
<dt>
<a name="glos_ibdata_file">
</a>
<span class="glossterm">
ibdata file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032492624">
</a>
A set of files with names such as
<code class="literal">
ibdata1
</code>
,
<code class="literal">
ibdata2
</code>
, and so on, that make up the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
system
tablespace
</strong>
</span>
. For information about the structures and
data that reside in the system tablespace
<code class="filename">
ibdata
</code>
files, see
<a class="xref" href="innodb-system-tablespace.html" title="17.6.3.1 The System Tablespace">
Section 17.6.3.1, “The System Tablespace”
</a>
.
</p>
<p>
Growth of the
<code class="literal">
ibdata
</code>
files is influenced by
the
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoextend_increment">
<code class="literal">
innodb_autoextend_increment
</code>
</a>
configuration option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_change_buffer">
change buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_dictionary">
data dictionary
</a>
,
<a class="glossseealso" href="glossary.html#glos_doublewrite_buffer">
doublewrite buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_file_per_table">
innodb_file_per_table
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_ibtmp_file">
</a>
<span class="glossterm">
ibtmp file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032479504">
</a>
The
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
temporary
tablespace
</strong>
</span>
<span class="bold">
<strong>
data file
</strong>
</span>
for non-compressed
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
temporary tables
</strong>
</span>
and related
objects. The configuration file option,
<a class="link" href="innodb-parameters.html#sysvar_innodb_temp_data_file_path">
<code class="literal">
innodb_temp_data_file_path
</code>
</a>
,
allows users to define a relative path for the temporary
tablespace data file. If
<a class="link" href="innodb-parameters.html#sysvar_innodb_temp_data_file_path">
<code class="literal">
innodb_temp_data_file_path
</code>
</a>
is
not specified, the default behavior is to create a single
auto-extending 12MB data file named
<code class="filename">
ibtmp1
</code>
in the data directory, alongside
<code class="filename">
ibdata1
</code>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_temporary_table">
temporary table
</a>
,
<a class="glossseealso" href="glossary.html#glos_temporary_tablespace">
temporary tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_ib_logfile">
</a>
<span class="glossterm">
ib_logfile
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032528416">
</a>
A set of files, typically named
<code class="literal">
ib_logfile0
</code>
and
<code class="literal">
ib_logfile1
</code>
, that form the
<span class="bold">
<strong>
redo log
</strong>
</span>
. Also sometimes
referred to as the
<span class="bold">
<strong>
log group
</strong>
</span>
.
These files record statements that attempt to change data in
<code class="literal">
InnoDB
</code>
tables. These statements are replayed
automatically to correct data written by incomplete
transactions, on startup following a crash.
</p>
<p>
This data cannot be used for manual recovery; for that type of
operation, use the
<span class="bold">
<strong>
binary log
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_binary_log">
binary log
</a>
,
<a class="glossseealso" href="glossary.html#glos_log_group">
log group
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_ilist">
</a>
<span class="glossterm">
ilist
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032456656">
</a>
Within an
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
FULLTEXT index
</strong>
</span>
, the data
structure consisting of a document ID and positional information
for a token (that is, a particular word).
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_fulltext_index">
FULLTEXT index
</a>
.
</p>
</dd>
<dt>
<a name="glos_implicit_row_lock">
</a>
<span class="glossterm">
implicit row lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032452544">
</a>
A row lock that
<code class="literal">
InnoDB
</code>
acquires to ensure
consistency, without you specifically requesting it.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_row_lock">
row lock
</a>
.
</p>
</dd>
<dt>
<a name="glos_in_memory_database">
</a>
<span class="glossterm">
in-memory database
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032449152">
</a>
A type of database system that maintains data in memory, to
avoid overhead due to disk I/O and translation between disk
blocks and memory areas. Some in-memory databases sacrifice
durability (the
<span class="quote">
“
<span class="quote">
D
</span>
”
</span>
in the
<span class="bold">
<strong>
ACID
</strong>
</span>
design philosophy) and are
vulnerable to hardware, power, and other types of failures,
making them more suitable for read-only operations. Other
in-memory databases do use durability mechanisms such as logging
changes to disk or using non-volatile memory.
</p>
<p>
MySQL features that address the same kinds of memory-intensive
processing include the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
buffer pool
</strong>
</span>
,
<span class="bold">
<strong>
adaptive hash index
</strong>
</span>
, and
<span class="bold">
<strong>
read-only transaction
</strong>
</span>
optimization, the
<a class="link" href="memory-storage-engine.html" title="18.3 The MEMORY Storage Engine">
<code class="literal">
MEMORY
</code>
</a>
storage
engine, the
<code class="literal">
MyISAM
</code>
key cache, and the MySQL
query cache.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_adaptive_hash_index">
adaptive hash index
</a>
,
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_disk_based">
disk-based
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_only_transaction">
read-only transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_incremental_backup">
</a>
<span class="glossterm">
incremental backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032437424">
</a>
A type of
<span class="bold">
<strong>
hot backup
</strong>
</span>
, performed
by the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product, that only saves data changed since some point in time.
Having a full backup and a succession of incremental backups
lets you reconstruct backup data over a long period, without the
storage overhead of keeping several full backups on hand. You
can restore the full backup and then apply each of the
incremental backups in succession, or you can keep the full
backup up-to-date by applying each incremental backup to it,
then perform a single restore operation.
</p>
<p>
The granularity of changed data is at the
<span class="bold">
<strong>
page
</strong>
</span>
level. A page might
actually cover more than one row. Each changed page is included
in the backup.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
.
</p>
</dd>
<dt>
<a name="glos_index">
</a>
<span class="glossterm">
index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032430544">
</a>
A data structure that provides a fast lookup capability for
<span class="bold">
<strong>
rows
</strong>
</span>
of a
<span class="bold">
<strong>
table
</strong>
</span>
, typically by forming a
tree structure (
<span class="bold">
<strong>
B-tree)
</strong>
</span>
representing all the values of a particular
<span class="bold">
<strong>
column
</strong>
</span>
or set of columns.
</p>
<p>
<code class="literal">
InnoDB
</code>
tables always have a
<span class="bold">
<strong>
clustered index
</strong>
</span>
representing
the
<span class="bold">
<strong>
primary key
</strong>
</span>
. They can also
have one or more
<span class="bold">
<strong>
secondary
indexes
</strong>
</span>
defined on one or more columns. Depending on
their structure, secondary indexes can be classified as
<span class="bold">
<strong>
partial
</strong>
</span>
,
<span class="bold">
<strong>
column
</strong>
</span>
, or
<span class="bold">
<strong>
composite
</strong>
</span>
indexes.
</p>
<p>
Indexes are a crucial aspect of
<span class="bold">
<strong>
query
</strong>
</span>
performance. Database
architects design tables, queries, and indexes to allow fast
lookups for data needed by applications. The ideal database
design uses a
<span class="bold">
<strong>
covering index
</strong>
</span>
where practical; the query results are computed entirely from
the index, without reading the actual table data. Each
<span class="bold">
<strong>
foreign key
</strong>
</span>
constraint also
requires an index, to efficiently check whether values exist in
both the
<span class="bold">
<strong>
parent
</strong>
</span>
and
<span class="bold">
<strong>
child
</strong>
</span>
tables.
</p>
<p>
Although a B-tree index is the most common, a different kind of
data structure is used for
<span class="bold">
<strong>
hash
indexes
</strong>
</span>
, as in the
<code class="literal">
MEMORY
</code>
storage
engine and the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
adaptive hash index
</strong>
</span>
.
<span class="bold">
<strong>
R-tree
</strong>
</span>
indexes are used for
spatial indexing of multi-dimensional information.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_adaptive_hash_index">
adaptive hash index
</a>
,
<a class="glossseealso" href="glossary.html#glos_b_tree">
B-tree
</a>
,
<a class="glossseealso" href="glossary.html#glos_child_table">
child table
</a>
,
<a class="glossseealso" href="glossary.html#glos_clustered_index">
clustered index
</a>
,
<a class="glossseealso" href="glossary.html#glos_column_index">
column index
</a>
,
<a class="glossseealso" href="glossary.html#glos_composite_index">
composite index
</a>
,
<a class="glossseealso" href="glossary.html#glos_covering_index">
covering index
</a>
,
<a class="glossseealso" href="glossary.html#glos_foreign_key">
foreign key
</a>
,
<a class="glossseealso" href="glossary.html#glos_hash_index">
hash index
</a>
,
<a class="glossseealso" href="glossary.html#glos_parent_table">
parent table
</a>
,
<a class="glossseealso" href="glossary.html#glos_partial_index">
partial index
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
,
<a class="glossseealso" href="glossary.html#glos_r_tree">
R-tree
</a>
,
<a class="glossseealso" href="glossary.html#glos_row">
row
</a>
,
<a class="glossseealso" href="glossary.html#glos_secondary_index">
secondary index
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_index_cache">
</a>
<span class="glossterm">
index cache
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032402400">
</a>
A memory area that holds the token data for
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
full-text
search
</strong>
</span>
. It buffers the data to minimize disk I/O when
data is inserted or updated in columns that are part of a
<span class="bold">
<strong>
FULLTEXT index
</strong>
</span>
. The token data
is written to disk when the index cache becomes full. Each
<code class="literal">
InnoDB
</code>
<code class="literal">
FULLTEXT
</code>
index has
its own separate index cache, whose size is controlled by the
configuration option
<a class="link" href="innodb-parameters.html#sysvar_innodb_ft_cache_size">
<code class="literal">
innodb_ft_cache_size
</code>
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_full_text_search">
full-text search
</a>
,
<a class="glossseealso" href="glossary.html#glos_fulltext_index">
FULLTEXT index
</a>
.
</p>
</dd>
<dt>
<a name="glos_index_condition_pushdown">
</a>
<span class="glossterm">
index condition pushdown
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032394080">
</a>
Index condition pushdown (ICP) is an optimization that pushes
part of a
<code class="literal">
WHERE
</code>
condition down to the storage
engine if parts of the condition can be evaluated using fields
from the
<span class="bold">
<strong>
index
</strong>
</span>
. ICP can reduce
the number of times the
<span class="bold">
<strong>
storage
engine
</strong>
</span>
must access the base table and the number of
times the MySQL server must access the storage engine. For more
information, see
<a class="xref" href="index-condition-pushdown-optimization.html" title="10.2.1.6 Index Condition Pushdown Optimization">
Section 10.2.1.6, “Index Condition Pushdown Optimization”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_storage_engine">
storage engine
</a>
.
</p>
</dd>
<dt>
<a name="glos_index_hint">
</a>
<span class="glossterm">
index hint
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032387792">
</a>
Extended SQL syntax for overriding the
<span class="bold">
<strong>
indexes
</strong>
</span>
recommended by the
optimizer. For example, the
<code class="literal">
FORCE INDEX
</code>
,
<code class="literal">
USE INDEX
</code>
, and
<code class="literal">
IGNORE
INDEX
</code>
clauses. Typically used when indexed columns
have unevenly distributed values, resulting in inaccurate
<span class="bold">
<strong>
cardinality
</strong>
</span>
estimates.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cardinality">
cardinality
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
.
</p>
</dd>
<dt>
<a name="glos_index_prefix">
</a>
<span class="glossterm">
index prefix
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032380944">
</a>
In an
<span class="bold">
<strong>
index
</strong>
</span>
that applies to
multiple columns (known as a
<span class="bold">
<strong>
composite
index
</strong>
</span>
), the initial or leading columns of the index.
A query that references the first 1, 2, 3, and so on columns of
a composite index can use the index, even if the query does not
reference all the columns in the index.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_composite_index">
composite index
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
.
</p>
</dd>
<dt>
<a name="glos_index_statistics">
</a>
<span class="glossterm">
index statistics
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_statistics">
statistics
</a>
.
</p>
</dd>
<dt>
<a name="glos_infimum_record">
</a>
<span class="glossterm">
infimum record
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032374800">
</a>
A
<span class="bold">
<strong>
pseudo-record
</strong>
</span>
in an
<span class="bold">
<strong>
index
</strong>
</span>
, representing the
<span class="bold">
<strong>
gap
</strong>
</span>
below the smallest value in
that index. If a transaction has a statement such as
<code class="literal">
SELECT ... FROM ... WHERE col < 10 FOR
UPDATE;
</code>
, and the smallest value in the column is 5, it
is a lock on the infimum record that prevents other transactions
from inserting even smaller values such as 0, -10, and so on.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_gap">
gap
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_pseudo_record">
pseudo-record
</a>
,
<a class="glossseealso" href="glossary.html#glos_supremum_record">
supremum record
</a>
.
</p>
</dd>
<dt>
<a name="glos_information_schema">
</a>
<span class="glossterm">
INFORMATION_SCHEMA
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032367328">
</a>
The name of the
<span class="bold">
<strong>
database
</strong>
</span>
that
provides a query interface to the MySQL
<span class="bold">
<strong>
data dictionary
</strong>
</span>
. (This name is
defined by the ANSI SQL standard.) To examine information
(metadata) about the database, you can query tables such as
<code class="literal">
INFORMATION_SCHEMA.TABLES
</code>
and
<code class="literal">
INFORMATION_SCHEMA.COLUMNS
</code>
, rather than using
<code class="literal">
SHOW
</code>
commands that produce unstructured
output.
</p>
<p>
The
<code class="literal">
INFORMATION_SCHEMA
</code>
database also contains
tables specific to
<span class="bold">
<strong>
InnoDB
</strong>
</span>
that
provide a query interface to the
<code class="literal">
InnoDB
</code>
data
dictionary. You use these tables not to see how the database is
structured, but to get real-time information about the workings
of
<code class="literal">
InnoDB
</code>
tables to help with performance
monitoring, tuning, and troubleshooting.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_data_dictionary">
data dictionary
</a>
,
<a class="glossseealso" href="glossary.html#glos_database">
database
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
.
</p>
</dd>
<dt>
<a name="glos_innodb">
</a>
<span class="glossterm">
InnoDB
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032356288">
</a>
A MySQL component that combines high performance with
<span class="bold">
<strong>
transactional
</strong>
</span>
capability for
reliability, robustness, and concurrent access. It embodies the
<span class="bold">
<strong>
ACID
</strong>
</span>
design philosophy.
Represented as a
<span class="bold">
<strong>
storage
engine
</strong>
</span>
; it handles tables created or altered with the
<code class="literal">
ENGINE=INNODB
</code>
clause. See
<a class="xref" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
Chapter 17,
<i>
The InnoDB Storage Engine
</i>
</a>
for architectural
details and administration procedures, and
<a class="xref" href="optimizing-innodb.html" title="10.5 Optimizing for InnoDB Tables">
Section 10.5, “Optimizing for InnoDB Tables”
</a>
for performance advice.
</p>
<p>
In MySQL 5.5 and higher,
<code class="literal">
InnoDB
</code>
is the
default storage engine for new tables and the
<code class="literal">
ENGINE=INNODB
</code>
clause is not required.
</p>
<p>
<code class="literal">
InnoDB
</code>
tables are ideally suited for
<span class="bold">
<strong>
hot backups
</strong>
</span>
. See
<a class="xref" href="mysql-enterprise-backup.html" title="32.1 MySQL Enterprise Backup Overview">
Section 32.1, “MySQL Enterprise Backup Overview”
</a>
for information about
the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product for backing up MySQL servers without interrupting normal
processing.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_storage_engine">
storage engine
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_innodb_autoinc_lock_mode">
</a>
<span class="glossterm">
innodb_autoinc_lock_mode
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032341760">
</a>
The
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode
</code>
</a>
option controls the algorithm used for
<span class="bold">
<strong>
auto-increment locking
</strong>
</span>
. When
you have an auto-incrementing
<span class="bold">
<strong>
primary
key
</strong>
</span>
, you can use statement-based replication only
with the setting
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode=1
</code>
</a>
.
This setting is known as
<span class="emphasis">
<em>
consecutive
</em>
</span>
lock
mode, because multi-row inserts within a transaction receive
consecutive auto-increment values. If you have
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode=2
</code>
</a>
,
which allows higher concurrency for insert operations, use
row-based replication rather than statement-based replication.
This setting is known as
<span class="emphasis">
<em>
interleaved
</em>
</span>
lock
mode, because multiple multi-row insert statements running at
the same time can receive
<span class="bold">
<strong>
auto-increment
</strong>
</span>
values that are
interleaved. The setting
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode=0
</code>
</a>
should not be used except for compatibility purposes.
</p>
<p>
Consecutive lock mode
(
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode=1
</code>
</a>
) is
the default setting prior to MySQL 8.0.3. As of MySQL 8.0.3,
interleaved lock mode
(
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode=2
</code>
</a>
) is
the default, which reflects the change from statement-based to
row-based replication as the default replication type.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_auto_increment">
auto-increment
</a>
,
<a class="glossseealso" href="glossary.html#glos_auto_increment_locking">
auto-increment locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_mixed_mode_insert">
mixed-mode insert
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
.
</p>
</dd>
<dt>
<a name="glos_innodb_file_per_table">
</a>
<span class="glossterm">
innodb_file_per_table
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032325376">
</a>
An important configuration option that affects many aspects of
<code class="literal">
InnoDB
</code>
file storage, availability of
features, and I/O characteristics. In MySQL 5.6.7 and higher, it
is enabled by default. The
<a class="link" href="innodb-parameters.html#sysvar_innodb_file_per_table">
<code class="literal">
innodb_file_per_table
</code>
</a>
option
turns on
<span class="bold">
<strong>
file-per-table
</strong>
</span>
mode.
With this mode enabled, a newly created
<code class="literal">
InnoDB
</code>
table and associated indexes can be
stored in a file-per-table
<span class="bold">
<strong>
.ibd
file
</strong>
</span>
, outside the
<span class="bold">
<strong>
system
tablespace
</strong>
</span>
.
</p>
<p>
This option affects the performance and storage considerations
for a number of SQL statements, such as
<a class="link" href="drop-table.html" title="15.1.32 DROP TABLE Statement">
<code class="literal">
DROP TABLE
</code>
</a>
and
<a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
<code class="literal">
TRUNCATE TABLE
</code>
</a>
.
</p>
<p>
Enabling the
<a class="link" href="innodb-parameters.html#sysvar_innodb_file_per_table">
<code class="literal">
innodb_file_per_table
</code>
</a>
option
allows you to take advantage of features such as table
<span class="bold">
<strong>
compression
</strong>
</span>
and named-table
backups in
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
.
</p>
<p>
For more information, see
<a class="link" href="innodb-parameters.html#sysvar_innodb_file_per_table">
<code class="literal">
innodb_file_per_table
</code>
</a>
, and
<a class="xref" href="innodb-file-per-table-tablespaces.html" title="17.6.3.2 File-Per-Table Tablespaces">
Section 17.6.3.2, “File-Per-Table Tablespaces”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_compression">
compression
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_innodb_lock_wait_timeout">
</a>
<span class="glossterm">
innodb_lock_wait_timeout
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032306800">
</a>
The
<a class="link" href="innodb-parameters.html#sysvar_innodb_lock_wait_timeout">
<code class="literal">
innodb_lock_wait_timeout
</code>
</a>
option sets the balance between
<span class="bold">
<strong>
waiting
</strong>
</span>
for shared resources to
become available, or giving up and handling the error, retrying,
or doing alternative processing in your application. Rolls back
any
<code class="literal">
InnoDB
</code>
transaction that waits more than a
specified time to acquire a
<span class="bold">
<strong>
lock
</strong>
</span>
. Especially useful if
<span class="bold">
<strong>
deadlocks
</strong>
</span>
are caused by updates
to multiple tables controlled by different storage engines; such
deadlocks are not
<span class="bold">
<strong>
detected
</strong>
</span>
automatically.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_deadlock">
deadlock
</a>
,
<a class="glossseealso" href="glossary.html#glos_deadlock_detection">
deadlock detection
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_wait">
wait
</a>
.
</p>
</dd>
<dt>
<a name="glos_innodb_strict_mode">
</a>
<span class="glossterm">
innodb_strict_mode
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032297424">
</a>
The
<a class="link" href="innodb-parameters.html#sysvar_innodb_strict_mode">
<code class="literal">
innodb_strict_mode
</code>
</a>
option
controls whether
<code class="literal">
InnoDB
</code>
operates in
<span class="bold">
<strong>
strict mode
</strong>
</span>
, where conditions
that are normally treated as warnings, cause errors instead (and
the underlying statements fail).
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_strict_mode">
strict mode
</a>
.
</p>
</dd>
<dt>
<a name="glos_innovation_series">
</a>
<span class="glossterm">
Innovation Series
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032291984">
</a>
Innovation releases with the same major version form an
Innovation series. For example, MySQL 8.1 through 8.3 form the
MySQL 8 Innovation series.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_lts_series">
LTS Series
</a>
.
</p>
</dd>
<dt>
<a name="glos_insert">
</a>
<span class="glossterm">
insert
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032289248">
</a>
One of the primary
<span class="bold">
<strong>
DML
</strong>
</span>
operations in
<span class="bold">
<strong>
SQL
</strong>
</span>
. The
performance of inserts is a key factor in
<span class="bold">
<strong>
data warehouse
</strong>
</span>
systems that
load millions of rows into tables, and
<span class="bold">
<strong>
OLTP
</strong>
</span>
systems where many
concurrent connections might insert rows into the same table, in
arbitrary order. If insert performance is important to you, you
should learn about
<span class="bold">
<strong>
InnoDB
</strong>
</span>
features such as the
<span class="bold">
<strong>
insert
buffer
</strong>
</span>
used in
<span class="bold">
<strong>
change
buffering
</strong>
</span>
, and
<span class="bold">
<strong>
auto-increment
</strong>
</span>
columns.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_auto_increment">
auto-increment
</a>
,
<a class="glossseealso" href="glossary.html#glos_change_buffering">
change buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_warehouse">
data warehouse
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_insert_buffer">
insert buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_oltp">
OLTP
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
.
</p>
</dd>
<dt>
<a name="glos_insert_buffer">
</a>
<span class="glossterm">
insert buffer
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032277056">
</a>
The former name of the
<span class="bold">
<strong>
change
buffer
</strong>
</span>
. In MySQL 5.5, support was added for buffering
changes to secondary index pages for
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
and
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
operations. Previously,
only changes resulting from
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
operations were buffered.
The preferred term is now
<span class="emphasis">
<em>
change buffer
</em>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_change_buffer">
change buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_change_buffering">
change buffering
</a>
.
</p>
</dd>
<dt>
<a name="glos_insert_buffering">
</a>
<span class="glossterm">
insert buffering
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032268960">
</a>
The technique of storing changes to secondary index pages,
resulting from
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
operations,
in the
<span class="bold">
<strong>
change buffer
</strong>
</span>
rather
than writing the changes immediately, so that the physical
writes can be performed to minimize random I/O. It is one of the
types of
<span class="bold">
<strong>
change buffering
</strong>
</span>
; the
others are
<span class="bold">
<strong>
delete buffering
</strong>
</span>
and
<span class="bold">
<strong>
purge buffering
</strong>
</span>
.
</p>
<p>
Insert buffering is not used if the secondary index is
<span class="bold">
<strong>
unique
</strong>
</span>
, because the uniqueness
of new values cannot be verified before the new entries are
written out. Other kinds of change buffering do work for unique
indexes.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_change_buffer">
change buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_change_buffering">
change buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_delete_buffering">
delete buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_insert_buffer">
insert buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge_buffering">
purge buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_unique_index">
unique index
</a>
.
</p>
</dd>
<dt>
<a name="glos_insert_intention_lock">
</a>
<span class="glossterm">
insert intention lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032257888">
</a>
A type of
<span class="bold">
<strong>
gap lock
</strong>
</span>
that is set
by
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
operations prior to row
insertion. This type of
<span class="bold">
<strong>
lock
</strong>
</span>
signals the intent to insert in such a way that multiple
transactions inserting into the same index gap need not wait for
each other if they are not inserting at the same position within
the gap. For more information, see
<a class="xref" href="innodb-locking.html" title="17.7.1 InnoDB Locking">
Section 17.7.1, “InnoDB Locking”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_gap_lock">
gap lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_next_key_lock">
next-key lock
</a>
.
</p>
</dd>
<dt>
<a name="glos_instance">
</a>
<span class="glossterm">
instance
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032250736">
</a>
A single
<span class="bold">
<strong>
mysqld
</strong>
</span>
daemon managing
a
<span class="bold">
<strong>
data directory
</strong>
</span>
representing
one or more
<span class="bold">
<strong>
databases
</strong>
</span>
with a
set of
<span class="bold">
<strong>
tables
</strong>
</span>
. It is common in
development, testing, and some
<span class="bold">
<strong>
replication
</strong>
</span>
scenarios to have
multiple instances on the same
<span class="bold">
<strong>
server
</strong>
</span>
machine, each managing
its own data directory and listening on its own port or socket.
With one instance running a
<span class="bold">
<strong>
disk-bound
</strong>
</span>
workload, the server
might still have extra CPU and memory capacity to run additional
instances.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_data_directory">
data directory
</a>
,
<a class="glossseealso" href="glossary.html#glos_database">
database
</a>
,
<a class="glossseealso" href="glossary.html#glos_disk_bound">
disk-bound
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqld">
mysqld
</a>
,
<a class="glossseealso" href="glossary.html#glos_replication">
replication
</a>
,
<a class="glossseealso" href="glossary.html#glos_server">
server
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_instrumentation">
</a>
<span class="glossterm">
instrumentation
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032239504">
</a>
Modifications at the source code level to collect performance
data for tuning and debugging. In MySQL, data collected by
instrumentation is exposed through an SQL interface using the
<code class="literal">
INFORMATION_SCHEMA
</code>
and
<code class="literal">
PERFORMANCE_SCHEMA
</code>
databases.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_information_schema">
INFORMATION_SCHEMA
</a>
,
<a class="glossseealso" href="glossary.html#glos_performance_schema">
Performance Schema
</a>
.
</p>
</dd>
<dt>
<a name="glos_intention_exclusive_lock">
</a>
<span class="glossterm">
intention exclusive lock
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_intention_lock">
intention lock
</a>
.
</p>
</dd>
<dt>
<a name="glos_intention_lock">
</a>
<span class="glossterm">
intention lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032233408">
</a>
A kind of
<span class="bold">
<strong>
lock
</strong>
</span>
that applies to
the table, used to indicate the kind of lock the
<span class="bold">
<strong>
transaction
</strong>
</span>
intends to acquire
on rows in the table. Different transactions can acquire
different kinds of intention locks on the same table, but the
first transaction to acquire an
<span class="emphasis">
<em>
intention
exclusive
</em>
</span>
(IX) lock on a table prevents other
transactions from acquiring any S or X locks on the table.
Conversely, the first transaction to acquire an
<span class="emphasis">
<em>
intention shared
</em>
</span>
(IS) lock on a table
prevents other transactions from acquiring any X locks on the
table. The two-phase process allows the lock requests to be
resolved in order, without blocking locks and corresponding
operations that are compatible. For more information about this
locking mechanism, see
<a class="xref" href="innodb-locking.html" title="17.7.1 InnoDB Locking">
Section 17.7.1, “InnoDB Locking”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock_mode">
lock mode
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_intention_shared_lock">
</a>
<span class="glossterm">
intention shared lock
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_intention_lock">
intention lock
</a>
.
</p>
</dd>
<dt>
<a name="glos_interceptor">
</a>
<span class="glossterm">
interceptor
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032224208">
</a>
Code for instrumenting or debugging some aspect of an
application, which can be enabled without recompiling or
changing the source of the application itself.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_command_interceptor">
command interceptor
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_exception_interceptor">
exception interceptor
</a>
.
</p>
</dd>
<dt>
<a name="glos_intrinsic_temporary_table">
</a>
<span class="glossterm">
intrinsic temporary table
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032219680">
</a>
An optimized internal
<code class="literal">
InnoDB
</code>
temporary table
used by the
<span class="emphasis">
<em>
optimizer
</em>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_optimizer">
optimizer
</a>
.
</p>
</dd>
<dt>
<a name="glos_inverted_index">
</a>
<span class="glossterm">
inverted index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032215888">
</a>
A data structure optimized for document retrieval systems, used
in the implementation of
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
full-text search
</strong>
</span>
. The
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
FULLTEXT
index
</strong>
</span>
, implemented as an inverted index, records the
position of each word within a document, rather than the
location of a table row. A single column value (a document
stored as a text string) is represented by many entries in the
inverted index.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_full_text_search">
full-text search
</a>
,
<a class="glossseealso" href="glossary.html#glos_fulltext_index">
FULLTEXT index
</a>
,
<a class="glossseealso" href="glossary.html#glos_ilist">
ilist
</a>
.
</p>
</dd>
<dt>
<a name="glos_iops">
</a>
<span class="glossterm">
IOPS
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032209088">
</a>
Acronym for
<span class="bold">
<strong>
I/O operations per
second
</strong>
</span>
. A common measurement for busy systems,
particularly
<span class="bold">
<strong>
OLTP
</strong>
</span>
applications.
If this value is near the maximum that the storage devices can
handle, the application can become
<span class="bold">
<strong>
disk-bound
</strong>
</span>
, limiting
<span class="bold">
<strong>
scalability
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_disk_bound">
disk-bound
</a>
,
<a class="glossseealso" href="glossary.html#glos_oltp">
OLTP
</a>
,
<a class="glossseealso" href="glossary.html#glos_scalability">
scalability
</a>
.
</p>
</dd>
<dt>
<a name="glos_isolation_level">
</a>
<span class="glossterm">
isolation level
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032202464">
</a>
One of the foundations of database processing. Isolation is the
<span class="bold">
<strong>
I
</strong>
</span>
in the acronym
<span class="bold">
<strong>
ACID
</strong>
</span>
; the isolation level is
the setting that fine-tunes the balance between performance and
reliability, consistency, and reproducibility of results when
multiple
<span class="bold">
<strong>
transactions
</strong>
</span>
are
making changes and performing queries at the same time.
</p>
<p>
From highest amount of consistency and protection to the least,
the isolation levels supported by InnoDB are:
<span class="bold">
<strong>
SERIALIZABLE
</strong>
</span>
,
<span class="bold">
<strong>
REPEATABLE READ
</strong>
</span>
,
<span class="bold">
<strong>
READ COMMITTED
</strong>
</span>
, and
<span class="bold">
<strong>
READ UNCOMMITTED
</strong>
</span>
.
</p>
<p>
With
<code class="literal">
InnoDB
</code>
tables, many users can keep the
default isolation level (
<span class="emphasis">
<em>
REPEATABLE READ
</em>
</span>
)
for all operations. Expert users might choose the
<span class="bold">
<strong>
READ COMMITTED
</strong>
</span>
level as they
push the boundaries of scalability with
<span class="bold">
<strong>
OLTP
</strong>
</span>
processing, or during data
warehousing operations where minor inconsistencies do not affect
the aggregate results of large amounts of data. The levels on
the edges (
<span class="bold">
<strong>
SERIALIZABLE
</strong>
</span>
and
<span class="bold">
<strong>
READ UNCOMMITTED
</strong>
</span>
) change the
processing behavior to such an extent that they are rarely used.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_oltp">
OLTP
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_committed">
READ COMMITTED
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_uncommitted">
READ UNCOMMITTED
</a>
,
<a class="glossseealso" href="glossary.html#glos_repeatable_read">
REPEATABLE READ
</a>
,
<a class="glossseealso" href="glossary.html#glos_serializable">
SERIALIZABLE
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
J
</h3>
<dl>
<dt>
<a name="glos_j2ee">
</a>
<span class="glossterm">
J2EE
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032185328">
</a>
Java Platform, Enterprise Edition: Oracle's enterprise Java
platform. It consists of an API and a runtime environment for
enterprise-class Java applications. For full details, see
<a class="ulink" href="http://www.oracle.com/technetwork/java/javaee/overview/index.html" target="_blank">
http://www.oracle.com/technetwork/java/javaee/overview/index.html
</a>
.
With MySQL applications, you typically use
<span class="bold">
<strong>
Connector/J
</strong>
</span>
for database
access, and an application server such as
<span class="bold">
<strong>
Tomcat
</strong>
</span>
or
<span class="bold">
<strong>
JBoss
</strong>
</span>
to handle the middle-tier
work, and optionally a framework such as
<span class="bold">
<strong>
Spring
</strong>
</span>
. Database-related
features often offered within a J2EE stack include a
<span class="bold">
<strong>
connection pool
</strong>
</span>
and
<span class="bold">
<strong>
failover
</strong>
</span>
support.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connection_pool">
connection pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_failover">
failover
</a>
,
<a class="glossseealso" href="glossary.html#glos_java">
Java
</a>
,
<a class="glossseealso" href="glossary.html#glos_jboss">
JBoss
</a>
,
<a class="glossseealso" href="glossary.html#glos_spring">
Spring
</a>
,
<a class="glossseealso" href="glossary.html#glos_tomcat">
Tomcat
</a>
.
</p>
</dd>
<dt>
<a name="glos_java">
</a>
<span class="glossterm">
Java
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032173936">
</a>
A programming language combining high performance, rich built-in
features and data types, object-oriented mechanisms, extensive
standard library, and wide range of reusable third-party
modules. Enterprise development is supported by many frameworks,
application servers, and other technologies. Much of its syntax
is familiar to
<span class="bold">
<strong>
C
</strong>
</span>
and
<span class="bold">
<strong>
C++
</strong>
</span>
developers. To write Java
applications with MySQL, you use the
<span class="bold">
<strong>
JDBC
</strong>
</span>
driver known as
<span class="bold">
<strong>
Connector/J
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_c">
C
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_cplusplus">
C++
</a>
,
<a class="glossseealso" href="glossary.html#glos_jdbc">
JDBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_jboss">
</a>
<span class="glossterm">
JBoss
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032166176">
</a>
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_j2ee">
J2EE
</a>
.
</p>
</dd>
<dt>
<a name="glos_jdbc">
</a>
<span class="glossterm">
JDBC
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032163808">
</a>
Abbreviation for
<span class="quote">
“
<span class="quote">
Java Database Connectivity
</span>
”
</span>
, an
<span class="bold">
<strong>
API
</strong>
</span>
for database access from
<span class="bold">
<strong>
Java
</strong>
</span>
applications. Java
developers writing MySQL applications use the
<span class="bold">
<strong>
Connector/J
</strong>
</span>
component as their
JDBC driver.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_j2ee">
J2EE
</a>
,
<a class="glossseealso" href="glossary.html#glos_java">
Java
</a>
.
</p>
</dd>
<dt>
<a name="glos_jndi">
</a>
<span class="glossterm">
JNDI
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032156976">
</a>
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_java">
Java
</a>
.
</p>
</dd>
<dt>
<a name="glos_join">
</a>
<span class="glossterm">
join
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032154608">
</a>
A
<span class="bold">
<strong>
query
</strong>
</span>
that retrieves data
from more than one table, by referencing columns in the tables
that hold identical values. Ideally, these columns are part of
an
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
foreign
key
</strong>
</span>
relationship, which ensures
<span class="bold">
<strong>
referential integrity
</strong>
</span>
and that
the join columns are
<span class="bold">
<strong>
indexed
</strong>
</span>
.
Often used to save space and improve query performance by
replacing repeated strings with numeric IDs, in a
<span class="bold">
<strong>
normalized
</strong>
</span>
data design.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_foreign_key">
foreign key
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_normalized">
normalized
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
,
<a class="glossseealso" href="glossary.html#glos_referential_integrity">
referential integrity
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
K
</h3>
<dl>
<dt>
<a name="glos_kdc">
</a>
<span class="glossterm">
KDC
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_key_distribution_center">
key distribution center
</a>
.
</p>
</dd>
<dt>
<a name="glos_key_distribution_center">
</a>
<span class="glossterm">
key distribution center
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032143216">
</a>
In Kerberos, the key distribution center comprises an
authentication server (AS) and a ticket-granting server (TGS).
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_authentication_server">
authentication server
</a>
,
<a class="glossseealso" href="glossary.html#glos_ticket_granting_ticket">
ticket-granting ticket
</a>
.
</p>
</dd>
<dt>
<a name="glos_keystore">
</a>
<span class="glossterm">
keystore
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032131536">
</a>
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ssl">
SSL
</a>
.
</p>
</dd>
<dt>
<a name="glos_key_block_size">
</a>
<span class="glossterm">
KEY_BLOCK_SIZE
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032139920">
</a>
An option to specify the size of data pages within an
<code class="literal">
InnoDB
</code>
table that uses
<span class="bold">
<strong>
compressed row format
</strong>
</span>
. The
default is 8 kilobytes. Lower values risk hitting internal
limits that depend on the combination of row size and
compression percentage.
</p>
<p>
For
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
tables,
<code class="literal">
KEY_BLOCK_SIZE
</code>
optionally specifies the size
in bytes to use for index key blocks. The value is treated as a
hint; a different size could be used if necessary. A
<code class="literal">
KEY_BLOCK_SIZE
</code>
value specified for an
individual index definition overrides a table-level
<code class="literal">
KEY_BLOCK_SIZE
</code>
value.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_compressed_row_format">
compressed row format
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
L
</h3>
<dl>
<dt>
<a name="glos_latch">
</a>
<span class="glossterm">
latch
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032128304">
</a>
A lightweight structure used by
<code class="literal">
InnoDB
</code>
to
implement a
<span class="bold">
<strong>
lock
</strong>
</span>
for its own
internal memory structures, typically held for a brief time
measured in milliseconds or microseconds. A general term that
includes both
<span class="bold">
<strong>
mutexes
</strong>
</span>
(for
exclusive access) and
<span class="bold">
<strong>
rw-locks
</strong>
</span>
(for shared access). Certain latches are the focus of
<code class="literal">
InnoDB
</code>
performance tuning. Statistics about
latch use and contention are available through the
<span class="bold">
<strong>
Performance Schema
</strong>
</span>
interface.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_mutex">
mutex
</a>
,
<a class="glossseealso" href="glossary.html#glos_performance_schema">
Performance Schema
</a>
,
<a class="glossseealso" href="glossary.html#glos_rw_lock">
rw-lock
</a>
.
</p>
</dd>
<dt>
<a name="glos_libmysql">
</a>
<span class="glossterm">
libmysql
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032118992">
</a>
Informal name for the
<span class="bold">
<strong>
libmysqlclient
</strong>
</span>
library.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_libmysqlclient">
libmysqlclient
</a>
.
</p>
</dd>
<dt>
<a name="glos_libmysqlclient">
</a>
<span class="glossterm">
libmysqlclient
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032115664">
</a>
The library file, named
<code class="filename">
libmysqlclient.a
</code>
or
<code class="filename">
libmysqlclient.so
</code>
, that is typically linked
into
<span class="bold">
<strong>
client
</strong>
</span>
programs written in
<span class="bold">
<strong>
C
</strong>
</span>
. Sometimes known informally
as
<span class="bold">
<strong>
libmysql
</strong>
</span>
or the
<span class="bold">
<strong>
mysqlclient
</strong>
</span>
library.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_client">
client
</a>
,
<a class="glossseealso" href="glossary.html#glos_libmysql">
libmysql
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqlclient">
mysqlclient
</a>
.
</p>
</dd>
<dt>
<a name="glos_libmysqld">
</a>
<span class="glossterm">
libmysqld
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032107424">
</a>
This
<span class="bold">
<strong>
embedded
</strong>
</span>
MySQL server
library makes it possible to run a full-featured MySQL server
inside a
<span class="bold">
<strong>
client
</strong>
</span>
application.
The main benefits are increased speed and more simple management
for embedded applications. You link with the
<code class="literal">
libmysqld
</code>
library rather than
<span class="bold">
<strong>
libmysqlclient
</strong>
</span>
. The API is
identical between all three of these libraries.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_client">
client
</a>
,
<a class="glossseealso" href="glossary.html#glos_embedded">
embedded
</a>
,
<a class="glossseealso" href="glossary.html#glos_libmysql">
libmysql
</a>
,
<a class="glossseealso" href="glossary.html#glos_libmysqlclient">
libmysqlclient
</a>
.
</p>
</dd>
<dt>
<a name="glos_lifecycle_interceptor">
</a>
<span class="glossterm">
lifecycle interceptor
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032099936">
</a>
A type of
<span class="bold">
<strong>
interceptor
</strong>
</span>
supported
by
<span class="bold">
<strong>
Connector/J
</strong>
</span>
. It involves
implementing the interface
<code class="literal">
com.mysql.jdbc.ConnectionLifecycleInterceptor
</code>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_interceptor">
interceptor
</a>
.
</p>
</dd>
<dt>
<a name="glos_list">
</a>
<span class="glossterm">
list
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032094592">
</a>
The
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
buffer
pool
</strong>
</span>
is represented as a list of memory
<span class="bold">
<strong>
pages
</strong>
</span>
. The list is reordered as
new pages are accessed and enter the buffer pool, as pages
within the buffer pool are accessed again and are considered
newer, and as pages that are not accessed for a long time are
<span class="bold">
<strong>
evicted
</strong>
</span>
from the buffer pool.
The buffer pool is divided into
<span class="bold">
<strong>
sublists
</strong>
</span>
, and the replacement
policy is a variation of the familiar
<span class="bold">
<strong>
LRU
</strong>
</span>
technique.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_eviction">
eviction
</a>
,
<a class="glossseealso" href="glossary.html#glos_lru">
LRU
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_sublist">
sublist
</a>
.
</p>
</dd>
<dt>
<a name="glos_load_balancing">
</a>
<span class="glossterm">
load balancing
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032085344">
</a>
A technique for scaling read-only connections by sending query
requests to different slave servers in a replication or Cluster
configuration. With
<span class="bold">
<strong>
Connector/J
</strong>
</span>
, load balancing is
enabled through the
<code class="literal">
com.mysql.jdbc.ReplicationDriver
</code>
class and
controlled by the configuration property
<code class="literal">
loadBalanceStrategy
</code>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_j2ee">
J2EE
</a>
.
</p>
</dd>
<dt>
<a name="glos_localhost">
</a>
<span class="glossterm">
localhost
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032079808">
</a>
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connection">
connection
</a>
.
</p>
</dd>
<dt>
<a name="glos_lock">
</a>
<span class="glossterm">
lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032077376">
</a>
The high-level notion of an object that controls access to a
resource, such as a table, row, or internal data structure, as
part of a
<span class="bold">
<strong>
locking
</strong>
</span>
strategy. For
intensive performance tuning, you might delve into the actual
structures that implement locks, such as
<span class="bold">
<strong>
mutexes
</strong>
</span>
and
<span class="bold">
<strong>
latches
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_latch">
latch
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock_mode">
lock mode
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_mutex">
mutex
</a>
.
</p>
</dd>
<dt>
<a name="glos_lock_escalation">
</a>
<span class="glossterm">
lock escalation
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032070704">
</a>
An operation used in some database systems that converts many
<span class="bold">
<strong>
row locks
</strong>
</span>
into a single
<span class="bold">
<strong>
table lock
</strong>
</span>
, saving memory space
but reducing concurrent access to the table.
<code class="literal">
InnoDB
</code>
uses a space-efficient representation
for row locks, so that
<span class="bold">
<strong>
lock
</strong>
</span>
escalation is not needed.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_lock">
row lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_table_lock">
table lock
</a>
.
</p>
</dd>
<dt>
<a name="glos_lock_mode">
</a>
<span class="glossterm">
lock mode
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032064064">
</a>
A shared (S)
<span class="bold">
<strong>
lock
</strong>
</span>
allows a
<span class="bold">
<strong>
transaction
</strong>
</span>
to read a row.
Multiple transactions can acquire an S lock on that same row at
the same time.
</p>
<p>
An exclusive (X) lock allows a transaction to update or delete a
row. No other transaction can acquire any kind of lock on that
same row at the same time.
</p>
<p>
<span class="bold">
<strong>
Intention locks
</strong>
</span>
apply to the
table, and are used to indicate what kind of lock the
transaction intends to acquire on rows in the table. Different
transactions can acquire different kinds of intention locks on
the same table, but the first transaction to acquire an
intention exclusive (IX) lock on a table prevents other
transactions from acquiring any S or X locks on the table.
Conversely, the first transaction to acquire an intention shared
(IS) lock on a table prevents other transactions from acquiring
any X locks on the table. The two-phase process allows the lock
requests to be resolved in order, without blocking locks and
corresponding operations that are compatible.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_intention_lock">
intention lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_locking">
</a>
<span class="glossterm">
locking
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032056032">
</a>
The system of protecting a
<span class="bold">
<strong>
transaction
</strong>
</span>
from seeing or
changing data that is being queried or changed by other
transactions. The
<span class="bold">
<strong>
locking
</strong>
</span>
strategy must balance reliability and consistency of database
operations (the principles of the
<span class="bold">
<strong>
ACID
</strong>
</span>
philosophy) against the
performance needed for good
<span class="bold">
<strong>
concurrency
</strong>
</span>
. Fine-tuning the
locking strategy often involves choosing an
<span class="bold">
<strong>
isolation level
</strong>
</span>
and ensuring
all your database operations are safe and reliable for that
isolation level.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_locking_read">
</a>
<span class="glossterm">
locking read
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032047344">
</a>
A
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statement that also
performs a
<span class="bold">
<strong>
locking
</strong>
</span>
operation on
an
<code class="literal">
InnoDB
</code>
table. Either
<code class="literal">
SELECT ...
FOR UPDATE
</code>
or
<code class="literal">
SELECT ...
LOCK IN SHARE MODE
</code>
. It has the potential to produce a
<span class="bold">
<strong>
deadlock
</strong>
</span>
, depending on the
<span class="bold">
<strong>
isolation level
</strong>
</span>
of the
transaction. The opposite of a
<span class="bold">
<strong>
non-locking
read
</strong>
</span>
. Not allowed for global tables in a
<span class="bold">
<strong>
read-only transaction
</strong>
</span>
.
</p>
<p>
<code class="literal">
SELECT ... FOR SHARE
</code>
replaces
<code class="literal">
SELECT
... LOCK IN SHARE MODE
</code>
in MySQL 8.0.1, but
<code class="literal">
LOCK IN SHARE MODE
</code>
remains available for
backward compatibility.
</p>
<p>
See
<a class="xref" href="innodb-locking-reads.html" title="17.7.2.4 Locking Reads">
Section 17.7.2.4, “Locking Reads”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_deadlock">
deadlock
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_non_locking_read">
non-locking read
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_only_transaction">
read-only transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_log">
</a>
<span class="glossterm">
log
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032031376">
</a>
In the
<code class="literal">
InnoDB
</code>
context,
<span class="quote">
“
<span class="quote">
log
</span>
”
</span>
or
<span class="quote">
“
<span class="quote">
log files
</span>
”
</span>
typically refers to the
<span class="bold">
<strong>
redo log
</strong>
</span>
represented by the
<span class="bold">
<strong>
ib_logfile
<em class="replaceable">
<code>
N
</code>
</em>
</strong>
</span>
files. Another type of
<code class="literal">
InnoDB
</code>
log is the
<span class="bold">
<strong>
undo log
</strong>
</span>
, which is a storage
area that holds copies of data modified by active transactions.
</p>
<p>
Other kinds of logs that are important in MySQL are the
<span class="bold">
<strong>
error log
</strong>
</span>
(for diagnosing
startup and runtime problems),
<span class="bold">
<strong>
binary
log
</strong>
</span>
(for working with replication and performing
point-in-time restores), the
<span class="bold">
<strong>
general query
log
</strong>
</span>
(for diagnosing application problems), and the
<span class="bold">
<strong>
slow query log
</strong>
</span>
(for diagnosing
performance problems).
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_binary_log">
binary log
</a>
,
<a class="glossseealso" href="glossary.html#glos_error_log">
error log
</a>
,
<a class="glossseealso" href="glossary.html#glos_general_query_log">
general query log
</a>
,
<a class="glossseealso" href="glossary.html#glos_ib_logfile">
ib_logfile
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
,
<a class="glossseealso" href="glossary.html#glos_slow_query_log">
slow query log
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_log_buffer">
</a>
<span class="glossterm">
log buffer
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032017408">
</a>
The memory area that holds data to be written to the
<span class="bold">
<strong>
log files
</strong>
</span>
that make up the
<span class="bold">
<strong>
redo log
</strong>
</span>
. It is controlled by
the
<a class="link" href="innodb-parameters.html#sysvar_innodb_log_buffer_size">
<code class="literal">
innodb_log_buffer_size
</code>
</a>
configuration option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_log_file">
log file
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_log_file">
</a>
<span class="glossterm">
log file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032011568">
</a>
One of the
<span class="bold">
<strong>
ib_logfile
<em class="replaceable">
<code>
N
</code>
</em>
</strong>
</span>
files that make up the
<span class="bold">
<strong>
redo
log
</strong>
</span>
. Data is written to these files from the
<span class="bold">
<strong>
log buffer
</strong>
</span>
memory area.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ib_logfile">
ib_logfile
</a>
,
<a class="glossseealso" href="glossary.html#glos_log_buffer">
log buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_log_group">
</a>
<span class="glossterm">
log group
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045032005536">
</a>
The set of files that make up the
<span class="bold">
<strong>
redo
log
</strong>
</span>
, typically named
<code class="literal">
ib_logfile0
</code>
and
<code class="literal">
ib_logfile1
</code>
. (For that reason, sometimes
referred to collectively as
<span class="bold">
<strong>
ib_logfile
</strong>
</span>
.)
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ib_logfile">
ib_logfile
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_logical">
</a>
<span class="glossterm">
logical
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031999472">
</a>
A type of operation that involves high-level, abstract aspects
such as tables, queries, indexes, and other SQL concepts.
Typically, logical aspects are important to make database
administration and application development convenient and
usable. Contrast with
<span class="bold">
<strong>
physical
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_logical_backup">
logical backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_physical">
physical
</a>
.
</p>
</dd>
<dt>
<a name="glos_logical_backup">
</a>
<span class="glossterm">
logical backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031995424">
</a>
A
<span class="bold">
<strong>
backup
</strong>
</span>
that reproduces table
structure and data, without copying the actual data files. For
example, the
<span class="bold">
<strong>
<code class="literal">
mysqldump
</code>
</strong>
</span>
command produces a logical backup, because its output contains
statements such as
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
</code>
</a>
and
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
that can re-create the
data. Contrast with
<span class="bold">
<strong>
physical
backup
</strong>
</span>
. A logical backup offers flexibility (for
example, you could edit table definitions or insert statements
before restoring), but can take substantially longer to
<span class="bold">
<strong>
restore
</strong>
</span>
than a physical backup.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_backup">
backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqldump">
mysqldump
</a>
,
<a class="glossseealso" href="glossary.html#glos_physical_backup">
physical backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_restore">
restore
</a>
.
</p>
</dd>
<dt>
<a name="glos_loose_">
</a>
<span class="glossterm">
loose_
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031984976">
</a>
A prefix added to
<code class="literal">
InnoDB
</code>
configuration
options after server
<span class="bold">
<strong>
startup
</strong>
</span>
,
so any new configuration options not recognized by the current
level of MySQL do not cause a startup failure. MySQL processes
configuration options that start with this prefix, but gives a
warning rather than a failure if the part after the prefix is
not a recognized option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_startup">
startup
</a>
.
</p>
</dd>
<dt>
<a name="glos_low_water_mark">
</a>
<span class="glossterm">
low-water mark
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031980544">
</a>
A value representing a lower limit, typically a threshold value
at which some corrective action begins or becomes more
aggressive. Contrast with
<span class="bold">
<strong>
high-water
mark
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_high_water_mark">
high-water mark
</a>
.
</p>
</dd>
<dt>
<a name="glos_lru">
</a>
<span class="glossterm">
LRU
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031977072">
</a>
An acronym for
<span class="quote">
“
<span class="quote">
least recently used
</span>
”
</span>
, a common
method for managing storage areas. The items that have not been
used recently are
<span class="bold">
<strong>
evicted
</strong>
</span>
when
space is needed to cache newer items.
<code class="literal">
InnoDB
</code>
uses the LRU mechanism by default to manage the
<span class="bold">
<strong>
pages
</strong>
</span>
within the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
, but makes
exceptions in cases where a page might be read only a single
time, such as during a
<span class="bold">
<strong>
full table
scan
</strong>
</span>
. This variation of the LRU algorithm is called
the
<span class="bold">
<strong>
midpoint insertion
strategy
</strong>
</span>
. For more information, see
<a class="xref" href="innodb-buffer-pool.html" title="17.5.1 Buffer Pool">
Section 17.5.1, “Buffer Pool”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_eviction">
eviction
</a>
,
<a class="glossseealso" href="glossary.html#glos_full_table_scan">
full table scan
</a>
,
<a class="glossseealso" href="glossary.html#glos_midpoint_insertion_strategy">
midpoint insertion strategy
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
.
</p>
</dd>
<dt>
<a name="glos_lsn">
</a>
<span class="glossterm">
LSN
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031966608">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
log sequence number
</span>
”
</span>
. This arbitrary,
ever-increasing value represents a point in time corresponding
to operations recorded in the
<span class="bold">
<strong>
redo
log
</strong>
</span>
. (This point in time is regardless of
<span class="bold">
<strong>
transaction
</strong>
</span>
boundaries; it can
fall in the middle of one or more transactions.) It is used
internally by
<code class="literal">
InnoDB
</code>
during
<span class="bold">
<strong>
crash recovery
</strong>
</span>
and for managing
the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
.
</p>
<p>
Prior to MySQL 5.6.3, the LSN was a 4-byte unsigned integer. The
LSN became an 8-byte unsigned integer in MySQL 5.6.3 when the
redo log file size limit increased from 4GB to 512GB, as
additional bytes were required to store extra size information.
Applications built on MySQL 5.6.3 or later that use LSN values
should use 64-bit rather than 32-bit variables to store and
compare LSN values.
</p>
<p>
In the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product, you can specify an LSN to represent the point in time
from which to take an
<span class="bold">
<strong>
incremental
backup
</strong>
</span>
. The relevant LSN is displayed by the output
of the
<span class="command">
<strong>
mysqlbackup
</strong>
</span>
command. Once you have the
LSN corresponding to the time of a full backup, you can specify
that value to take a subsequent incremental backup, whose output
contains another LSN for the next incremental backup.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_crash_recovery">
crash recovery
</a>
,
<a class="glossseealso" href="glossary.html#glos_incremental_backup">
incremental backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_lts_series">
</a>
<span class="glossterm">
LTS Series
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031953456">
</a>
LTS releases with the same major version number form an LTS
series. For example, all MySQL 8.4.x releases form the MySQL 8.4
LTS series.
</p>
<p>
Note: MySQL 8.0 is a Bugfix series that preceded the LTS release
model.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_innovation_series">
Innovation Series
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
M
</h3>
<dl>
<dt>
<a name="glos_mrg_file">
</a>
<span class="glossterm">
.MRG file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031848656">
</a>
A file containing references to other tables, used by the
<code class="literal">
MERGE
</code>
storage engine. Files with this
extension are always included in backups produced by the
<span class="command">
<strong>
mysqlbackup
</strong>
</span>
command of the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqlbackup_command">
mysqlbackup command
</a>
.
</p>
</dd>
<dt>
<a name="glos_myd_file">
</a>
<span class="glossterm">
.MYD file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031808960">
</a>
A file that MySQL uses to store data for a
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
table.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_myi_file">
.MYI file
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqlbackup_command">
mysqlbackup command
</a>
.
</p>
</dd>
<dt>
<a name="glos_myi_file">
</a>
<span class="glossterm">
.MYI file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031803632">
</a>
A file that MySQL uses to store indexes for a
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
table.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_myd_file">
.MYD file
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqlbackup_command">
mysqlbackup command
</a>
.
</p>
</dd>
<dt>
<a name="glos_master_server">
</a>
<span class="glossterm">
master
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_source">
source
</a>
.
</p>
</dd>
<dt>
<a name="glos_master_thread">
</a>
<span class="glossterm">
master thread
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031948288">
</a>
An
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
thread
</strong>
</span>
that performs various
tasks in the background. Most of these tasks are I/O related,
such as writing changes from the
<span class="bold">
<strong>
change
buffer
</strong>
</span>
to the appropriate secondary indexes.
</p>
<p>
To improve
<span class="bold">
<strong>
concurrency
</strong>
</span>
,
sometimes actions are moved from the master thread to separate
background threads. For example, in MySQL 5.6 and higher,
<span class="bold">
<strong>
dirty pages
</strong>
</span>
are
<span class="bold">
<strong>
flushed
</strong>
</span>
from the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
by the
<span class="bold">
<strong>
page cleaner
</strong>
</span>
thread rather than
the master thread.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_change_buffer">
change buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_dirty_page">
dirty page
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_page_cleaner">
page cleaner
</a>
,
<a class="glossseealso" href="glossary.html#glos_thread">
thread
</a>
.
</p>
</dd>
<dt>
<a name="glos_mdl">
</a>
<span class="glossterm">
MDL
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031936080">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
metadata lock
</span>
”
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_metadata_lock">
metadata lock
</a>
.
</p>
</dd>
<dt>
<a name="glos_medium_trust">
</a>
<span class="glossterm">
medium trust
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031933120">
</a>
Synonym for
<span class="bold">
<strong>
partial trust
</strong>
</span>
.
Because the range of trust settings is so broad,
<span class="quote">
“
<span class="quote">
partial
trust
</span>
”
</span>
is preferred, to avoid the implication that there
are only three levels (low, medium, and full).
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_partial_trust">
partial trust
</a>
.
</p>
</dd>
<dt>
<a name="glos_memcached">
</a>
<span class="glossterm">
memcached
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031928608">
</a>
A popular component of many MySQL and
<span class="bold">
<strong>
NoSQL
</strong>
</span>
software stacks, allowing
fast reads and writes for single values and caching the results
entirely in memory. Traditionally, applications required extra
logic to write the same data to a MySQL database for permanent
storage, or to read data from a MySQL database when it was not
cached yet in memory. Now, applications can use the simple
<span class="command">
<strong>
memcached
</strong>
</span>
protocol, supported by client
libraries for many languages, to communicate directly with MySQL
servers using
<code class="literal">
NDB
</code>
tables. These NoSQL
interfaces to MySQL tables allow applications to achieve higher
read and write performance than by issuing SQL statements
directly, and can simplify application logic and deployment
configurations for systems that already incorporate
<span class="command">
<strong>
memcached
</strong>
</span>
for in-memory caching.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_nosql">
NoSQL
</a>
.
</p>
</dd>
<dt>
<a name="glos_merge">
</a>
<span class="glossterm">
merge
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031922256">
</a>
To apply changes to data cached in memory, such as when a page
is brought into the
<span class="bold">
<strong>
buffer
pool
</strong>
</span>
, and any applicable changes recorded in the
<span class="bold">
<strong>
change buffer
</strong>
</span>
are incorporated
into the page in the buffer pool. The updated data is eventually
written to the
<span class="bold">
<strong>
tablespace
</strong>
</span>
by
the
<span class="bold">
<strong>
flush
</strong>
</span>
mechanism.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_change_buffer">
change buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_metadata_lock">
</a>
<span class="glossterm">
metadata lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031915104">
</a>
A type of
<span class="bold">
<strong>
lock
</strong>
</span>
that prevents
<span class="bold">
<strong>
DDL
</strong>
</span>
operations on a table that
is being used at the same time by another
<span class="bold">
<strong>
transaction
</strong>
</span>
. For details, see
<a class="xref" href="metadata-locking.html" title="10.11.4 Metadata Locking">
Section 10.11.4, “Metadata Locking”
</a>
.
</p>
<p>
Enhancements to
<span class="bold">
<strong>
online
</strong>
</span>
operations, particularly in MySQL 5.6 and higher, are focused on
reducing the amount of metadata locking. The objective is for
DDL operations that do not change the table structure (such as
<a class="link" href="create-index.html" title="15.1.15 CREATE INDEX Statement">
<code class="literal">
CREATE INDEX
</code>
</a>
and
<a class="link" href="drop-index.html" title="15.1.27 DROP INDEX Statement">
<code class="literal">
DROP INDEX
</code>
</a>
for
<code class="literal">
InnoDB
</code>
tables) to proceed while the table is
being queried, updated, and so on by other transactions.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_online">
online
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_metrics_counter">
</a>
<span class="glossterm">
metrics counter
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031903344">
</a>
A feature implemented by the
<a class="link" href="information-schema-innodb-metrics-table.html" title="28.4.21 The INFORMATION_SCHEMA INNODB_METRICS Table">
<code class="literal">
INNODB_METRICS
</code>
</a>
table in the
<span class="bold">
<strong>
INFORMATION_SCHEMA
</strong>
</span>
, in MySQL
5.6 and higher. You can query
<span class="bold">
<strong>
counts
</strong>
</span>
and totals for low-level
<code class="literal">
InnoDB
</code>
operations, and use the results for
performance tuning in combination with data from the
<span class="bold">
<strong>
Performance Schema
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_counter">
counter
</a>
,
<a class="glossseealso" href="glossary.html#glos_information_schema">
INFORMATION_SCHEMA
</a>
,
<a class="glossseealso" href="glossary.html#glos_performance_schema">
Performance Schema
</a>
.
</p>
</dd>
<dt>
<a name="glos_midpoint_insertion_strategy">
</a>
<span class="glossterm">
midpoint insertion strategy
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031895312">
</a>
The technique of initially bringing
<span class="bold">
<strong>
pages
</strong>
</span>
into the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
buffer
pool
</strong>
</span>
not at the
<span class="quote">
“
<span class="quote">
newest
</span>
”
</span>
end of the
list, but instead somewhere in the middle. The exact location of
this point can vary, based on the setting of the
<a class="link" href="innodb-parameters.html#sysvar_innodb_old_blocks_pct">
<code class="literal">
innodb_old_blocks_pct
</code>
</a>
option.
The intent is that pages that are only read once, such as during
a
<span class="bold">
<strong>
full table scan
</strong>
</span>
, can be aged
out of the buffer pool sooner than with a strict
<span class="bold">
<strong>
LRU
</strong>
</span>
algorithm. For more
information, see
<a class="xref" href="innodb-buffer-pool.html" title="17.5.1 Buffer Pool">
Section 17.5.1, “Buffer Pool”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_full_table_scan">
full table scan
</a>
,
<a class="glossseealso" href="glossary.html#glos_lru">
LRU
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
.
</p>
</dd>
<dt>
<a name="glos_mini_transaction">
</a>
<span class="glossterm">
mini-transaction
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031885008">
</a>
An internal phase of
<code class="literal">
InnoDB
</code>
processing, when
making changes at the
<span class="bold">
<strong>
physical
</strong>
</span>
level to internal data structures during
<span class="bold">
<strong>
DML
</strong>
</span>
operations. A
mini-transaction (mtr) has no notion of
<span class="bold">
<strong>
rollback
</strong>
</span>
; multiple
mini-transactions can occur within a single
<span class="bold">
<strong>
transaction
</strong>
</span>
. Mini-transactions
write information to the
<span class="bold">
<strong>
redo
log
</strong>
</span>
that is used during
<span class="bold">
<strong>
crash
recovery
</strong>
</span>
. A mini-transaction can also happen outside
the context of a regular transaction, for example during
<span class="bold">
<strong>
purge
</strong>
</span>
processing by background
threads.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_crash_recovery">
crash recovery
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_physical">
physical
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge">
purge
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_mixed_mode_insert">
</a>
<span class="glossterm">
mixed-mode insert
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031872752">
</a>
An
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
statement where
<span class="bold">
<strong>
auto-increment
</strong>
</span>
values are
specified for some but not all of the new rows. For example, a
multi-value
<code class="literal">
INSERT
</code>
could specify a value for
the auto-increment column in some cases and
<code class="literal">
NULL
</code>
in other cases.
<code class="literal">
InnoDB
</code>
generates auto-increment values for
the rows where the column value was specified as
<code class="literal">
NULL
</code>
. Another example is an
<a class="link" href="insert-on-duplicate.html" title="15.2.7.2 INSERT ... ON DUPLICATE KEY UPDATE Statement">
<code class="literal">
INSERT ...
ON DUPLICATE KEY UPDATE
</code>
</a>
statement, where
auto-increment values might be generated but not used, for any
duplicate rows that are processed as
<code class="literal">
UPDATE
</code>
rather than
<code class="literal">
INSERT
</code>
statements.
</p>
<p>
Can cause consistency issues between
<span class="bold">
<strong>
source
</strong>
</span>
and
<span class="bold">
<strong>
replica
</strong>
</span>
servers in a
<span class="bold">
<strong>
replication
</strong>
</span>
configuration. Can
require adjusting the value of the
<span class="bold">
<strong>
innodb_autoinc_lock_mode
</strong>
</span>
configuration option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_auto_increment">
auto-increment
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_autoinc_lock_mode">
innodb_autoinc_lock_mode
</a>
,
<a class="glossseealso" href="glossary.html#glos_replica">
replica
</a>
,
<a class="glossseealso" href="glossary.html#glos_replication">
replication
</a>
,
<a class="glossseealso" href="glossary.html#glos_source">
source
</a>
.
</p>
</dd>
<dt>
<a name="glos_mm_mysql">
</a>
<span class="glossterm">
MM.MySQL
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031856592">
</a>
An older JDBC driver for MySQL that evolved into
<span class="bold">
<strong>
Connector/J
</strong>
</span>
when it was
integrated with the MySQL product.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
.
</p>
</dd>
<dt>
<a name="glos_mono">
</a>
<span class="glossterm">
Mono
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031853248">
</a>
An Open Source framework developed by Novell, that works with
<span class="bold">
<strong>
Connector/NET
</strong>
</span>
and
<span class="bold">
<strong>
C#
</strong>
</span>
applications on Linux
platforms.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_csharp">
C#
</a>
.
</p>
</dd>
<dt>
<a name="glos_mtr">
</a>
<span class="glossterm">
mtr
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_mini_transaction">
mini-transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_multi_core">
</a>
<span class="glossterm">
multi-core
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031841520">
</a>
A type of processor that can take advantage of multithreaded
programs, such as the MySQL server.
</p>
</dd>
<dt>
<a name="glos_multiversion_concurrency_control">
</a>
<span class="glossterm">
multiversion concurrency control
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_mvcc">
MVCC
</a>
.
</p>
</dd>
<dt>
<a name="glos_mutex">
</a>
<span class="glossterm">
mutex
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031837872">
</a>
Informal abbreviation for
<span class="quote">
“
<span class="quote">
mutex variable
</span>
”
</span>
. (Mutex
itself is short for
<span class="quote">
“
<span class="quote">
mutual exclusion
</span>
”
</span>
.) The
low-level object that
<code class="literal">
InnoDB
</code>
uses to
represent and enforce exclusive-access
<span class="bold">
<strong>
locks
</strong>
</span>
to internal in-memory
data structures. Once the lock is acquired, any other process,
thread, and so on is prevented from acquiring the same lock.
Contrast with
<span class="bold">
<strong>
rw-locks
</strong>
</span>
, which
<code class="literal">
InnoDB
</code>
uses to represent and enforce
shared-access
<span class="bold">
<strong>
locks
</strong>
</span>
to internal
in-memory data structures. Mutexes and rw-locks are known
collectively as
<span class="bold">
<strong>
latches
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_latch">
latch
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_performance_schema">
Performance Schema
</a>
,
<a class="glossseealso" href="glossary.html#glos_pthreads">
Pthreads
</a>
,
<a class="glossseealso" href="glossary.html#glos_rw_lock">
rw-lock
</a>
.
</p>
</dd>
<dt>
<a name="glos_mvcc">
</a>
<span class="glossterm">
MVCC
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031827520">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
multiversion concurrency control
</span>
”
</span>
.
This technique lets
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
transactions
</strong>
</span>
with certain
<span class="bold">
<strong>
isolation levels
</strong>
</span>
perform
<span class="bold">
<strong>
consistent read
</strong>
</span>
operations;
that is, to query rows that are being updated by other
transactions, and see the values from before those updates
occurred. This is a powerful technique to increase
<span class="bold">
<strong>
concurrency
</strong>
</span>
, by allowing
queries to proceed without waiting due to
<span class="bold">
<strong>
locks
</strong>
</span>
held by the other
transactions.
</p>
<p>
This technique is not universal in the database world. Some
other database products, and some other MySQL storage engines,
do not support it.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_consistent_read">
consistent read
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_my_cnf">
</a>
<span class="glossterm">
my.cnf
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031816736">
</a>
The name, on Unix or Linux systems, of the MySQL
<span class="bold">
<strong>
option file
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_my_ini">
my.ini
</a>
,
<a class="glossseealso" href="glossary.html#glos_option_file">
option file
</a>
.
</p>
</dd>
<dt>
<a name="glos_my_ini">
</a>
<span class="glossterm">
my.ini
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031812816">
</a>
The name, on Windows systems, of the MySQL
<span class="bold">
<strong>
option file
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_my_cnf">
my.cnf
</a>
,
<a class="glossseealso" href="glossary.html#glos_option_file">
option file
</a>
.
</p>
</dd>
<dt>
<a name="glos_myodbc_drivers">
</a>
<span class="glossterm">
MyODBC drivers
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031798336">
</a>
Obsolete name for
<span class="bold">
<strong>
Connector/ODBC
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_odbc">
Connector/ODBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_mysql">
</a>
<span class="glossterm">
mysql
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031795072">
</a>
The
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
program is the command-line
interpreter for the MySQL database. It processes
<span class="bold">
<strong>
SQL
</strong>
</span>
statements, and also
MySQL-specific commands such as
<a class="link" href="show-tables.html" title="15.7.7.39 SHOW TABLES Statement">
<code class="literal">
SHOW
TABLES
</code>
</a>
, by passing requests to the
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
daemon.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_mysqld">
mysqld
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
.
</p>
</dd>
<dt>
<a name="glos_mysqlbackup_command">
</a>
<span class="glossterm">
mysqlbackup command
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031787360">
</a>
A command-line tool of the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product. It performs a
<span class="bold">
<strong>
hot backup
</strong>
</span>
operation for
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
tables, and a
<a class="link" href="glossary.html#glos_warm_backup" title="warm backup">
warm backup
</a>
for
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
and other kinds of tables.
See
<a class="xref" href="mysql-enterprise-backup.html" title="32.1 MySQL Enterprise Backup Overview">
Section 32.1, “MySQL Enterprise Backup Overview”
</a>
for more
information about this command.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_warm_backup">
warm backup
</a>
.
</p>
</dd>
<dt>
<a name="glos_mysqlclient">
</a>
<span class="glossterm">
mysqlclient
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031778304">
</a>
The informal name for the library that is implemented by the
file
<span class="bold">
<strong>
libmysqlclient
</strong>
</span>
, with
extension
<code class="literal">
.a
</code>
or
<code class="literal">
.so
</code>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_libmysqlclient">
libmysqlclient
</a>
.
</p>
</dd>
<dt>
<a name="glos_mysqld">
</a>
<span class="glossterm">
mysqld
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031773488">
</a>
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
, also known as MySQL Server, is a
single multithreaded program that does most of the work in a
MySQL installation. It does not spawn additional processes.
MySQL Server manages access to the MySQL data directory that
contains databases, tables, and other information such as log
files and status files.
</p>
<p>
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
runs as a Unix daemon or Windows
service, constantly waiting for requests and performing
maintenance work in the background.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_instance">
instance
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql">
mysql
</a>
.
</p>
</dd>
<dt>
<a name="glos_mysqldb">
</a>
<span class="glossterm">
MySQLdb
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031767120">
</a>
The name of the open-source
<span class="bold">
<strong>
Python
</strong>
</span>
module that forms the
basis of the MySQL
<span class="bold">
<strong>
Python API
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_python">
Python
</a>
,
<a class="glossseealso" href="glossary.html#glos_python_api">
Python API
</a>
.
</p>
</dd>
<dt>
<a name="glos_mysqldump">
</a>
<span class="glossterm">
mysqldump
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031762400">
</a>
A command that performs a
<span class="bold">
<strong>
logical
backup
</strong>
</span>
of some combination of databases, tables, and
table data. The results are SQL statements that reproduce the
original schema objects, data, or both. For substantial amounts
of data, a
<span class="bold">
<strong>
physical backup
</strong>
</span>
solution such as
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
is faster, particularly for the
<span class="bold">
<strong>
restore
</strong>
</span>
operation.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_logical_backup">
logical backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_physical_backup">
physical backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_restore">
restore
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
N
</h3>
<dl>
<dt>
<a name="glos__net">
</a>
<span class="glossterm">
.NET
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031730752">
</a>
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ado_net">
ADO.NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_asp_net">
ASP.net
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_mono">
Mono
</a>
,
<a class="glossseealso" href="glossary.html#glos_visual_studio">
Visual Studio
</a>
.
</p>
</dd>
<dt>
<a name="glos_native_c_api">
</a>
<span class="glossterm">
native C API
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031754528">
</a>
Synonym for
<span class="bold">
<strong>
libmysqlclient
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_libmysql">
libmysql
</a>
.
</p>
</dd>
<dt>
<a name="glos_natural_key">
</a>
<span class="glossterm">
natural key
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031751280">
</a>
An indexed column, typically a
<span class="bold">
<strong>
primary
key
</strong>
</span>
, where the values have some real-world
significance. Usually advised against because:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
If the value should ever change, there is potentially a lot
of index maintenance to re-sort the
<span class="bold">
<strong>
clustered index
</strong>
</span>
and update
the copies of the primary key value that are repeated in
each
<span class="bold">
<strong>
secondary index
</strong>
</span>
.
</p>
</li>
<li class="listitem">
<p>
Even seemingly stable values can change in unpredictable
ways that are difficult to represent correctly in the
database. For example, one country can change into two or
several, making the original country code obsolete. Or,
rules about unique values might have exceptions. For
example, even if taxpayer IDs are intended to be unique to a
single person, a database might have to handle records that
violate that rule, such as in cases of identity theft.
Taxpayer IDs and other sensitive ID numbers also make poor
primary keys, because they may need to be secured,
encrypted, and otherwise treated differently than other
columns.
</p>
</li>
</ul>
</div>
<p>
Thus, it is typically better to use arbitrary numeric values to
form a
<span class="bold">
<strong>
synthetic key
</strong>
</span>
, for
example using an
<span class="bold">
<strong>
auto-increment
</strong>
</span>
column.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_auto_increment">
auto-increment
</a>
,
<a class="glossseealso" href="glossary.html#glos_clustered_index">
clustered index
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
,
<a class="glossseealso" href="glossary.html#glos_secondary_index">
secondary index
</a>
,
<a class="glossseealso" href="glossary.html#glos_synthetic_key">
synthetic key
</a>
.
</p>
</dd>
<dt>
<a name="glos_neighbor_page">
</a>
<span class="glossterm">
neighbor page
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031739360">
</a>
Any
<span class="bold">
<strong>
page
</strong>
</span>
in the same
<span class="bold">
<strong>
extent
</strong>
</span>
as a particular page.
When a page is selected to be
<span class="bold">
<strong>
flushed
</strong>
</span>
, any neighbor pages
that are
<span class="bold">
<strong>
dirty
</strong>
</span>
are typically
flushed as well, as an I/O optimization for traditional hard
disks. In MySQL 5.6 and up, this behavior can be controlled by
the configuration variable
<a class="link" href="innodb-parameters.html#sysvar_innodb_flush_neighbors">
<code class="literal">
innodb_flush_neighbors
</code>
</a>
; you
might turn that setting off for SSD drives, which do not have
the same overhead for writing smaller batches of data at random
locations.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_dirty_page">
dirty page
</a>
,
<a class="glossseealso" href="glossary.html#glos_extent">
extent
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
.
</p>
</dd>
<dt>
<a name="glos_next_key_lock">
</a>
<span class="glossterm">
next-key lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031726048">
</a>
A combination of a
<span class="bold">
<strong>
record lock
</strong>
</span>
on the index record and a
<a class="link" href="glossary.html#glos_gap_lock" title="gap lock">
gap
lock
</a>
on the gap before the index record.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_gap_lock">
gap lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_record_lock">
record lock
</a>
.
</p>
</dd>
<dt>
<a name="glos_non_locking_read">
</a>
<span class="glossterm">
non-locking read
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031720880">
</a>
A
<span class="bold">
<strong>
query
</strong>
</span>
that does not use the
<code class="literal">
SELECT ... FOR UPDATE
</code>
or
<code class="literal">
SELECT ...
LOCK IN SHARE MODE
</code>
clauses. The only kind of query
allowed for global tables in a
<span class="bold">
<strong>
read-only
transaction
</strong>
</span>
. The opposite of a
<span class="bold">
<strong>
locking read
</strong>
</span>
. See
<a class="xref" href="innodb-consistent-read.html" title="17.7.2.3 Consistent Nonlocking Reads">
Section 17.7.2.3, “Consistent Nonlocking Reads”
</a>
.
</p>
<p>
<code class="literal">
SELECT ... FOR SHARE
</code>
replaces
<code class="literal">
SELECT
... LOCK IN SHARE MODE
</code>
in MySQL 8.0.1, but
<code class="literal">
LOCK IN SHARE MODE
</code>
remains available for
backward compatibility.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_locking_read">
locking read
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_only_transaction">
read-only transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_non_repeatable_read">
</a>
<span class="glossterm">
non-repeatable read
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031710080">
</a>
The situation when a query retrieves data, and a later query
within the same
<span class="bold">
<strong>
transaction
</strong>
</span>
retrieves what should be the same data, but the queries return
different results (changed by another transaction committing in
the meantime).
</p>
<p>
This kind of operation goes against the
<span class="bold">
<strong>
ACID
</strong>
</span>
principle of database
design. Within a transaction, data should be consistent, with
predictable and stable relationships.
</p>
<p>
Among different
<span class="bold">
<strong>
isolation
levels
</strong>
</span>
, non-repeatable reads are prevented by the
<span class="bold">
<strong>
serializable read
</strong>
</span>
and
<span class="bold">
<strong>
repeatable read
</strong>
</span>
levels, and
allowed by the
<span class="bold">
<strong>
consistent read
</strong>
</span>
,
and
<span class="bold">
<strong>
read uncommitted
</strong>
</span>
levels.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_consistent_read">
consistent read
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_uncommitted">
READ UNCOMMITTED
</a>
,
<a class="glossseealso" href="glossary.html#glos_repeatable_read">
REPEATABLE READ
</a>
,
<a class="glossseealso" href="glossary.html#glos_serializable">
SERIALIZABLE
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_non_blocking_io">
</a>
<span class="glossterm">
nonblocking I/O
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031698096">
</a>
An industry term that means the same as
<span class="bold">
<strong>
asynchronous I/O
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_asynchronous_io">
asynchronous I/O
</a>
.
</p>
</dd>
<dt>
<a name="glos_normalized">
</a>
<span class="glossterm">
normalized
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031694800">
</a>
A database design strategy where data is split into multiple
tables, and duplicate values condensed into single rows
represented by an ID, to avoid storing, querying, and updating
redundant or lengthy values. It is typically used in
<span class="bold">
<strong>
OLTP
</strong>
</span>
applications.
</p>
<p>
For example, an address might be given a unique ID, so that a
census database could represent the relationship
<span class="bold">
<strong>
lives at this address
</strong>
</span>
by
associating that ID with each member of a family, rather than
storing multiple copies of a complex value such as
<span class="bold">
<strong>
123 Main Street, Anytown, USA
</strong>
</span>
.
</p>
<p>
For another example, although a simple address book application
might store each phone number in the same table as a person's
name and address, a phone company database might give each phone
number a special ID, and store the numbers and IDs in a separate
table. This normalized representation could simplify large-scale
updates when area codes split apart.
</p>
<p>
Normalization is not always recommended. Data that is primarily
queried, and only updated by deleting entirely and reloading, is
often kept in fewer, larger tables with redundant copies of
duplicate values. This data representation is referred to as
<span class="bold">
<strong>
denormalized
</strong>
</span>
, and is frequently
found in data warehousing applications.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_denormalized">
denormalized
</a>
,
<a class="glossseealso" href="glossary.html#glos_foreign_key">
foreign key
</a>
,
<a class="glossseealso" href="glossary.html#glos_oltp">
OLTP
</a>
,
<a class="glossseealso" href="glossary.html#glos_relational">
relational
</a>
.
</p>
</dd>
<dt>
<a name="glos_nosql">
</a>
<span class="glossterm">
NoSQL
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031685344">
</a>
A broad term for a set of data access technologies that do not
use the
<span class="bold">
<strong>
SQL
</strong>
</span>
language as their
primary mechanism for reading and writing data. Some NoSQL
technologies act as key-value stores, only accepting
single-value reads and writes; some relax the restrictions of
the
<span class="bold">
<strong>
ACID
</strong>
</span>
methodology; still
others do not require a pre-planned
<span class="bold">
<strong>
schema
</strong>
</span>
. MySQL users can combine
NoSQL-style processing for speed and simplicity with SQL
operations for flexibility and convenience, by using the
<span class="bold">
<strong>
memcached
</strong>
</span>
API to directly
access some kinds of MySQL tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_memcached">
memcached
</a>
,
<a class="glossseealso" href="glossary.html#glos_schema">
schema
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
.
</p>
</dd>
<dt>
<a name="glos_not_null_constraint">
</a>
<span class="glossterm">
NOT NULL constraint
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031677680">
</a>
A type of
<span class="bold">
<strong>
constraint
</strong>
</span>
that
specifies that a
<span class="bold">
<strong>
column
</strong>
</span>
cannot
contain any
<span class="bold">
<strong>
NULL
</strong>
</span>
values. It
helps to preserve
<span class="bold">
<strong>
referential
integrity
</strong>
</span>
, as the database server can identify data
with erroneous missing values. It also helps in the arithmetic
involved in query optimization, allowing the optimizer to
predict the number of entries in an index on that column.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_column">
column
</a>
,
<a class="glossseealso" href="glossary.html#glos_constraint">
constraint
</a>
,
<a class="glossseealso" href="glossary.html#glos_null">
NULL
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
,
<a class="glossseealso" href="glossary.html#glos_referential_integrity">
referential integrity
</a>
.
</p>
</dd>
<dt>
<a name="glos_null">
</a>
<span class="glossterm">
NULL
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031669824">
</a>
A special value in
<span class="bold">
<strong>
SQL
</strong>
</span>
,
indicating the absence of data. Any arithmetic operation or
equality test involving a
<code class="literal">
NULL
</code>
value, in turn
produces a
<code class="literal">
NULL
</code>
result. (Thus it is similar
to the IEEE floating-point concept of NaN,
<span class="quote">
“
<span class="quote">
not a
number
</span>
”
</span>
.) Any aggregate calculation such as
<code class="literal">
AVG()
</code>
ignores rows with
<code class="literal">
NULL
</code>
values, when determining how many rows
to divide by. The only test that works with
<code class="literal">
NULL
</code>
values uses the SQL idioms
<code class="literal">
IS
NULL
</code>
or
<code class="literal">
IS NOT NULL
</code>
.
</p>
<p>
<code class="literal">
NULL
</code>
values play a part in
<span class="bold">
<strong>
index
</strong>
</span>
operations, because for
performance a database must minimize the overhead of keeping
track of missing data values. Typically,
<code class="literal">
NULL
</code>
values are not stored in an index, because a query that tests an
indexed column using a standard comparison operator could never
match a row with a
<code class="literal">
NULL
</code>
value for that
column. For the same reason, unique indexes do not prevent
<code class="literal">
NULL
</code>
values; those values simply are not
represented in the index. Declaring a
<code class="literal">
NOT
NULL
</code>
constraint on a column provides reassurance that
there are no rows left out of the index, allowing for better
query optimization (accurate counting of rows and estimation of
whether to use the index).
</p>
<p>
Because the
<span class="bold">
<strong>
primary key
</strong>
</span>
must be
able to uniquely identify every row in the table, a
single-column primary key cannot contain any
<code class="literal">
NULL
</code>
values, and a multi-column primary key
cannot contain any rows with
<code class="literal">
NULL
</code>
values in
all columns.
</p>
<p>
Although the Oracle database allows a
<code class="literal">
NULL
</code>
value to be concatenated with a string,
<code class="literal">
InnoDB
</code>
treats the result of such an operation
as
<code class="literal">
NULL
</code>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
O
</h3>
<dl>
<dt>
<a name="glos_opt_file">
</a>
<span class="glossterm">
.OPT file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031602496">
</a>
A file containing database configuration information. Files with
this extension are included in backups produced by the
<span class="command">
<strong>
mysqlbackup
</strong>
</span>
command of the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqlbackup_command">
mysqlbackup command
</a>
.
</p>
</dd>
<dt>
<a name="glos_odbc">
</a>
<span class="glossterm">
ODBC
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031648272">
</a>
Acronym for Open Database Connectivity, an industry-standard
API. Typically used with Windows-based servers, or applications
that require ODBC to communicate with MySQL. The MySQL ODBC
driver is called
<span class="bold">
<strong>
Connector/ODBC
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_odbc">
Connector/ODBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_off_page_column">
</a>
<span class="glossterm">
off-page column
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031644800">
</a>
A column containing variable-length data (such as
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
BLOB
</code>
</a>
and
<a class="link" href="char.html" title="13.3.2 The CHAR and VARCHAR Types">
<code class="literal">
VARCHAR
</code>
</a>
) that is too long to fit
on a
<span class="bold">
<strong>
B-tree
</strong>
</span>
page. The data is
stored in
<span class="bold">
<strong>
overflow pages
</strong>
</span>
. The
<span class="bold">
<strong>
DYNAMIC
</strong>
</span>
row format is more
efficient for such storage than the older
<span class="bold">
<strong>
COMPACT
</strong>
</span>
row format.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_b_tree">
B-tree
</a>
,
<a class="glossseealso" href="glossary.html#glos_compact_row_format">
compact row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_dynamic_row_format">
dynamic row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_overflow_page">
overflow page
</a>
.
</p>
</dd>
<dt>
<a name="glos_oltp">
</a>
<span class="glossterm">
OLTP
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031635184">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
Online Transaction Processing
</span>
”
</span>
. A
database system, or a database application, that runs a workload
with many
<span class="bold">
<strong>
transactions
</strong>
</span>
, with
frequent writes as well as reads, typically affecting small
amounts of data at a time. For example, an airline reservation
system or an application that processes bank deposits. The data
might be organized in
<span class="bold">
<strong>
normalized
</strong>
</span>
form for a balance
between
<span class="bold">
<strong>
DML
</strong>
</span>
(insert/update/delete) efficiency and
<span class="bold">
<strong>
query
</strong>
</span>
efficiency. Contrast with
<span class="bold">
<strong>
data warehouse
</strong>
</span>
.
</p>
<p>
With its
<span class="bold">
<strong>
row-level locking
</strong>
</span>
and
<span class="bold">
<strong>
transactional
</strong>
</span>
capability,
<span class="bold">
<strong>
InnoDB
</strong>
</span>
is the ideal storage
engine for MySQL tables used in OLTP applications.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_data_warehouse">
data warehouse
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_lock">
row lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_online">
</a>
<span class="glossterm">
online
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031623040">
</a>
A type of operation that involves no downtime, blocking, or
restricted operation for the database. Typically applied to
<span class="bold">
<strong>
DDL
</strong>
</span>
. Operations that shorten
the periods of restricted operation, such as
<span class="bold">
<strong>
fast index creation
</strong>
</span>
, have
evolved into a wider set of
<span class="bold">
<strong>
online
DDL
</strong>
</span>
operations in MySQL 5.6.
</p>
<p>
In the context of backups, a
<span class="bold">
<strong>
hot
backup
</strong>
</span>
is an online operation and a
<span class="bold">
<strong>
warm backup
</strong>
</span>
is partially an
online operation.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_fast_index_creation">
Fast Index Creation
</a>
,
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_online_ddl">
online DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_warm_backup">
warm backup
</a>
.
</p>
</dd>
<dt>
<a name="glos_online_ddl">
</a>
<span class="glossterm">
online DDL
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031614016">
</a>
A feature that improves the performance, concurrency, and
availability of
<code class="literal">
InnoDB
</code>
tables during
<span class="bold">
<strong>
DDL
</strong>
</span>
(primarily
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
) operations. See
<a class="xref" href="innodb-online-ddl.html" title="17.12 InnoDB and Online DDL">
Section 17.12, “InnoDB and Online DDL”
</a>
for details.
</p>
<p>
The details vary according to the type of operation. In some
cases, the table can be modified concurrently while the
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
is in progress. The
operation might be able to be performed without a table copy, or
using a specially optimized type of table copy. DML log space
usage for in-place operations is controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_online_alter_log_max_size">
<code class="literal">
innodb_online_alter_log_max_size
</code>
</a>
configuration option.
</p>
<p>
This feature is an enhancement of the
<span class="bold">
<strong>
Fast
Index Creation
</strong>
</span>
feature in MySQL 5.5.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_fast_index_creation">
Fast Index Creation
</a>
,
<a class="glossseealso" href="glossary.html#glos_online">
online
</a>
.
</p>
</dd>
<dt>
<a name="glos_optimistic">
</a>
<span class="glossterm">
optimistic
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031597472">
</a>
A methodology that guides low-level implementation decisions for
a relational database system. The requirements of performance
and
<span class="bold">
<strong>
concurrency
</strong>
</span>
in a relational
database mean that operations must be started or dispatched
quickly. The requirements of consistency and
<span class="bold">
<strong>
referential integrity
</strong>
</span>
mean that
any operation could fail: a transaction might be rolled back, a
<span class="bold">
<strong>
DML
</strong>
</span>
operation could violate a
constraint, a request for a lock could cause a deadlock, a
network error could cause a timeout. An optimistic strategy is
one that assumes most requests or attempts succeed, so that
relatively little work is done to prepare for the failure case.
When this assumption is true, the database does little
unnecessary work; when requests do fail, extra work must be done
to clean up and undo changes.
</p>
<p>
<code class="literal">
InnoDB
</code>
uses optimistic strategies for
operations such as
<span class="bold">
<strong>
locking
</strong>
</span>
and
<span class="bold">
<strong>
commits
</strong>
</span>
. For example, data
changed by a transaction can be written to the data files before
the commit occurs, making the commit itself very fast, but
requiring more work to undo the changes if the transaction is
rolled back.
</p>
<p>
The opposite of an optimistic strategy is a
<span class="bold">
<strong>
pessimistic
</strong>
</span>
one, where a system
is optimized to deal with operations that are unreliable and
frequently unsuccessful. This methodology is rare in a database
system, because so much care goes into choosing reliable
hardware, networks, and algorithms.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_pessimistic">
pessimistic
</a>
,
<a class="glossseealso" href="glossary.html#glos_referential_integrity">
referential integrity
</a>
.
</p>
</dd>
<dt>
<a name="glos_optimizer">
</a>
<span class="glossterm">
optimizer
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031585072">
</a>
The MySQL component that determines the best
<span class="bold">
<strong>
indexes
</strong>
</span>
and
<span class="bold">
<strong>
join
</strong>
</span>
order to use for a
<span class="bold">
<strong>
query
</strong>
</span>
, based on characteristics
and data distribution of the relevant
<span class="bold">
<strong>
tables
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_join">
join
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_option">
</a>
<span class="glossterm">
option
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031578048">
</a>
A configuration parameter for MySQL, either stored in the
<span class="bold">
<strong>
option file
</strong>
</span>
or passed on the
command line.
</p>
<p>
For the
<span class="bold">
<strong>
options
</strong>
</span>
that apply to
<span class="bold">
<strong>
InnoDB
</strong>
</span>
tables, each option name
starts with the prefix
<code class="literal">
innodb_
</code>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_option">
option
</a>
,
<a class="glossseealso" href="glossary.html#glos_option_file">
option file
</a>
.
</p>
</dd>
<dt>
<a name="glos_option_file">
</a>
<span class="glossterm">
option file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031571056">
</a>
The file that holds the configuration
<span class="bold">
<strong>
options
</strong>
</span>
for the MySQL instance.
Traditionally, on Linux and Unix this file is named
<code class="literal">
my.cnf
</code>
, and on Windows it is named
<code class="literal">
my.ini
</code>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_configuration_file">
configuration file
</a>
,
<a class="glossseealso" href="glossary.html#glos_my_cnf">
my.cnf
</a>
,
<a class="glossseealso" href="glossary.html#glos_my_ini">
my.ini
</a>
,
<a class="glossseealso" href="glossary.html#glos_option">
option
</a>
.
</p>
</dd>
<dt>
<a name="glos_overflow_page">
</a>
<span class="glossterm">
overflow page
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031564704">
</a>
Separately allocated disk
<span class="bold">
<strong>
pages
</strong>
</span>
that hold variable-length columns (such as
<code class="literal">
BLOB
</code>
and
<code class="literal">
VARCHAR
</code>
) that are
too long to fit on a
<span class="bold">
<strong>
B-tree
</strong>
</span>
page. The associated columns are known as
<span class="bold">
<strong>
off-page columns
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_b_tree">
B-tree
</a>
,
<a class="glossseealso" href="glossary.html#glos_off_page_column">
off-page column
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
P
</h3>
<dl>
<dt>
<a name="glos_par_file">
</a>
<span class="glossterm">
.par file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031510608">
</a>
A file containing partition definitions. Files with this
extension are included in backups produced by the
<code class="literal">
mysqlbackup
</code>
command of the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product.
</p>
<p>
With the introduction of native partitioning support for
<code class="literal">
InnoDB
</code>
tables in MySQL 5.7.6,
<code class="filename">
.par
</code>
files are no longer created for
partitioned
<code class="literal">
InnoDB
</code>
tables. Partitioned
<code class="literal">
MyISAM
</code>
tables continue to use
<code class="filename">
.par
</code>
files in MySQL 5.7. In MySQL 8.0,
partitioning support is only provided by the
<code class="literal">
InnoDB
</code>
storage engine. As such,
<code class="filename">
.par
</code>
files are no longer used as of MySQL
8.0.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqlbackup_command">
mysqlbackup command
</a>
.
</p>
</dd>
<dt>
<a name="glos_page">
</a>
<span class="glossterm">
page
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031556704">
</a>
A unit representing how much data
<code class="literal">
InnoDB
</code>
transfers at any one time between disk (the
<span class="bold">
<strong>
data files
</strong>
</span>
) and memory (the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
). A page can
contain one or more
<span class="bold">
<strong>
rows
</strong>
</span>
,
depending on how much data is in each row. If a row does not fit
entirely into a single page,
<code class="literal">
InnoDB
</code>
sets up
additional pointer-style data structures so that the information
about the row can be stored in one page.
</p>
<p>
One way to fit more data in each page is to use
<span class="bold">
<strong>
compressed row format
</strong>
</span>
. For
tables that use BLOBs or large text fields,
<span class="bold">
<strong>
compact row format
</strong>
</span>
allows those
large columns to be stored separately from the rest of the row,
reducing I/O overhead and memory usage for queries that do not
reference those columns.
</p>
<p>
When
<code class="literal">
InnoDB
</code>
reads or writes sets of pages as
a batch to increase I/O throughput, it reads or writes an
<span class="bold">
<strong>
extent
</strong>
</span>
at a time.
</p>
<p>
All the
<code class="literal">
InnoDB
</code>
disk data structures within a
MySQL instance share the same
<span class="bold">
<strong>
page
size
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_compact_row_format">
compact row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_compressed_row_format">
compressed row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_extent">
extent
</a>
,
<a class="glossseealso" href="glossary.html#glos_page_size">
page size
</a>
,
<a class="glossseealso" href="glossary.html#glos_row">
row
</a>
.
</p>
</dd>
<dt>
<a name="glos_page_cleaner">
</a>
<span class="glossterm">
page cleaner
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031541072">
</a>
An
<code class="literal">
InnoDB
</code>
background
<span class="bold">
<strong>
thread
</strong>
</span>
that
<span class="bold">
<strong>
flushes
</strong>
</span>
<span class="bold">
<strong>
dirty pages
</strong>
</span>
from the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
. Prior to MySQL
5.6, this activity was performed by the
<span class="bold">
<strong>
master thread
</strong>
</span>
. The number of
page cleaner threads is controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_page_cleaners">
<code class="literal">
innodb_page_cleaners
</code>
</a>
configuration option, introduced in MySQL 5.7.4.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_dirty_page">
dirty page
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_master_thread">
master thread
</a>
,
<a class="glossseealso" href="glossary.html#glos_thread">
thread
</a>
.
</p>
</dd>
<dt>
<a name="glos_page_size">
</a>
<span class="glossterm">
page size
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031530704">
</a>
For releases up to and including MySQL 5.5, the size of each
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
page
</strong>
</span>
is fixed at 16 kilobytes. This value represents a balance: large
enough to hold the data for most rows, yet small enough to
minimize the performance overhead of transferring unneeded data
to memory. Other values are not tested or supported.
</p>
<p>
Starting in MySQL 5.6, the page size for an
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
instance
</strong>
</span>
can be either 4KB,
8KB, or 16KB, controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_page_size">
<code class="literal">
innodb_page_size
</code>
</a>
configuration
option. As of MySQL 5.7.6,
<code class="literal">
InnoDB
</code>
also
supports 32KB and 64KB page sizes. For 32KB and 64KB page sizes,
<code class="literal">
ROW_FORMAT=COMPRESSED
</code>
is not supported and
the maximum record size is 16KB.
</p>
<p>
Page size is set when creating the MySQL instance, and it
remains constant afterward. The same page size applies to all
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
tablespaces
</strong>
</span>
, including the
<span class="bold">
<strong>
system tablespace
</strong>
</span>
,
<span class="bold">
<strong>
file-per-table
</strong>
</span>
tablespaces, and
<span class="bold">
<strong>
general tablespaces
</strong>
</span>
.
</p>
<p>
Smaller page sizes can help performance with storage devices
that use small block sizes, particularly for
<span class="bold">
<strong>
SSD
</strong>
</span>
devices in
<span class="bold">
<strong>
disk-bound
</strong>
</span>
workloads, such as
for
<span class="bold">
<strong>
OLTP
</strong>
</span>
applications. As
individual rows are updated, less data is copied into memory,
written to disk, reorganized, locked, and so on.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_disk_bound">
disk-bound
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_general_tablespace">
general tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_instance">
instance
</a>
,
<a class="glossseealso" href="glossary.html#glos_oltp">
OLTP
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_ssd">
SSD
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_parent_table">
</a>
<span class="glossterm">
parent table
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031499792">
</a>
The table in a
<span class="bold">
<strong>
foreign key
</strong>
</span>
relationship that holds the initial column values pointed to
from the
<span class="bold">
<strong>
child table
</strong>
</span>
. The
consequences of deleting, or updating rows in the parent table
depend on the
<code class="literal">
ON UPDATE
</code>
and
<code class="literal">
ON
DELETE
</code>
clauses in the foreign key definition. Rows
with corresponding values in the child table could be
automatically deleted or updated in turn, or those columns could
be set to
<code class="literal">
NULL
</code>
, or the operation could be
prevented.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_child_table">
child table
</a>
,
<a class="glossseealso" href="glossary.html#glos_foreign_key">
foreign key
</a>
.
</p>
</dd>
<dt>
<a name="glos_partial_backup">
</a>
<span class="glossterm">
partial backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031492768">
</a>
A
<span class="bold">
<strong>
backup
</strong>
</span>
that contains some of
the
<span class="bold">
<strong>
tables
</strong>
</span>
in a MySQL database,
or some of the databases in a MySQL instance. Contrast with
<span class="bold">
<strong>
full backup
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_backup">
backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_full_backup">
full backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_partial_index">
</a>
<span class="glossterm">
partial index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031486768">
</a>
An
<span class="bold">
<strong>
index
</strong>
</span>
that represents only
part of a column value, typically the first N characters (the
<span class="bold">
<strong>
prefix
</strong>
</span>
) of a long
<code class="literal">
VARCHAR
</code>
value.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_index_prefix">
index prefix
</a>
.
</p>
</dd>
<dt>
<a name="glos_partial_trust">
</a>
<span class="glossterm">
partial trust
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031481488">
</a>
An execution environment typically used by hosting providers,
where applications have some permissions but not others. For
example, applications might be able to access a database server
over a network, but be
<span class="quote">
“
<span class="quote">
sandboxed
</span>
”
</span>
with regard to
reading and writing local files.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
.
</p>
</dd>
<dt>
<a name="glos_performance_schema">
</a>
<span class="glossterm">
Performance Schema
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031478176">
</a>
The
<code class="literal">
performance_schema
</code>
schema, in MySQL 5.5
and up, presents a set of tables that you can query to get
detailed information about the performance characteristics of
many internal parts of the MySQL server. See
<a class="xref" href="performance-schema.html" title="Chapter 29 MySQL Performance Schema">
Chapter 29,
<i>
MySQL Performance Schema
</i>
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_information_schema">
INFORMATION_SCHEMA
</a>
,
<a class="glossseealso" href="glossary.html#glos_latch">
latch
</a>
,
<a class="glossseealso" href="glossary.html#glos_mutex">
mutex
</a>
,
<a class="glossseealso" href="glossary.html#glos_rw_lock">
rw-lock
</a>
.
</p>
</dd>
<dt>
<a name="glos_perl">
</a>
<span class="glossterm">
Perl
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031472400">
</a>
A programming language with roots in Unix scripting and report
generation. Incorporates high-performance regular expressions
and file I/O. Large collection of reusable modules available
through repositories such as CPAN.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_perl_api">
Perl API
</a>
.
</p>
</dd>
<dt>
<a name="glos_perl_api">
</a>
<span class="glossterm">
Perl API
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031469568">
</a>
An open-source
<span class="bold">
<strong>
API
</strong>
</span>
for MySQL
applications written in the
<span class="bold">
<strong>
Perl
</strong>
</span>
language. Implemented
through the
<code class="literal">
DBI
</code>
and
<code class="literal">
DBD::mysql
</code>
modules. For details, see
<a class="xref" href="apis-perl.html" title="31.9 MySQL Perl API">
Section 31.9, “MySQL Perl API”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
,
<a class="glossseealso" href="glossary.html#glos_perl">
Perl
</a>
.
</p>
</dd>
<dt>
<a name="glos_persistent_statistics">
</a>
<span class="glossterm">
persistent statistics
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031462800">
</a>
A feature that stores
<span class="bold">
<strong>
index
</strong>
</span>
statistics for
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
tables
</strong>
</span>
on disk, providing
better
<span class="bold">
<strong>
plan stability
</strong>
</span>
for
<span class="bold">
<strong>
queries
</strong>
</span>
. For more information,
see
<a class="xref" href="innodb-persistent-stats.html" title="17.8.10.1 Configuring Persistent Optimizer Statistics Parameters">
Section 17.8.10.1, “Configuring Persistent Optimizer Statistics Parameters”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_optimizer">
optimizer
</a>
,
<a class="glossseealso" href="glossary.html#glos_plan_stability">
plan stability
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_pessimistic">
</a>
<span class="glossterm">
pessimistic
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031453968">
</a>
A methodology that sacrifices performance or concurrency in
favor of safety. It is appropriate if a high proportion of
requests or attempts might fail, or if the consequences of a
failed request are severe.
<code class="literal">
InnoDB
</code>
uses what
is known as a pessimistic
<span class="bold">
<strong>
locking
</strong>
</span>
strategy, to minimize
the chance of
<span class="bold">
<strong>
deadlocks
</strong>
</span>
. At the
application level, you might avoid deadlocks by using a
pessimistic strategy of acquiring all locks needed by a
transaction at the very beginning.
</p>
<p>
Many built-in database mechanisms use the opposite
<span class="bold">
<strong>
optimistic
</strong>
</span>
methodology.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_deadlock">
deadlock
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_optimistic">
optimistic
</a>
.
</p>
</dd>
<dt>
<a name="glos_phantom">
</a>
<span class="glossterm">
phantom
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031446496">
</a>
A row that appears in the result set of a query, but not in the
result set of an earlier query. For example, if a query is run
twice within a
<span class="bold">
<strong>
transaction
</strong>
</span>
, and
in the meantime, another transaction commits after inserting a
new row or updating a row so that it matches the
<code class="literal">
WHERE
</code>
clause of the query.
</p>
<p>
This occurrence is known as a phantom read. It is harder to
guard against than a
<span class="bold">
<strong>
non-repeatable
read
</strong>
</span>
, because locking all the rows from the first
query result set does not prevent the changes that cause the
phantom to appear.
</p>
<p>
Among different
<span class="bold">
<strong>
isolation
levels
</strong>
</span>
, phantom reads are prevented by the
<span class="bold">
<strong>
serializable read
</strong>
</span>
level, and
allowed by the
<span class="bold">
<strong>
repeatable read
</strong>
</span>
,
<span class="bold">
<strong>
consistent read
</strong>
</span>
, and
<span class="bold">
<strong>
read uncommitted
</strong>
</span>
levels.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_consistent_read">
consistent read
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_non_repeatable_read">
non-repeatable read
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_uncommitted">
READ UNCOMMITTED
</a>
,
<a class="glossseealso" href="glossary.html#glos_repeatable_read">
REPEATABLE READ
</a>
,
<a class="glossseealso" href="glossary.html#glos_serializable">
SERIALIZABLE
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_php">
</a>
<span class="glossterm">
PHP
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031433552">
</a>
A programming language originating with web applications. The
code is typically embedded as blocks within the source of a web
page, with the output substituted into the page as it is
transmitted by the web server. This is in contrast to
applications such as CGI scripts that print output in the form
of an entire web page. The PHP style of coding is used for
highly interactive and dynamic web pages. Modern PHP programs
can also be run as command-line or GUI applications.
</p>
<p>
MySQL applications are written using one of the
<span class="bold">
<strong>
PHP APIs
</strong>
</span>
. Reusable modules can
be written in
<span class="bold">
<strong>
C
</strong>
</span>
and called from
PHP.
</p>
<p>
Another technology for writing server-side web pages with MySQL
is
<span class="bold">
<strong>
ASP.net
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_asp_net">
ASP.net
</a>
,
<a class="glossseealso" href="glossary.html#glos_c">
C
</a>
,
<a class="glossseealso" href="glossary.html#glos_php_api">
PHP API
</a>
.
</p>
</dd>
<dt>
<a name="glos_php_api">
</a>
<span class="glossterm">
PHP API
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031426416">
</a>
Several
<span class="bold">
<strong>
APIs
</strong>
</span>
are available for
writing MySQL applications in the
<span class="bold">
<strong>
PHP
</strong>
</span>
language: the original
MySQL API (
<code class="literal">
Mysql
</code>
) the MySQL Improved
Extension (
<code class="literal">
Mysqli
</code>
) the MySQL Native Driver
(
<code class="literal">
Mysqlnd
</code>
) the MySQL functions
(
<code class="literal">
PDO_MYSQL
</code>
), and Connector/PHP. For details,
see
<a class="ulink" href="/doc/apis-php/en/" target="_top">
MySQL and PHP
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
,
<a class="glossseealso" href="glossary.html#glos_php">
PHP
</a>
.
</p>
</dd>
<dt>
<a name="glos_physical">
</a>
<span class="glossterm">
physical
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031418176">
</a>
A type of operation that involves hardware-related aspects such
as disk blocks, memory pages, files, bits, disk reads, and so
on. Typically, physical aspects are important during
expert-level performance tuning and problem diagnosis. Contrast
with
<span class="bold">
<strong>
logical
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_logical">
logical
</a>
,
<a class="glossseealso" href="glossary.html#glos_physical_backup">
physical backup
</a>
.
</p>
</dd>
<dt>
<a name="glos_physical_backup">
</a>
<span class="glossterm">
physical backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031414080">
</a>
A
<span class="bold">
<strong>
backup
</strong>
</span>
that copies the actual
data files. For example, the
<span class="bold">
<strong>
<code class="literal">
mysqlbackup
</code>
</strong>
</span>
command of the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product produces a physical backup, because
its output contains data files that can be used directly by the
<code class="literal">
mysqld
</code>
server, resulting in a faster
<span class="bold">
<strong>
restore
</strong>
</span>
operation. Contrast
with
<span class="bold">
<strong>
logical backup
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_backup">
backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_logical_backup">
logical backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_restore">
restore
</a>
.
</p>
</dd>
<dt>
<a name="glos_pitr">
</a>
<span class="glossterm">
PITR
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031404992">
</a>
Acronym for
<span class="bold">
<strong>
point-in-time
recovery
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_point_in_time_recovery">
point-in-time recovery
</a>
.
</p>
</dd>
<dt>
<a name="glos_plan_stability">
</a>
<span class="glossterm">
plan stability
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031401472">
</a>
A property of a
<span class="bold">
<strong>
query execution
plan
</strong>
</span>
, where the optimizer makes the same choices each
time for a given
<span class="bold">
<strong>
query
</strong>
</span>
, so that
performance is consistent and predictable.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
,
<a class="glossseealso" href="glossary.html#glos_query_execution_plan">
query execution plan
</a>
.
</p>
</dd>
<dt>
<a name="glos_point_in_time_recovery">
</a>
<span class="glossterm">
point-in-time recovery
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031396720">
</a>
The process of restoring a
<span class="bold">
<strong>
backup
</strong>
</span>
to recreate the state of
the database at a specific date and time. Commonly abbreviated
<span class="quote">
“
<span class="quote">
PITR
</span>
”
</span>
. Because it is unlikely that the specified
time corresponds exactly to the time of a backup, this technique
usually requires a combination of a
<span class="bold">
<strong>
physical backup
</strong>
</span>
and a
<span class="bold">
<strong>
logical backup
</strong>
</span>
. For example,
with the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product, you restore the last backup that you
took before the specified point in time, then replay changes
from the
<span class="bold">
<strong>
binary log
</strong>
</span>
between the
time of the backup and the PITR time.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_backup">
backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_binary_log">
binary log
</a>
,
<a class="glossseealso" href="glossary.html#glos_logical_backup">
logical backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_physical_backup">
physical backup
</a>
.
</p>
</dd>
<dt>
<a name="glos_port">
</a>
<span class="glossterm">
port
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031387648">
</a>
The number of the TCP/IP socket the database server listens on,
used to establish a
<span class="bold">
<strong>
connection
</strong>
</span>
.
Often specified in conjunction with a
<span class="bold">
<strong>
host
</strong>
</span>
. Depending on your use of
network encryption, there might be one port for unencrypted
traffic and another port for
<span class="bold">
<strong>
SSL
</strong>
</span>
connections.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connection">
connection
</a>
,
<a class="glossseealso" href="glossary.html#glos_host">
host
</a>
,
<a class="glossseealso" href="glossary.html#glos_ssl">
SSL
</a>
.
</p>
</dd>
<dt>
<a name="glos_prefix">
</a>
<span class="glossterm">
prefix
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_index_prefix">
index prefix
</a>
.
</p>
</dd>
<dt>
<a name="glos_prepared_backup">
</a>
<span class="glossterm">
prepared backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031380368">
</a>
A set of backup files, produced by the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product, after all the stages of applying
<span class="bold">
<strong>
binary logs
</strong>
</span>
and
<span class="bold">
<strong>
incremental backups
</strong>
</span>
are
finished. The resulting files are ready to be
<span class="bold">
<strong>
restored
</strong>
</span>
. Prior to the apply
steps, the files are known as a
<span class="bold">
<strong>
raw
backup
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_binary_log">
binary log
</a>
,
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_incremental_backup">
incremental backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_raw_backup">
raw backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_restore">
restore
</a>
.
</p>
</dd>
<dt>
<a name="glos_prepared_statement">
</a>
<span class="glossterm">
prepared statement
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031371456">
</a>
An SQL statement that is analyzed in advance to determine an
efficient execution plan. It can be executed multiple times,
without the overhead for parsing and analysis each time.
Different values can be substituted for literals in the
<code class="literal">
WHERE
</code>
clause each time, through the use of
placeholders. This substitution technique improves security,
protecting against some kinds of SQL injection attacks. You can
also reduce the overhead for converting and copying return
values to program variables.
</p>
<p>
Although you can use prepared statements directly through SQL
syntax, the various
<span class="bold">
<strong>
Connectors
</strong>
</span>
have programming interfaces for manipulating prepared
statements, and these APIs are more efficient than going through
SQL.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_client_side_prepared_statement">
client-side prepared statement
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector">
connector
</a>
,
<a class="glossseealso" href="glossary.html#glos_server_side_prepared_statement">
server-side prepared statement
</a>
.
</p>
</dd>
<dt>
<a name="glos_primary_key">
</a>
<span class="glossterm">
primary key
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031364944">
</a>
A set of columns—and by implication, the index based on
this set of columns—that can uniquely identify every row
in a table. As such, it must be a unique index that does not
contain any
<code class="literal">
NULL
</code>
values.
</p>
<p>
<code class="literal">
InnoDB
</code>
requires that every table has such an
index (also called the
<span class="bold">
<strong>
clustered
index
</strong>
</span>
or
<span class="bold">
<strong>
cluster
index
</strong>
</span>
), and organizes the table storage based on the
column values of the primary key.
</p>
<p>
When choosing primary key values, consider using arbitrary
values (a
<span class="bold">
<strong>
synthetic key
</strong>
</span>
) rather
than relying on values derived from some other source (a
<span class="bold">
<strong>
natural key
</strong>
</span>
).
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_clustered_index">
clustered index
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_natural_key">
natural key
</a>
,
<a class="glossseealso" href="glossary.html#glos_synthetic_key">
synthetic key
</a>
.
</p>
</dd>
<dt>
<a name="glos_principal">
</a>
<span class="glossterm">
principal
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031354928">
</a>
The Kerberos term for a named entity, such as a user or server.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_service_principal_name">
service principal name
</a>
,
<a class="glossseealso" href="glossary.html#glos_user_principal_name">
user principal name
</a>
.
</p>
</dd>
<dt>
<a name="glos_process">
</a>
<span class="glossterm">
process
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031351712">
</a>
An instance of an executing program. The operating system
switches between multiple running processes, allowing for a
certain degree of
<span class="bold">
<strong>
concurrency
</strong>
</span>
.
On most operating systems, processes can contain multiple
<span class="bold">
<strong>
threads
</strong>
</span>
of execution that share
resources. Context-switching between threads is faster than the
equivalent switching between processes.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_thread">
thread
</a>
.
</p>
</dd>
<dt>
<a name="glos_pseudo_record">
</a>
<span class="glossterm">
pseudo-record
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031346896">
</a>
An artificial record in an index, used for
<span class="bold">
<strong>
locking
</strong>
</span>
key values or ranges
that do not currently exist.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_infimum_record">
infimum record
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_supremum_record">
supremum record
</a>
.
</p>
</dd>
<dt>
<a name="glos_pthreads">
</a>
<span class="glossterm">
Pthreads
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031342464">
</a>
The POSIX threads standard, which defines an API for threading
and locking operations on Unix and Linux systems. On Unix and
Linux systems,
<code class="literal">
InnoDB
</code>
uses this
implementation for
<span class="bold">
<strong>
mutexes
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_mutex">
mutex
</a>
.
</p>
</dd>
<dt>
<a name="glos_purge">
</a>
<span class="glossterm">
purge
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031338336">
</a>
A type of garbage collection performed by one or more separate
background threads (controlled by
<a class="link" href="innodb-parameters.html#sysvar_innodb_purge_threads">
<code class="literal">
innodb_purge_threads
</code>
</a>
) that runs
on a periodic schedule. Purge parses and processes
<span class="bold">
<strong>
undo log
</strong>
</span>
pages from the
<span class="bold">
<strong>
history list
</strong>
</span>
for the purpose of
removing clustered and secondary index records that were marked
for deletion (by previous
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
statements) and are no longer required for
<span class="bold">
<strong>
MVCC
</strong>
</span>
or
<span class="bold">
<strong>
rollback
</strong>
</span>
. Purge frees undo log
pages from the history list after processing them.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_history_list">
history list
</a>
,
<a class="glossseealso" href="glossary.html#glos_mvcc">
MVCC
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_purge_buffering">
</a>
<span class="glossterm">
purge buffering
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031328400">
</a>
The technique of storing changes to secondary index pages,
resulting from
<code class="literal">
DELETE
</code>
operations, in the
<span class="bold">
<strong>
change buffer
</strong>
</span>
rather than
writing the changes immediately, so that the physical writes can
be performed to minimize random I/O. (Because delete operations
are a two-step process, this operation buffers the write that
normally purges an index record that was previously marked for
deletion.) It is one of the types of
<span class="bold">
<strong>
change buffering
</strong>
</span>
; the others
are
<span class="bold">
<strong>
insert buffering
</strong>
</span>
and
<span class="bold">
<strong>
delete buffering
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_change_buffer">
change buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_change_buffering">
change buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_delete_buffering">
delete buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_insert_buffer">
insert buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_insert_buffering">
insert buffering
</a>
.
</p>
</dd>
<dt>
<a name="glos_purge_lag">
</a>
<span class="glossterm">
purge lag
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031319712">
</a>
Another name for the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
history list
</strong>
</span>
. Related to the
<a class="link" href="innodb-parameters.html#sysvar_innodb_max_purge_lag">
<code class="literal">
innodb_max_purge_lag
</code>
</a>
configuration option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_history_list">
history list
</a>
,
<a class="glossseealso" href="glossary.html#glos_purge">
purge
</a>
.
</p>
</dd>
<dt>
<a name="glos_purge_thread">
</a>
<span class="glossterm">
purge thread
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031313952">
</a>
A
<span class="bold">
<strong>
thread
</strong>
</span>
within the
<code class="literal">
InnoDB
</code>
process that is dedicated to
performing the periodic
<span class="bold">
<strong>
purge
</strong>
</span>
operation. In MySQL 5.6 and higher, multiple purge threads are
enabled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_purge_threads">
<code class="literal">
innodb_purge_threads
</code>
</a>
configuration option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_purge">
purge
</a>
,
<a class="glossseealso" href="glossary.html#glos_thread">
thread
</a>
.
</p>
</dd>
<dt>
<a name="glos_python">
</a>
<span class="glossterm">
Python
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031307344">
</a>
A programming language used in a broad range of fields, from
Unix scripting to large-scale applications. Includes runtime
typing, built-in high-level data types, object-oriented
features, and an extensive standard library. Often used as a
<span class="quote">
“
<span class="quote">
glue
</span>
”
</span>
language between components written in other
languages. The MySQL
<span class="bold">
<strong>
Python API
</strong>
</span>
is the open-source
<span class="bold">
<strong>
MySQLdb
</strong>
</span>
module.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_mysqldb">
MySQLdb
</a>
,
<a class="glossseealso" href="glossary.html#glos_python_api">
Python API
</a>
.
</p>
</dd>
<dt>
<a name="glos_python_api">
</a>
<span class="glossterm">
Python API
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031302000">
</a>
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
,
<a class="glossseealso" href="glossary.html#glos_python">
Python
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
Q
</h3>
<dl>
<dt>
<a name="glos_query">
</a>
<span class="glossterm">
query
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031298480">
</a>
In
<span class="bold">
<strong>
SQL
</strong>
</span>
, an operation that reads
information from one or more
<span class="bold">
<strong>
tables
</strong>
</span>
. Depending on the
organization of data and the parameters of the query, the lookup
might be optimized by consulting an
<span class="bold">
<strong>
index
</strong>
</span>
. If multiple tables are
involved, the query is known as a
<span class="bold">
<strong>
join
</strong>
</span>
.
</p>
<p>
For historical reasons, sometimes discussions of internal
processing for statements use
<span class="quote">
“
<span class="quote">
query
</span>
”
</span>
in a broader
sense, including other types of MySQL statements such as
<span class="bold">
<strong>
DDL
</strong>
</span>
and
<span class="bold">
<strong>
DML
</strong>
</span>
statements.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_join">
join
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_query_execution_plan">
</a>
<span class="glossterm">
query execution plan
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031287824">
</a>
The set of decisions made by the optimizer about how to perform
a
<span class="bold">
<strong>
query
</strong>
</span>
most efficiently,
including which
<span class="bold">
<strong>
index
</strong>
</span>
or
indexes to use, and the order in which to
<span class="bold">
<strong>
join
</strong>
</span>
tables.
<span class="bold">
<strong>
Plan stability
</strong>
</span>
involves the
same choices being made consistently for a given query.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_join">
join
</a>
,
<a class="glossseealso" href="glossary.html#glos_plan_stability">
plan stability
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
.
</p>
</dd>
<dt>
<a name="glos_query_log">
</a>
<span class="glossterm">
query log
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_general_query_log">
general query log
</a>
.
</p>
</dd>
<dt>
<a name="glos_quiesce">
</a>
<span class="glossterm">
quiesce
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031279264">
</a>
To reduce the amount of database activity, often in preparation
for an operation such as an
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER
TABLE
</code>
</a>
, a
<span class="bold">
<strong>
backup
</strong>
</span>
, or a
<span class="bold">
<strong>
shutdown
</strong>
</span>
. Might or might not
involve doing as much
<span class="bold">
<strong>
flushing
</strong>
</span>
as possible, so that
<span class="bold">
<strong>
InnoDB
</strong>
</span>
does not continue doing background I/O.
</p>
<p>
In MySQL 5.6 and higher, the syntax
<code class="literal">
FLUSH TABLES ...
FOR EXPORT
</code>
writes some data to disk for
<code class="literal">
InnoDB
</code>
tables that make it simpler to back up
those tables by copying the data files.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_backup">
backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_shutdown">
shutdown
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
R
</h3>
<dl>
<dt>
<a name="glos_r_tree">
</a>
<span class="glossterm">
R-tree
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031268272">
</a>
A tree data structure used for spatial indexing of
multi-dimensional data such as geographical coordinates,
rectangles or polygons.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_b_tree">
B-tree
</a>
.
</p>
</dd>
<dt>
<a name="glos_raid">
</a>
<span class="glossterm">
RAID
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031265488">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
Redundant Array of Inexpensive
Drives
</span>
”
</span>
. Spreading I/O operations across multiple drives
enables greater
<span class="bold">
<strong>
concurrency
</strong>
</span>
at
the hardware level, and improves the efficiency of low-level
write operations that otherwise would be performed in sequence.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
.
</p>
</dd>
<dt>
<a name="glos_random_dive">
</a>
<span class="glossterm">
random dive
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031261504">
</a>
A technique for quickly estimating the number of different
values in a column (the column's
<span class="bold">
<strong>
cardinality
</strong>
</span>
).
<code class="literal">
InnoDB
</code>
samples pages at random from the index
and uses that data to estimate the number of different values.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cardinality">
cardinality
</a>
.
</p>
</dd>
<dt>
<a name="glos_raw_backup">
</a>
<span class="glossterm">
raw backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031257280">
</a>
The initial set of backup files produced by the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product, before the changes reflected in the
<span class="bold">
<strong>
binary log
</strong>
</span>
and any
<span class="bold">
<strong>
incremental backups
</strong>
</span>
are
applied. At this stage, the files are not ready to
<span class="bold">
<strong>
restore
</strong>
</span>
. After these changes
are applied, the files are known as a
<span class="bold">
<strong>
prepared backup
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_binary_log">
binary log
</a>
,
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibbackup_logfile">
ibbackup_logfile
</a>
,
<a class="glossseealso" href="glossary.html#glos_incremental_backup">
incremental backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_prepared_backup">
prepared backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_restore">
restore
</a>
.
</p>
</dd>
<dt>
<a name="glos_read_committed">
</a>
<span class="glossterm">
READ COMMITTED
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031247760">
</a>
An
<span class="bold">
<strong>
isolation level
</strong>
</span>
that uses a
<span class="bold">
<strong>
locking
</strong>
</span>
strategy that relaxes
some of the protection between
<span class="bold">
<strong>
transactions
</strong>
</span>
, in the interest
of performance. Transactions cannot see uncommitted data from
other transactions, but they can see data that is committed by
another transaction after the current transaction started. Thus,
a transaction never sees any bad data, but the data that it does
see may depend to some extent on the timing of other
transactions.
</p>
<p>
When a transaction with this isolation level performs
<code class="literal">
UPDATE ... WHERE
</code>
or
<code class="literal">
DELETE ...
WHERE
</code>
operations, other transactions might have to
wait. The transaction can perform
<code class="literal">
SELECT ... FOR
UPDATE
</code>
, and
<code class="literal">
LOCK IN SHARE MODE
</code>
operations without making other transactions wait.
</p>
<p>
<code class="literal">
SELECT ... FOR SHARE
</code>
replaces
<code class="literal">
SELECT
... LOCK IN SHARE MODE
</code>
in MySQL 8.0.1, but
<code class="literal">
LOCK IN SHARE MODE
</code>
remains available for
backward compatibility.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_repeatable_read">
REPEATABLE READ
</a>
,
<a class="glossseealso" href="glossary.html#glos_serializable">
SERIALIZABLE
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_read_phenomena">
</a>
<span class="glossterm">
read phenomena
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031233840">
</a>
Phenomena such as
<span class="bold">
<strong>
dirty reads
</strong>
</span>
,
<span class="bold">
<strong>
non-repeatable reads
</strong>
</span>
, and
<span class="bold">
<strong>
phantom
</strong>
</span>
reads which can occur
when a transaction reads data that another transaction has
modified.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_dirty_read">
dirty read
</a>
,
<a class="glossseealso" href="glossary.html#glos_non_repeatable_read">
non-repeatable read
</a>
,
<a class="glossseealso" href="glossary.html#glos_phantom">
phantom
</a>
.
</p>
</dd>
<dt>
<a name="glos_read_uncommitted">
</a>
<span class="glossterm">
READ UNCOMMITTED
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031227920">
</a>
The
<span class="bold">
<strong>
isolation level
</strong>
</span>
that
provides the least amount of protection between transactions.
Queries employ a
<span class="bold">
<strong>
locking
</strong>
</span>
strategy that allows them to proceed in situations where they
would normally wait for another transaction. However, this extra
performance comes at the cost of less reliable results,
including data that has been changed by other transactions and
not committed yet (known as
<span class="bold">
<strong>
dirty
read
</strong>
</span>
). Use this isolation level with great caution,
and be aware that the results might not be consistent or
reproducible, depending on what other transactions are doing at
the same time. Typically, transactions with this isolation level
only do queries, not insert, update, or delete operations.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_dirty_read">
dirty read
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_read_view">
</a>
<span class="glossterm">
read view
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031220176">
</a>
An internal snapshot used by the
<span class="bold">
<strong>
MVCC
</strong>
</span>
mechanism of
<code class="literal">
InnoDB
</code>
. Certain
<span class="bold">
<strong>
transactions
</strong>
</span>
, depending on
their
<span class="bold">
<strong>
isolation level
</strong>
</span>
, see the
data values as they were at the time the transaction (or in some
cases, the statement) started. Isolation levels that use a read
view are
<span class="bold">
<strong>
REPEATABLE READ
</strong>
</span>
,
<span class="bold">
<strong>
READ COMMITTED
</strong>
</span>
, and
<span class="bold">
<strong>
READ UNCOMMITTED
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_mvcc">
MVCC
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_committed">
READ COMMITTED
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_uncommitted">
READ UNCOMMITTED
</a>
,
<a class="glossseealso" href="glossary.html#glos_repeatable_read">
REPEATABLE READ
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_read_ahead">
</a>
<span class="glossterm">
read-ahead
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031209840">
</a>
A type of I/O request that prefetches a group of
<span class="bold">
<strong>
pages
</strong>
</span>
(an entire
<span class="bold">
<strong>
extent
</strong>
</span>
) into the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
asynchronously, in
case these pages are needed soon. The linear read-ahead
technique prefetches all the pages of one extent based on access
patterns for pages in the preceding extent. The random
read-ahead technique prefetches all the pages for an extent once
a certain number of pages from the same extent are in the buffer
pool. Random read-ahead is not part of MySQL 5.5, but is
re-introduced in MySQL 5.6 under the control of the
<a class="link" href="innodb-parameters.html#sysvar_innodb_random_read_ahead">
<code class="literal">
innodb_random_read_ahead
</code>
</a>
configuration option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_extent">
extent
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
.
</p>
</dd>
<dt>
<a name="glos_read_only_transaction">
</a>
<span class="glossterm">
read-only transaction
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031202160">
</a>
A type of
<span class="bold">
<strong>
transaction
</strong>
</span>
that can
be optimized for
<code class="literal">
InnoDB
</code>
tables by eliminating
some of the bookkeeping involved with creating a
<span class="bold">
<strong>
read view
</strong>
</span>
for each transaction.
Can only perform
<span class="bold">
<strong>
non-locking
read
</strong>
</span>
queries. It can be started explicitly with the
syntax
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
START TRANSACTION
READ ONLY
</code>
</a>
, or automatically under certain conditions.
See
<a class="xref" href="innodb-performance-ro-txn.html" title="10.5.3 Optimizing InnoDB Read-Only Transactions">
Section 10.5.3, “Optimizing InnoDB Read-Only Transactions”
</a>
for details.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_non_locking_read">
non-locking read
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_view">
read view
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_record_lock">
</a>
<span class="glossterm">
record lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031193520">
</a>
A
<a class="link" href="glossary.html#glos_lock" title="lock">
lock
</a>
on an index record. For
example,
<code class="literal">
SELECT c1 FROM t WHERE c1 = 10 FOR
UPDATE;
</code>
prevents any other transaction from inserting,
updating, or deleting rows where the value of
<code class="literal">
t.c1
</code>
is 10. Contrast with
<span class="bold">
<strong>
gap lock
</strong>
</span>
and
<span class="bold">
<strong>
next-key lock
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_gap_lock">
gap lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_next_key_lock">
next-key lock
</a>
.
</p>
</dd>
<dt>
<a name="glos_redo">
</a>
<span class="glossterm">
redo
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031186032">
</a>
The data, in units of records, recorded in the
<span class="bold">
<strong>
redo log
</strong>
</span>
when
<a class="link" href="glossary.html#glos_dml" title="DML">
DML
</a>
statements make changes to
<code class="literal">
InnoDB
</code>
tables. It is used during
<span class="bold">
<strong>
crash recovery
</strong>
</span>
to correct data
written by incomplete
<span class="bold">
<strong>
transactions
</strong>
</span>
. The
ever-increasing
<span class="bold">
<strong>
LSN
</strong>
</span>
value
represents the cumulative amount of redo data that has passed
through the redo log.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_crash_recovery">
crash recovery
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_lsn">
LSN
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_redo_log">
</a>
<span class="glossterm">
redo log
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031176864">
</a>
A disk-based data structure used during
<span class="bold">
<strong>
crash recovery
</strong>
</span>
, to correct data
written by incomplete
<span class="bold">
<strong>
transactions
</strong>
</span>
. During normal
operation, it encodes requests to change
<code class="literal">
InnoDB
</code>
table data, which result from SQL
statements or low-level API calls. Modifications that did not
finish updating the
<span class="bold">
<strong>
data files
</strong>
</span>
before an unexpected
<span class="bold">
<strong>
shutdown
</strong>
</span>
are replayed automatically.
</p>
<p>
The redo log is physically represented on disk as a set of redo
log files. Redo log data is encoded in terms of records
affected; this data is collectively referred to as
<span class="bold">
<strong>
redo
</strong>
</span>
. The passage of data
through the redo log is represented by an ever-increasing
<span class="bold">
<strong>
LSN
</strong>
</span>
value.
</p>
<p>
For more information, see
<a class="xref" href="innodb-redo-log.html" title="17.6.5 Redo Log">
Section 17.6.5, “Redo Log”
</a>
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_crash_recovery">
crash recovery
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_ib_logfile">
ib_logfile
</a>
,
<a class="glossseealso" href="glossary.html#glos_log_buffer">
log buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_lsn">
LSN
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo">
redo
</a>
,
<a class="glossseealso" href="glossary.html#glos_shutdown">
shutdown
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_redo_log_archiving">
</a>
<span class="glossterm">
redo log archiving
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031163488">
</a>
An
<code class="literal">
InnoDB
</code>
feature that, when enabled,
sequentially writes redo log records to an archive file to avoid
potential loss of data than can occur when a backup utility
fails to keep pace with redo log generation while a backup
operation is in progress. For more information, see
<a class="xref" href="innodb-redo-log.html#innodb-redo-log-archiving" title="Redo Log Archiving">
Redo Log Archiving
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_redundant_row_format">
</a>
<span class="glossterm">
redundant row format
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031159104">
</a>
The oldest
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
row
format
</strong>
</span>
. Prior to MySQL 5.0.3, it was the only row
format available in
<code class="literal">
InnoDB
</code>
. From MySQL 5.0.3
to MySQL 5.7.8, the default row format is
<span class="bold">
<strong>
COMPACT
</strong>
</span>
. As of MySQL 5.7.9, the
default row format is defined by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_default_row_format">
<code class="literal">
innodb_default_row_format
</code>
</a>
configuration option, which has a default setting of
<span class="bold">
<strong>
DYNAMIC
</strong>
</span>
. You can still specify
the
<span class="bold">
<strong>
REDUNDANT
</strong>
</span>
row format for
compatibility with older
<code class="literal">
InnoDB
</code>
tables.
</p>
<p>
For more information, see
<a class="xref" href="innodb-row-format.html" title="17.10 InnoDB Row Formats">
Section 17.10, “InnoDB Row Formats”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_compact_row_format">
compact row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_dynamic_row_format">
dynamic row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_format">
row format
</a>
.
</p>
</dd>
<dt>
<a name="glos_referential_integrity">
</a>
<span class="glossterm">
referential integrity
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031147776">
</a>
The technique of maintaining data always in a consistent format,
part of the
<span class="bold">
<strong>
ACID
</strong>
</span>
philosophy. In
particular, data in different tables is kept consistent through
the use of
<span class="bold">
<strong>
foreign key
constraints
</strong>
</span>
, which can prevent changes from happening
or automatically propagate those changes to all related tables.
Related mechanisms include the
<span class="bold">
<strong>
unique
constraint
</strong>
</span>
, which prevents duplicate values from
being inserted by mistake, and the
<span class="bold">
<strong>
NOT
NULL constraint
</strong>
</span>
, which prevents blank values from
being inserted by mistake.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_foreign_key_constraint">
FOREIGN KEY constraint
</a>
,
<a class="glossseealso" href="glossary.html#glos_not_null_constraint">
NOT NULL constraint
</a>
,
<a class="glossseealso" href="glossary.html#glos_unique_constraint">
unique constraint
</a>
.
</p>
</dd>
<dt>
<a name="glos_relational">
</a>
<span class="glossterm">
relational
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031140256">
</a>
An important aspect of modern database systems. The database
server encodes and enforces relationships such as one-to-one,
one-to-many, many-to-one, and uniqueness. For example, a person
might have zero, one, or many phone numbers in an address
database; a single phone number might be associated with several
family members. In a financial database, a person might be
required to have exactly one taxpayer ID, and any taxpayer ID
could only be associated with one person.
</p>
<p>
The database server can use these relationships to prevent bad
data from being inserted, and to find efficient ways to look up
information. For example, if a value is declared to be unique,
the server can stop searching as soon as the first match is
found, and it can reject attempts to insert a second copy of the
same value.
</p>
<p>
At the database level, these relationships are expressed through
SQL features such as
<span class="bold">
<strong>
columns
</strong>
</span>
within a table, unique and
<code class="literal">
NOT NULL
</code>
<span class="bold">
<strong>
constraints
</strong>
</span>
,
<span class="bold">
<strong>
foreign keys
</strong>
</span>
, and different
kinds of join operations. Complex relationships typically
involve data split between more than one table. Often, the data
is
<span class="bold">
<strong>
normalized
</strong>
</span>
, so that
duplicate values in one-to-many relationships are stored only
once.
</p>
<p>
In a mathematical context, the relations within a database are
derived from set theory. For example, the
<code class="literal">
OR
</code>
and
<code class="literal">
AND
</code>
operators of a
<code class="literal">
WHERE
</code>
clause represent the notions of union
and intersection.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_column">
column
</a>
,
<a class="glossseealso" href="glossary.html#glos_constraint">
constraint
</a>
,
<a class="glossseealso" href="glossary.html#glos_foreign_key">
foreign key
</a>
,
<a class="glossseealso" href="glossary.html#glos_normalized">
normalized
</a>
.
</p>
</dd>
<dt>
<a name="glos_relevance">
</a>
<span class="glossterm">
relevance
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031127264">
</a>
In the
<span class="bold">
<strong>
full-text search
</strong>
</span>
feature, a number signifying the similarity between the search
string and the data in the
<span class="bold">
<strong>
FULLTEXT
index
</strong>
</span>
. For example, when you search for a single
word, that word is typically more relevant for a row where it
occurs several times in the text than a row where it appears
only once.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_full_text_search">
full-text search
</a>
,
<a class="glossseealso" href="glossary.html#glos_fulltext_index">
FULLTEXT index
</a>
.
</p>
</dd>
<dt>
<a name="glos_repeatable_read">
</a>
<span class="glossterm">
REPEATABLE READ
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031122432">
</a>
The default
<span class="bold">
<strong>
isolation level
</strong>
</span>
for
<code class="literal">
InnoDB
</code>
. It prevents any rows that are queried
from being changed by other
<span class="bold">
<strong>
transactions
</strong>
</span>
, thus blocking
<span class="bold">
<strong>
non-repeatable reads
</strong>
</span>
but not
<span class="bold">
<strong>
phantom
</strong>
</span>
reads. It uses a
moderately strict
<span class="bold">
<strong>
locking
</strong>
</span>
strategy so that all queries within a transaction see data from
the same snapshot, that is, the data as it was at the time the
transaction started.
</p>
<p>
When a transaction with this isolation level performs
<code class="literal">
UPDATE ... WHERE
</code>
,
<code class="literal">
DELETE ...
WHERE
</code>
,
<code class="literal">
SELECT ... FOR UPDATE
</code>
, and
<code class="literal">
LOCK IN SHARE MODE
</code>
operations, other
transactions might have to wait.
</p>
<p>
<code class="literal">
SELECT ... FOR SHARE
</code>
replaces
<code class="literal">
SELECT
... LOCK IN SHARE MODE
</code>
in MySQL 8.0.1, but
<code class="literal">
LOCK IN SHARE MODE
</code>
remains available for
backward compatibility.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_consistent_read">
consistent read
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_phantom">
phantom
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_repertoire">
</a>
<span class="glossterm">
repertoire
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031106720">
</a>
Repertoire is a term applied to character sets. A character set
repertoire is the collection of characters in the set. See
<a class="xref" href="charset-repertoire.html" title="12.2.1 Character Set Repertoire">
Section 12.2.1, “Character Set Repertoire”
</a>
.
</p>
</dd>
<dt>
<a name="glos_replica">
</a>
<span class="glossterm">
replica
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031103840">
</a>
A database
<span class="bold">
<strong>
server
</strong>
</span>
machine in a
<span class="bold">
<strong>
replication
</strong>
</span>
topology that
receives changes from another server (the
<span class="bold">
<strong>
source
</strong>
</span>
) and applies those same
changes. Thus it maintains the same contents as the source,
although it might lag somewhat behind.
</p>
<p>
In MySQL, replicas are commonly used in disaster recovery, to
take the place of a source that fails. They are also commonly
used for testing software upgrades and new settings, to ensure
that database configuration changes do not cause problems with
performance or reliability.
</p>
<p>
Replicas typically have high workloads, because they process all
the
<span class="bold">
<strong>
DML
</strong>
</span>
(write) operations
relayed from the source, as well as user queries. To ensure that
replicas can apply changes from the source fast enough, they
frequently have fast I/O devices and sufficient CPU and memory
to run multiple database instances on the same server. For
example, the source might use hard drive storage while the
replicas use
<span class="bold">
<strong>
SSD
</strong>
</span>
s.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_replication">
replication
</a>
,
<a class="glossseealso" href="glossary.html#glos_server">
server
</a>
,
<a class="glossseealso" href="glossary.html#glos_source">
source
</a>
,
<a class="glossseealso" href="glossary.html#glos_ssd">
SSD
</a>
.
</p>
</dd>
<dt>
<a name="glos_replication">
</a>
<span class="glossterm">
replication
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031093968">
</a>
The practice of sending changes from a
<span class="bold">
<strong>
source
</strong>
</span>
, to one or more
<span class="bold">
<strong>
replicas
</strong>
</span>
, so that all databases
have the same data. This technique has a wide range of uses,
such as load-balancing for better scalability, disaster
recovery, and testing software upgrades and configuration
changes. The changes can be sent between the databases by
methods called
<span class="bold">
<strong>
row-based
replication
</strong>
</span>
and
<span class="bold">
<strong>
statement-based
replication
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_replica">
replica
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_based_replication">
row-based replication
</a>
,
<a class="glossseealso" href="glossary.html#glos_source">
source
</a>
,
<a class="glossseealso" href="glossary.html#glos_statement_based_replication">
statement-based replication
</a>
.
</p>
</dd>
<dt>
<a name="glos_restore">
</a>
<span class="glossterm">
restore
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031086448">
</a>
The process of putting a set of backup files from the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product
in place for use by MySQL. This operation can be performed to
fix a corrupted database, to return to some earlier point in
time, or (in a
<span class="bold">
<strong>
replication
</strong>
</span>
context) to set up a new
<span class="bold">
<strong>
replica
</strong>
</span>
. In the
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product, this operation is performed by the
<code class="literal">
copy-back
</code>
option of the
<code class="literal">
mysqlbackup
</code>
command.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqlbackup_command">
mysqlbackup command
</a>
,
<a class="glossseealso" href="glossary.html#glos_prepared_backup">
prepared backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_replica">
replica
</a>
,
<a class="glossseealso" href="glossary.html#glos_replication">
replication
</a>
.
</p>
</dd>
<dt>
<a name="glos_rollback">
</a>
<span class="glossterm">
rollback
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031076736">
</a>
A
<span class="bold">
<strong>
SQL
</strong>
</span>
statement that ends a
<span class="bold">
<strong>
transaction
</strong>
</span>
, undoing any
changes made by the transaction. It is the opposite of
<span class="bold">
<strong>
commit
</strong>
</span>
, which makes permanent
any changes made in the transaction.
</p>
<p>
By default, MySQL uses the
<span class="bold">
<strong>
autocommit
</strong>
</span>
setting, which
automatically issues a commit following each SQL statement. You
must change this setting before you can use the rollback
technique.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_autocommit">
autocommit
</a>
,
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_rollback_segment">
</a>
<span class="glossterm">
rollback segment
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031068496">
</a>
The storage area containing the
<span class="bold">
<strong>
undo
logs
</strong>
</span>
. Rollback segments have traditionally resided in
the
<span class="bold">
<strong>
system tablespace
</strong>
</span>
. As of
MySQL 5.6, rollback segments can reside in
<span class="bold">
<strong>
undo tablespaces
</strong>
</span>
. As of MySQL
5.7, rollback segments are also allocated to the
<span class="emphasis">
<em>
global temporary tablespace
</em>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_global_temporary_tablespace">
global temporary tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_tablespace">
undo tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_row">
</a>
<span class="glossterm">
row
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031061520">
</a>
The logical data structure defined by a set of
<span class="bold">
<strong>
columns
</strong>
</span>
. A set of rows makes up
a
<span class="bold">
<strong>
table
</strong>
</span>
. Within
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
data
files
</strong>
</span>
, each
<span class="bold">
<strong>
page
</strong>
</span>
can
contain one or more rows.
</p>
<p>
Although
<code class="literal">
InnoDB
</code>
uses the term
<span class="bold">
<strong>
row format
</strong>
</span>
for consistency with
MySQL syntax, the row format is a property of each table and
applies to all rows in that table.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_column">
column
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_format">
row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_row_format">
</a>
<span class="glossterm">
row format
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031051360">
</a>
The disk storage format for
<span class="bold">
<strong>
rows
</strong>
</span>
of an
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
table
</strong>
</span>
. As
<code class="literal">
InnoDB
</code>
gains new capabilities such as
<span class="bold">
<strong>
compression
</strong>
</span>
, new row formats
are introduced to support the resulting improvements in storage
efficiency and performance.
</p>
<p>
The row format of an
<code class="literal">
InnoDB
</code>
table is
specified by the
<code class="literal">
ROW_FORMAT
</code>
option or by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_default_row_format">
<code class="literal">
innodb_default_row_format
</code>
</a>
configuration option (introduced in MySQL 5.7.9). Row formats
include
<code class="literal">
REDUNDANT
</code>
,
<code class="literal">
COMPACT
</code>
,
<code class="literal">
COMPRESSED
</code>
, and
<code class="literal">
DYNAMIC
</code>
. To view the row format of an
<code class="literal">
InnoDB
</code>
table, issue the
<a class="link" href="show-table-status.html" title="15.7.7.38 SHOW TABLE STATUS Statement">
<code class="literal">
SHOW TABLE STATUS
</code>
</a>
statement or
query
<code class="literal">
InnoDB
</code>
table metadata in the
<a class="link" href="information-schema.html" title="Chapter 28 INFORMATION_SCHEMA Tables">
<code class="literal">
INFORMATION_SCHEMA
</code>
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_compact_row_format">
compact row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_compressed_row_format">
compressed row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_compression">
compression
</a>
,
<a class="glossseealso" href="glossary.html#glos_dynamic_row_format">
dynamic row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_redundant_row_format">
redundant row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_row">
row
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_row_lock">
</a>
<span class="glossterm">
row lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031031824">
</a>
A
<span class="bold">
<strong>
lock
</strong>
</span>
that prevents a row from
being accessed in an incompatible way by another
<span class="bold">
<strong>
transaction
</strong>
</span>
. Other rows in the
same table can be freely written to by other transactions. This
is the type of
<span class="bold">
<strong>
locking
</strong>
</span>
done by
<span class="bold">
<strong>
DML
</strong>
</span>
operations on
<span class="bold">
<strong>
InnoDB
</strong>
</span>
tables.
</p>
<p>
Contrast with
<span class="bold">
<strong>
table locks
</strong>
</span>
used
by
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
, or during
<span class="bold">
<strong>
DDL
</strong>
</span>
operations on
<code class="literal">
InnoDB
</code>
tables that cannot be done with
<span class="bold">
<strong>
online DDL
</strong>
</span>
; those locks block
concurrent access to the table.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_online_ddl">
online DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_table_lock">
table lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_row_based_replication">
</a>
<span class="glossterm">
row-based replication
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031017312">
</a>
A form of
<span class="bold">
<strong>
replication
</strong>
</span>
where
events are propagated from the
<span class="bold">
<strong>
source
</strong>
</span>
specifying how to change
individual rows on the
<span class="bold">
<strong>
replica
</strong>
</span>
.
It is safe to use for all settings of the
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode
</code>
</a>
option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_auto_increment_locking">
auto-increment locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_autoinc_lock_mode">
innodb_autoinc_lock_mode
</a>
,
<a class="glossseealso" href="glossary.html#glos_replica">
replica
</a>
,
<a class="glossseealso" href="glossary.html#glos_replication">
replication
</a>
,
<a class="glossseealso" href="glossary.html#glos_source">
source
</a>
,
<a class="glossseealso" href="glossary.html#glos_statement_based_replication">
statement-based replication
</a>
.
</p>
</dd>
<dt>
<a name="glos_row_level_locking">
</a>
<span class="glossterm">
row-level locking
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031008496">
</a>
The
<span class="bold">
<strong>
locking
</strong>
</span>
mechanism used for
<span class="bold">
<strong>
InnoDB
</strong>
</span>
tables, relying on
<span class="bold">
<strong>
row locks
</strong>
</span>
rather than
<span class="bold">
<strong>
table locks
</strong>
</span>
. Multiple
<span class="bold">
<strong>
transactions
</strong>
</span>
can modify the
same table concurrently. Only if two transactions try to modify
the same row does one of the transactions wait for the other to
complete (and release its row locks).
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_lock">
row lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_table_lock">
table lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_ruby">
</a>
<span class="glossterm">
Ruby
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045031000048">
</a>
A programming language that emphasizes dynamic typing and
object-oriented programming. Some syntax is familiar to
<span class="bold">
<strong>
Perl
</strong>
</span>
developers.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
,
<a class="glossseealso" href="glossary.html#glos_perl">
Perl
</a>
,
<a class="glossseealso" href="glossary.html#glos_ruby_api">
Ruby API
</a>
.
</p>
</dd>
<dt>
<a name="glos_ruby_api">
</a>
<span class="glossterm">
Ruby API
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030995648">
</a>
<code class="literal">
mysql2
</code>
, based based on the
<span class="bold">
<strong>
libmysqlclient
</strong>
</span>
API library, is
available for Ruby programmers developing MySQL applications.
For more information, see
<a class="xref" href="apis-ruby.html" title="31.11 MySQL Ruby APIs">
Section 31.11, “MySQL Ruby APIs”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_libmysql">
libmysql
</a>
,
<a class="glossseealso" href="glossary.html#glos_ruby">
Ruby
</a>
.
</p>
</dd>
<dt>
<a name="glos_rw_lock">
</a>
<span class="glossterm">
rw-lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030990208">
</a>
The low-level object that
<code class="literal">
InnoDB
</code>
uses to
represent and enforce shared-access
<span class="bold">
<strong>
locks
</strong>
</span>
to internal in-memory
data structures following certain rules. Contrast with
<span class="bold">
<strong>
mutexes
</strong>
</span>
, which
<code class="literal">
InnoDB
</code>
uses to represent and enforce
exclusive access to internal in-memory data structures. Mutexes
and rw-locks are known collectively as
<span class="bold">
<strong>
latches
</strong>
</span>
.
</p>
<p>
<code class="literal">
rw-lock
</code>
types include
<code class="literal">
s-locks
</code>
(shared locks),
<code class="literal">
x-locks
</code>
(exclusive locks), and
<code class="literal">
sx-locks
</code>
(shared-exclusive locks).
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
An
<code class="literal">
s-lock
</code>
provides read access to a
common resource.
</p>
</li>
<li class="listitem">
<p>
An
<code class="literal">
x-lock
</code>
provides write access to a
common resource while not permitting inconsistent reads by
other threads.
</p>
</li>
<li class="listitem">
<p>
An
<code class="literal">
sx-lock
</code>
provides write access to a
common resource while permitting inconsistent reads by other
threads.
<code class="literal">
sx-locks
</code>
were introduced in
MySQL 5.7 to optimize concurrency and improve scalability
for read-write workloads.
</p>
</li>
</ul>
</div>
<p>
The following matrix summarizes rw-lock type compatibility.
</p>
<div class="informaltable">
<table summary="Compatibility matrix for rw-lock types. Each cell in the matrix is marked as either Compatible or Conflict.">
<colgroup>
<col style="width: 20%"/>
<col style="width: 20%"/>
<col style="width: 20%"/>
<col style="width: 20%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
</th>
<th scope="col">
<em class="replaceable">
<code>
S
</code>
</em>
</th>
<th scope="col">
<em class="replaceable">
<code>
SX
</code>
</em>
</th>
<th scope="col">
<em class="replaceable">
<code>
X
</code>
</em>
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<em class="replaceable">
<code>
S
</code>
</em>
</th>
<td>
Compatible
</td>
<td>
Compatible
</td>
<td>
Conflict
</td>
</tr>
<tr>
<th scope="row">
<em class="replaceable">
<code>
SX
</code>
</em>
</th>
<td>
Compatible
</td>
<td>
Conflict
</td>
<td>
Conflict
</td>
</tr>
<tr>
<th scope="row">
<em class="replaceable">
<code>
X
</code>
</em>
</th>
<td>
Conflict
</td>
<td>
Conflict
</td>
<td>
Conflict
</td>
</tr>
</tbody>
</table>
</div>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_latch">
latch
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_mutex">
mutex
</a>
,
<a class="glossseealso" href="glossary.html#glos_performance_schema">
Performance Schema
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
S
</h3>
<dl>
<dt>
<a name="glos_savepoint">
</a>
<span class="glossterm">
savepoint
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030949024">
</a>
Savepoints help to implement nested
<span class="bold">
<strong>
transactions
</strong>
</span>
. They can be used
to provide scope to operations on tables that are part of a
larger transaction. For example, scheduling a trip in a
reservation system might involve booking several different
flights; if a desired flight is unavailable, you might
<span class="bold">
<strong>
roll back
</strong>
</span>
the changes involved
in booking that one leg, without rolling back the earlier
flights that were successfully booked.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_scalability">
</a>
<span class="glossterm">
scalability
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030944048">
</a>
The ability to add more work and issue more simultaneous
requests to a system, without a sudden drop in performance due
to exceeding the limits of system capacity. Software
architecture, hardware configuration, application coding, and
type of workload all play a part in scalability. When the system
reaches its maximum capacity, popular techniques for increasing
scalability are
<span class="bold">
<strong>
scale up
</strong>
</span>
(increasing the capacity of existing hardware or software) and
<span class="bold">
<strong>
scale out
</strong>
</span>
(adding new servers
and more instances of MySQL). Often paired with
<span class="bold">
<strong>
availability
</strong>
</span>
as critical
aspects of a large-scale deployment.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_availability">
availability
</a>
,
<a class="glossseealso" href="glossary.html#glos_scale_out">
scale out
</a>
,
<a class="glossseealso" href="glossary.html#glos_scale_up">
scale up
</a>
.
</p>
</dd>
<dt>
<a name="glos_scale_out">
</a>
<span class="glossterm">
scale out
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030937264">
</a>
A technique for increasing
<span class="bold">
<strong>
scalability
</strong>
</span>
by adding new
servers and more instances of MySQL. For example, setting up
replication, NDB Cluster, connection pooling, or other features
that spread work across a group of servers. Contrast with
<span class="bold">
<strong>
scale up
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_scalability">
scalability
</a>
,
<a class="glossseealso" href="glossary.html#glos_scale_up">
scale up
</a>
.
</p>
</dd>
<dt>
<a name="glos_scale_up">
</a>
<span class="glossterm">
scale up
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030932544">
</a>
A technique for increasing
<span class="bold">
<strong>
scalability
</strong>
</span>
by increasing the
capacity of existing hardware or software. For example,
increasing the memory on a server and adjusting memory-related
parameters such as
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_size">
<code class="literal">
innodb_buffer_pool_size
</code>
</a>
and
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_instances">
<code class="literal">
innodb_buffer_pool_instances
</code>
</a>
.
Contrast with
<span class="bold">
<strong>
scale out
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_scalability">
scalability
</a>
,
<a class="glossseealso" href="glossary.html#glos_scale_out">
scale out
</a>
.
</p>
</dd>
<dt>
<a name="glos_schema">
</a>
<span class="glossterm">
schema
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030925232">
</a>
Conceptually, a schema is a set of interrelated database
objects, such as tables, table columns, data types of the
columns, indexes, foreign keys, and so on. These objects are
connected through SQL syntax, because the columns make up the
tables, the foreign keys refer to tables and columns, and so on.
Ideally, they are also connected logically, working together as
part of a unified application or flexible framework. For
example, the
<span class="bold">
<strong>
INFORMATION_SCHEMA
</strong>
</span>
and
<span class="bold">
<strong>
performance_schema
</strong>
</span>
databases use
<span class="quote">
“
<span class="quote">
schema
</span>
”
</span>
in their names to emphasize
the close relationships between the tables and columns they
contain.
</p>
<p>
In MySQL, physically, a
<span class="bold">
<strong>
schema
</strong>
</span>
is synonymous with a
<span class="bold">
<strong>
database
</strong>
</span>
.
You can substitute the keyword
<code class="literal">
SCHEMA
</code>
instead
of
<code class="literal">
DATABASE
</code>
in MySQL SQL syntax, for example
using
<code class="literal">
CREATE SCHEMA
</code>
instead of
<code class="literal">
CREATE DATABASE
</code>
.
</p>
<p>
Some other database products draw a distinction. For example, in
the Oracle Database product, a
<span class="bold">
<strong>
schema
</strong>
</span>
represents only a part
of a database: the tables and other objects owned by a single
user.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_database">
database
</a>
,
<a class="glossseealso" href="glossary.html#glos_information_schema">
INFORMATION_SCHEMA
</a>
,
<a class="glossseealso" href="glossary.html#glos_performance_schema">
Performance Schema
</a>
.
</p>
</dd>
<dt>
<a name="glos_sdi">
</a>
<span class="glossterm">
SDI
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030912912">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
serialized dictionary information
</span>
”
</span>
.
</p>
<a class="indexterm" name="idm46045030911536">
</a>
<a class="indexterm" name="idm46045030910496">
</a>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_serialized_dictionary_information">
serialized dictionary information (SDI)
</a>
.
</p>
</dd>
<dt>
<a name="glos_search_index">
</a>
<span class="glossterm">
search index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030907392">
</a>
In MySQL,
<span class="bold">
<strong>
full-text search
</strong>
</span>
queries use a special kind of index, the
<span class="bold">
<strong>
FULLTEXT index
</strong>
</span>
. In MySQL 5.6.4
and up,
<code class="literal">
InnoDB
</code>
and
<code class="literal">
MyISAM
</code>
tables both support
<code class="literal">
FULLTEXT
</code>
indexes;
formerly, these indexes were only available for
<code class="literal">
MyISAM
</code>
tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_full_text_search">
full-text search
</a>
,
<a class="glossseealso" href="glossary.html#glos_fulltext_index">
FULLTEXT index
</a>
.
</p>
</dd>
<dt>
<a name="glos_secondary_index">
</a>
<span class="glossterm">
secondary index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030899872">
</a>
A type of
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
index
</strong>
</span>
that represents a subset
of table columns. An
<code class="literal">
InnoDB
</code>
table can have
zero, one, or many secondary indexes. (Contrast with the
<span class="bold">
<strong>
clustered index
</strong>
</span>
, which is
required for each
<code class="literal">
InnoDB
</code>
table, and stores
the data for all the table columns.)
</p>
<p>
A secondary index can be used to satisfy queries that only
require values from the indexed columns. For more complex
queries, it can be used to identify the relevant rows in the
table, which are then retrieved through lookups using the
clustered index.
</p>
<p>
Creating and dropping secondary indexes has traditionally
involved significant overhead from copying all the data in the
<code class="literal">
InnoDB
</code>
table. The
<span class="bold">
<strong>
fast
index creation
</strong>
</span>
feature makes both
<code class="literal">
CREATE
INDEX
</code>
and
<code class="literal">
DROP INDEX
</code>
statements
much faster for
<code class="literal">
InnoDB
</code>
secondary indexes.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_clustered_index">
clustered index
</a>
,
<a class="glossseealso" href="glossary.html#glos_fast_index_creation">
Fast Index Creation
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
.
</p>
</dd>
<dt>
<a name="glos_segment">
</a>
<span class="glossterm">
segment
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030887584">
</a>
A division within an
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
tablespace
</strong>
</span>
. If a tablespace is
analogous to a directory, the segments are analogous to files
within that directory. A segment can grow. New segments can be
created.
</p>
<p>
For example, within a
<span class="bold">
<strong>
file-per-table
</strong>
</span>
tablespace,
table data is in one segment and each associated index is in its
own segment. The
<span class="bold">
<strong>
system
tablespace
</strong>
</span>
contains many different segments, because
it can hold many tables and their associated indexes. Prior to
MySQL 8.0, the system tablespace also includes one or more
<span class="bold">
<strong>
rollback segments
</strong>
</span>
used for
<span class="bold">
<strong>
undo logs
</strong>
</span>
.
</p>
<p>
Segments grow and shrink as data is inserted and deleted. When a
segment needs more room, it is extended by one
<span class="bold">
<strong>
extent
</strong>
</span>
(1 megabyte) at a time.
Similarly, a segment releases one extent's worth of space when
all the data in that extent is no longer needed.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_extent">
extent
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback_segment">
rollback segment
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_selectivity">
</a>
<span class="glossterm">
selectivity
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030875888">
</a>
A property of data distribution, the number of distinct values
in a column (its
<span class="bold">
<strong>
cardinality
</strong>
</span>
)
divided by the number of records in the table. High selectivity
means that the column values are relatively unique, and can
retrieved efficiently through an index. If you (or the query
optimizer) can predict that a test in a
<code class="literal">
WHERE
</code>
clause only matches a small number (or proportion) of rows in a
table, the overall
<span class="bold">
<strong>
query
</strong>
</span>
tends
to be efficient if it evaluates that test first, using an index.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cardinality">
cardinality
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
.
</p>
</dd>
<dt>
<a name="glos_semi_consistent_read">
</a>
<span class="glossterm">
semi-consistent read
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030870096">
</a>
A type of read operation used for
<code class="literal">
UPDATE
</code>
statements, that is a combination of
<span class="bold">
<strong>
READ
COMMITTED
</strong>
</span>
and
<span class="bold">
<strong>
consistent
read
</strong>
</span>
. When an
<code class="literal">
UPDATE
</code>
statement
examines a row that is already locked,
<code class="literal">
InnoDB
</code>
returns the latest committed version to MySQL so that MySQL can
determine whether the row matches the
<code class="literal">
WHERE
</code>
condition of the
<code class="literal">
UPDATE
</code>
. If the row matches
(must be updated), MySQL reads the row again, and this time
<code class="literal">
InnoDB
</code>
either locks it or waits for a lock on
it. This type of read operation can only happen when the
transaction has the READ COMMITTED
<span class="bold">
<strong>
isolation level
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_consistent_read">
consistent read
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_read_committed">
READ COMMITTED
</a>
.
</p>
</dd>
<dt>
<a name="glos_serializable">
</a>
<span class="glossterm">
SERIALIZABLE
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030859600">
</a>
The
<span class="bold">
<strong>
isolation level
</strong>
</span>
that uses
the most conservative locking strategy, to prevent any other
<span class="bold">
<strong>
transactions
</strong>
</span>
from inserting or
changing data that was read by this transaction, until it is
finished. This way, the same query can be run over and over
within a transaction, and be certain to retrieve the same set of
results each time. Any attempt to change data that was committed
by another transaction since the start of the current
transaction, cause the current transaction to wait.
</p>
<p>
This is the default isolation level specified by the SQL
standard. In practice, this degree of strictness is rarely
needed, so the default isolation level for
<code class="literal">
InnoDB
</code>
is the next most strict,
<span class="bold">
<strong>
REPEATABLE READ
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_consistent_read">
consistent read
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_repeatable_read">
REPEATABLE READ
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_serialized_dictionary_information">
</a>
<span class="glossterm">
serialized dictionary information (SDI)
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030850448">
</a>
Dictionary object metadata in serialized form. SDI is stored in
<code class="literal">
JSON
</code>
format.
</p>
<p>
As of MySQL 8.0.3, SDI is present in all
<code class="literal">
InnoDB
</code>
tablespace files except for temporary
tablespace and undo tablespace files. The presence of SDI in
tablespace files provides metadata redundancy. For example,
dictionary object metadata can be extracted from tablespace
files using the
<a class="link" href="ibd2sdi.html" title="6.6.1 ibd2sdi — InnoDB Tablespace SDI Extraction Utility">
<span class="command">
<strong>
ibd2sdi
</strong>
</span>
</a>
utility if the data
dictionary becomes unavailable.
</p>
<p>
For a
<code class="literal">
MyISAM
</code>
table, SDI is stored in a
<code class="filename">
.sdi
</code>
metadata file in the schema directory.
An SDI metadata file is required to perform an
<a class="link" href="import-table.html" title="15.2.6 IMPORT TABLE Statement">
<code class="literal">
IMPORT TABLE
</code>
</a>
operation.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_general_tablespace">
general tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_server">
</a>
<span class="glossterm">
server
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030839648">
</a>
A type of program that runs continuously, waiting to receive and
act upon requests from another program (the
<span class="bold">
<strong>
client
</strong>
</span>
). Because often an
entire computer is dedicated to running one or more server
programs (such as a database server, a web server, an
application server, or some combination of these), the term
<span class="bold">
<strong>
server
</strong>
</span>
can also refer to the
computer that runs the server software.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_client">
client
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysqld">
mysqld
</a>
.
</p>
</dd>
<dt>
<a name="glos_server_side_prepared_statement">
</a>
<span class="glossterm">
server-side prepared statement
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030834704">
</a>
A
<span class="bold">
<strong>
prepared statement
</strong>
</span>
managed by
the MySQL server. Historically, issues with server-side prepared
statements led
<span class="bold">
<strong>
Connector/J
</strong>
</span>
and
<span class="bold">
<strong>
Connector/PHP
</strong>
</span>
developers to
sometimes use
<span class="bold">
<strong>
client-side prepared
statements
</strong>
</span>
instead. With modern MySQL server
versions, server-side prepared statements are recommended for
performance, scalability, and memory efficiency.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_client_side_prepared_statement">
client-side prepared statement
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_php">
Connector/PHP
</a>
,
<a class="glossseealso" href="glossary.html#glos_prepared_statement">
prepared statement
</a>
.
</p>
</dd>
<dt>
<a name="glos_service_principal_name">
</a>
<span class="glossterm">
service principal name
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030827376">
</a>
The name for a Kerberos named entity that represents a service.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_principal">
principal
</a>
.
</p>
</dd>
<dt>
<a name="glos_service_ticket">
</a>
<span class="glossterm">
service ticket
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030824832">
</a>
A Kerberos ticket that provides access to an application
service, such as the service provided by a web or database
server.
</p>
</dd>
<dt>
<a name="glos_servlet">
</a>
<span class="glossterm">
servlet
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030822624">
</a>
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
.
</p>
</dd>
<dt>
<a name="glos_session_temporary_tablespace">
</a>
<span class="glossterm">
session temporary tablespace
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030820064">
</a>
A
<span class="emphasis">
<em>
temporary tablespace
</em>
</span>
that stores
user-created
<span class="emphasis">
<em>
temporary tables
</em>
</span>
and internal
temporary tables created by the
<span class="emphasis">
<em>
optimizer
</em>
</span>
when
<code class="literal">
InnoDB
</code>
is configured as the on-disk
storage engine for internal temporary tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_optimizer">
optimizer
</a>
,
<a class="glossseealso" href="glossary.html#glos_temporary_table">
temporary table
</a>
,
<a class="glossseealso" href="glossary.html#glos_temporary_tablespace">
temporary tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_shared_lock">
</a>
<span class="glossterm">
shared lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030814256">
</a>
A kind of
<span class="bold">
<strong>
lock
</strong>
</span>
that allows
other
<span class="bold">
<strong>
transactions
</strong>
</span>
to read the
locked object, and to also acquire other shared locks on it, but
not to write to it. The opposite of
<span class="bold">
<strong>
exclusive lock
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_exclusive_lock">
exclusive lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_shared_tablespace">
</a>
<span class="glossterm">
shared tablespace
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030808448">
</a>
Another way of referring to the
<span class="bold">
<strong>
system
tablespace
</strong>
</span>
or a
<span class="bold">
<strong>
general
tablespace
</strong>
</span>
. General tablespaces were introduced in
MySQL 5.7. More than one table can reside in a shared
tablespace. Only a single table can reside in a
<span class="emphasis">
<em>
file-per-table
</em>
</span>
tablespace.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_general_tablespace">
general tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_sharp_checkpoint">
</a>
<span class="glossterm">
sharp checkpoint
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030803200">
</a>
The process of
<span class="bold">
<strong>
flushing
</strong>
</span>
to disk
all
<span class="bold">
<strong>
dirty
</strong>
</span>
buffer pool pages
whose redo entries are contained in certain portion of the
<span class="bold">
<strong>
redo log
</strong>
</span>
. Occurs before
<code class="literal">
InnoDB
</code>
reuses a portion of a log file; the
log files are used in a circular fashion. Typically occurs with
write-intensive
<span class="bold">
<strong>
workloads
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_dirty_page">
dirty page
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_redo_log">
redo log
</a>
,
<a class="glossseealso" href="glossary.html#glos_workload">
workload
</a>
.
</p>
</dd>
<dt>
<a name="glos_shutdown">
</a>
<span class="glossterm">
shutdown
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030795248">
</a>
The process of stopping the MySQL server. By default, this
process cleans up operations for
<span class="bold">
<strong>
InnoDB
</strong>
</span>
tables, so
<code class="literal">
InnoDB
</code>
can be
<span class="bold">
<strong>
slow
</strong>
</span>
to shut down, but fast to
start up later. If you skip the cleanup operations, it is
<span class="bold">
<strong>
fast
</strong>
</span>
to shut down but the
cleanup must be performed during the next restart.
</p>
<p>
The shutdown mode for
<code class="literal">
InnoDB
</code>
is controlled by
the
<a class="link" href="innodb-parameters.html#sysvar_innodb_fast_shutdown">
<code class="literal">
innodb_fast_shutdown
</code>
</a>
option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_fast_shutdown">
fast shutdown
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_slow_shutdown">
slow shutdown
</a>
,
<a class="glossseealso" href="glossary.html#glos_startup">
startup
</a>
.
</p>
</dd>
<dt>
<a name="glos_slave_server">
</a>
<span class="glossterm">
slave
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_replica">
replica
</a>
.
</p>
</dd>
<dt>
<a name="glos_slow_query_log">
</a>
<span class="glossterm">
slow query log
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030784288">
</a>
A type of
<span class="bold">
<strong>
log
</strong>
</span>
used for
performance tuning of SQL statements processed by the MySQL
server. The log information is stored in a file. You must enable
this feature to use it. You control which categories of
<span class="quote">
“
<span class="quote">
slow
</span>
”
</span>
SQL statements are logged. For more
information, see
<a class="xref" href="slow-query-log.html" title="7.4.5 The Slow Query Log">
Section 7.4.5, “The Slow Query Log”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_general_query_log">
general query log
</a>
,
<a class="glossseealso" href="glossary.html#glos_log">
log
</a>
.
</p>
</dd>
<dt>
<a name="glos_slow_shutdown">
</a>
<span class="glossterm">
slow shutdown
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030779184">
</a>
A type of
<span class="bold">
<strong>
shutdown
</strong>
</span>
that does
additional
<code class="literal">
InnoDB
</code>
flushing operations before
completing. Also known as a
<span class="bold">
<strong>
clean
shutdown
</strong>
</span>
. Specified by the configuration parameter
<a class="link" href="innodb-parameters.html#sysvar_innodb_fast_shutdown">
<code class="literal">
innodb_fast_shutdown=0
</code>
</a>
or the
command
<code class="literal">
SET GLOBAL innodb_fast_shutdown=0;
</code>
.
Although the shutdown itself can take longer, that time should
be saved on the subsequent startup.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_clean_shutdown">
clean shutdown
</a>
,
<a class="glossseealso" href="glossary.html#glos_fast_shutdown">
fast shutdown
</a>
,
<a class="glossseealso" href="glossary.html#glos_shutdown">
shutdown
</a>
.
</p>
</dd>
<dt>
<a name="glos_snapshot">
</a>
<span class="glossterm">
snapshot
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030771120">
</a>
A representation of data at a particular time, which remains the
same even as changes are
<span class="bold">
<strong>
committed
</strong>
</span>
by other
<span class="bold">
<strong>
transactions
</strong>
</span>
. Used by certain
<span class="bold">
<strong>
isolation levels
</strong>
</span>
to allow
<span class="bold">
<strong>
consistent reads
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_consistent_read">
consistent read
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_sort_buffer">
</a>
<span class="glossterm">
sort buffer
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030764064">
</a>
The buffer used for sorting data during creation of an
<code class="literal">
InnoDB
</code>
index. Sort buffer size is configured
using the
<a class="link" href="innodb-parameters.html#sysvar_innodb_sort_buffer_size">
<code class="literal">
innodb_sort_buffer_size
</code>
</a>
configuration option.
</p>
</dd>
<dt>
<a name="glos_source">
</a>
<span class="glossterm">
source
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030759872">
</a>
A database server machine in a
<span class="bold">
<strong>
replication
</strong>
</span>
scenario that
processes the initial insert, update, and delete requests for
data. These changes are propagated to, and repeated on, other
servers known as
<span class="bold">
<strong>
replicas
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_replica">
replica
</a>
,
<a class="glossseealso" href="glossary.html#glos_replication">
replication
</a>
.
</p>
</dd>
<dt>
<a name="glos_space_id">
</a>
<span class="glossterm">
space ID
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030755200">
</a>
An identifier used to uniquely identify an
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
tablespace
</strong>
</span>
within a MySQL
instance. The space ID for the
<span class="bold">
<strong>
system
tablespace
</strong>
</span>
is always zero; this same ID applies to
all tables within the system tablespace or within a general
tablespace. Each
<span class="bold">
<strong>
file-per-table
</strong>
</span>
tablespace and
<span class="bold">
<strong>
general
tablespace
</strong>
</span>
has its own space ID.
</p>
<p>
Prior to MySQL 5.6, this hardcoded value presented difficulties
in moving
<code class="literal">
InnoDB
</code>
tablespace files between
MySQL instances. Starting in MySQL 5.6, you can copy tablespace
files between instances by using the
<span class="bold">
<strong>
transportable tablespace
</strong>
</span>
feature involving the statements
<code class="literal">
FLUSH TABLES ... FOR
EXPORT
</code>
,
<code class="literal">
ALTER TABLE ... DISCARD
TABLESPACE
</code>
, and
<code class="literal">
ALTER TABLE ... IMPORT
TABLESPACE
</code>
. The information needed to adjust the space
ID is conveyed in the
<span class="bold">
<strong>
.cfg file
</strong>
</span>
which you copy along with the tablespace. See
<a class="xref" href="innodb-table-import.html" title="17.6.1.3 Importing InnoDB Tables">
Section 17.6.1.3, “Importing InnoDB Tables”
</a>
for details.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cfg_file">
.cfg file
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_general_tablespace">
general tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_transportable_tablespace">
transportable tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_sparse_file">
</a>
<span class="glossterm">
sparse file
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030739680">
</a>
A type of file that uses file system space more efficiently by
writing metadata representing empty blocks to disk instead of
writing the actual empty space. The
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
transparent page compression
</strong>
</span>
feature relies on sparse file support. For more information, see
<a class="xref" href="innodb-page-compression.html" title="17.9.2 InnoDB Page Compression">
Section 17.9.2, “InnoDB Page Compression”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_hole_punching">
hole punching
</a>
,
<a class="glossseealso" href="glossary.html#glos_transparent_page_compression">
transparent page compression
</a>
.
</p>
</dd>
<dt>
<a name="glos_spin">
</a>
<span class="glossterm">
spin
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030734208">
</a>
A type of
<span class="bold">
<strong>
wait
</strong>
</span>
operation that
continuously tests whether a resource becomes available. This
technique is used for resources that are typically held only for
brief periods, where it is more efficient to wait in a
<span class="quote">
“
<span class="quote">
busy loop
</span>
”
</span>
than to put the thread to sleep and
perform a context switch. If the resource does not become
available within a short time, the spin loop ceases and another
wait technique is used.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_latch">
latch
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_mutex">
mutex
</a>
,
<a class="glossseealso" href="glossary.html#glos_wait">
wait
</a>
.
</p>
</dd>
<dt>
<a name="glos_spn">
</a>
<span class="glossterm">
SPN
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_service_principal_name">
service principal name
</a>
.
</p>
</dd>
<dt>
<a name="glos_spring">
</a>
<span class="glossterm">
Spring
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030727168">
</a>
A Java-based application framework designed for assisting in
application design by providing a way to configure components.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_j2ee">
J2EE
</a>
.
</p>
</dd>
<dt>
<a name="glos_sql">
</a>
<span class="glossterm">
SQL
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030724496">
</a>
The Structured Query Language that is standard for performing
database operations. Often divided into the categories
<span class="bold">
<strong>
DDL
</strong>
</span>
,
<span class="bold">
<strong>
DML
</strong>
</span>
, and
<span class="bold">
<strong>
queries
</strong>
</span>
. MySQL includes some
additional statement categories such as
<span class="bold">
<strong>
replication
</strong>
</span>
. See
<a class="xref" href="language-structure.html" title="Chapter 11 Language Structure">
Chapter 11,
<i>
Language Structure
</i>
</a>
for the building blocks of
SQL syntax,
<a class="xref" href="data-types.html" title="Chapter 13 Data Types">
Chapter 13,
<i>
Data Types
</i>
</a>
for the data types to
use for MySQL table columns,
<a class="xref" href="sql-statements.html" title="Chapter 15 SQL Statements">
Chapter 15,
<i>
SQL Statements
</i>
</a>
for details about SQL statements and their associated
categories, and
<a class="xref" href="functions.html" title="Chapter 14 Functions and Operators">
Chapter 14,
<i>
Functions and Operators
</i>
</a>
for standard and
MySQL-specific functions to use in queries.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
,
<a class="glossseealso" href="glossary.html#glos_replication">
replication
</a>
.
</p>
</dd>
<dt>
<a name="glos_sqlstate">
</a>
<span class="glossterm">
SQLState
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030714480">
</a>
An error code defined by the
<span class="bold">
<strong>
JDBC
</strong>
</span>
standard, for exception
handling by applications using
<span class="bold">
<strong>
Connector/J
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_jdbc">
JDBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_ssd">
</a>
<span class="glossterm">
SSD
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030709840">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
solid-state drive
</span>
”
</span>
. A type of storage
device with different performance characteristics than a
traditional hard disk drive
(
<span class="bold">
<strong>
HDD
</strong>
</span>
): smaller storage
capacity, faster for random reads, no moving parts, and with a
number of considerations affecting write performance. Its
performance characteristics can influence the throughput of a
<span class="bold">
<strong>
disk-bound
</strong>
</span>
workload.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_disk_bound">
disk-bound
</a>
,
<a class="glossseealso" href="glossary.html#glos_hdd">
HDD
</a>
.
</p>
</dd>
<dt>
<a name="glos_ssl">
</a>
<span class="glossterm">
SSL
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030704608">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
secure sockets layer
</span>
”
</span>
. Provides the
encryption layer for network communication between an
application and a MySQL database server.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_keystore">
keystore
</a>
,
<a class="glossseealso" href="glossary.html#glos_truststore">
truststore
</a>
.
</p>
</dd>
<dt>
<a name="glos_st">
</a>
<span class="glossterm">
ST
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_service_ticket">
service ticket
</a>
.
</p>
</dd>
<dt>
<a name="glos_startup">
</a>
<span class="glossterm">
startup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030699456">
</a>
The process of starting the MySQL server. Typically done by one
of the programs listed in
<a class="xref" href="programs-server.html" title="6.3 Server and Server-Startup Programs">
Section 6.3, “Server and Server-Startup Programs”
</a>
. The
opposite of
<span class="bold">
<strong>
shutdown
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_shutdown">
shutdown
</a>
.
</p>
</dd>
<dt>
<a name="glos_statement_interceptor">
</a>
<span class="glossterm">
statement interceptor
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030695280">
</a>
A type of
<span class="bold">
<strong>
interceptor
</strong>
</span>
for
tracing, debugging, or augmenting SQL statements issued by a
database application. Sometimes also known as a
<span class="bold">
<strong>
command interceptor
</strong>
</span>
.
</p>
<p>
In
<span class="bold">
<strong>
Java
</strong>
</span>
applications using
<span class="bold">
<strong>
Connector/J
</strong>
</span>
, setting up this
type of interceptor involves implementing the
<code class="literal">
com.mysql.jdbc.StatementInterceptorV2
</code>
interface, and adding a
<code class="literal">
statementInterceptors
</code>
property to the
<span class="bold">
<strong>
connection
string
</strong>
</span>
.
</p>
<p>
In
<span class="bold">
<strong>
Visual Studio
</strong>
</span>
applications
using
<span class="bold">
<strong>
Connector/NET
</strong>
</span>
, setting up this
type of interceptor involves defining a class that inherits from
the
<code class="literal">
BaseCommandInterceptor
</code>
class and
specifying that class name as part of the connection string.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_command_interceptor">
command interceptor
</a>
,
<a class="glossseealso" href="glossary.html#glos_connection_string">
connection string
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_j">
Connector/J
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
,
<a class="glossseealso" href="glossary.html#glos_interceptor">
interceptor
</a>
,
<a class="glossseealso" href="glossary.html#glos_java">
Java
</a>
,
<a class="glossseealso" href="glossary.html#glos_visual_studio">
Visual Studio
</a>
.
</p>
</dd>
<dt>
<a name="glos_statement_based_replication">
</a>
<span class="glossterm">
statement-based replication
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030681152">
</a>
A form of
<span class="bold">
<strong>
replication
</strong>
</span>
where SQL
statements are sent from the
<span class="bold">
<strong>
source
</strong>
</span>
and replayed on the
<span class="bold">
<strong>
replica
</strong>
</span>
. It requires some care
with the setting for the
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoinc_lock_mode">
<code class="literal">
innodb_autoinc_lock_mode
</code>
</a>
option, to avoid potential timing problems with
<span class="bold">
<strong>
auto-increment locking
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_auto_increment_locking">
auto-increment locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_autoinc_lock_mode">
innodb_autoinc_lock_mode
</a>
,
<a class="glossseealso" href="glossary.html#glos_replica">
replica
</a>
,
<a class="glossseealso" href="glossary.html#glos_replication">
replication
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_based_replication">
row-based replication
</a>
,
<a class="glossseealso" href="glossary.html#glos_source">
source
</a>
.
</p>
</dd>
<dt>
<a name="glos_statistics">
</a>
<span class="glossterm">
statistics
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030671664">
</a>
Estimated values relating to each
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
table
</strong>
</span>
and
<span class="bold">
<strong>
index
</strong>
</span>
, used to construct an
efficient
<span class="bold">
<strong>
query execution plan
</strong>
</span>
.
The main values are the
<span class="bold">
<strong>
cardinality
</strong>
</span>
(number of distinct
values) and the total number of table rows or index entries. The
statistics for the table represent the data in its
<span class="bold">
<strong>
primary key
</strong>
</span>
index. The
statistics for a
<span class="bold">
<strong>
secondary
index
</strong>
</span>
represent the rows covered by that index.
</p>
<p>
The values are estimated rather than counted precisely because
at any moment, different
<span class="bold">
<strong>
transactions
</strong>
</span>
can be inserting
and deleting rows from the same table. To keep the values from
being recalculated frequently, you can enable
<span class="bold">
<strong>
persistent statistics
</strong>
</span>
, where
the values are stored in
<code class="literal">
InnoDB
</code>
system
tables, and refreshed only when you issue an
<a class="link" href="analyze-table.html" title="15.7.3.1 ANALYZE TABLE Statement">
<code class="literal">
ANALYZE TABLE
</code>
</a>
statement.
</p>
<p>
You can control how
<span class="bold">
<strong>
NULL
</strong>
</span>
values
are treated when calculating statistics through the
<a class="link" href="innodb-parameters.html#sysvar_innodb_stats_method">
<code class="literal">
innodb_stats_method
</code>
</a>
configuration option.
</p>
<p>
Other types of statistics are available for database objects and
database activity through the
<span class="bold">
<strong>
INFORMATION_SCHEMA
</strong>
</span>
and
<span class="bold">
<strong>
PERFORMANCE_SCHEMA
</strong>
</span>
tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cardinality">
cardinality
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_information_schema">
INFORMATION_SCHEMA
</a>
,
<a class="glossseealso" href="glossary.html#glos_null">
NULL
</a>
,
<a class="glossseealso" href="glossary.html#glos_performance_schema">
Performance Schema
</a>
,
<a class="glossseealso" href="glossary.html#glos_persistent_statistics">
persistent statistics
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
,
<a class="glossseealso" href="glossary.html#glos_query_execution_plan">
query execution plan
</a>
,
<a class="glossseealso" href="glossary.html#glos_secondary_index">
secondary index
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_stemming">
</a>
<span class="glossterm">
stemming
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030649968">
</a>
The ability to search for different variations of a word based
on a common root word, such as singular and plural, or past,
present, and future verb tense. This feature is currently
supported in
<code class="literal">
MyISAM
</code>
<span class="bold">
<strong>
full-text search
</strong>
</span>
feature but
not in
<span class="bold">
<strong>
FULLTEXT indexes
</strong>
</span>
for
<code class="literal">
InnoDB
</code>
tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_full_text_search">
full-text search
</a>
,
<a class="glossseealso" href="glossary.html#glos_fulltext_index">
FULLTEXT index
</a>
.
</p>
</dd>
<dt>
<a name="glos_stopword">
</a>
<span class="glossterm">
stopword
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030643856">
</a>
In a
<span class="bold">
<strong>
FULLTEXT index
</strong>
</span>
, a word
that is considered common or trivial enough that it is omitted
from the
<span class="bold">
<strong>
search index
</strong>
</span>
and
ignored in search queries. Different configuration settings
control stopword processing for
<code class="literal">
InnoDB
</code>
and
<code class="literal">
MyISAM
</code>
tables. See
<a class="xref" href="fulltext-stopwords.html" title="14.9.4 Full-Text Stopwords">
Section 14.9.4, “Full-Text Stopwords”
</a>
for details.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_fulltext_index">
FULLTEXT index
</a>
,
<a class="glossseealso" href="glossary.html#glos_search_index">
search index
</a>
.
</p>
</dd>
<dt>
<a name="glos_storage_engine">
</a>
<span class="glossterm">
storage engine
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030637024">
</a>
A component of the MySQL database that performs the low-level
work of storing, updating, and querying data. In MySQL 5.5 and
higher,
<span class="bold">
<strong>
InnoDB
</strong>
</span>
is the default
storage engine for new tables, superceding
<code class="literal">
MyISAM
</code>
. Different storage engines are
designed with different tradeoffs between factors such as memory
usage versus disk usage, read speed versus write speed, and
speed versus robustness. Each storage engine manages specific
tables, so we refer to
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
tables,
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
tables, and so on.
</p>
<p>
The
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product is optimized for backing up
<code class="literal">
InnoDB
</code>
tables. It can also back up tables handled by
<code class="literal">
MyISAM
</code>
and other storage engines.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_table_type">
table type
</a>
.
</p>
</dd>
<dt>
<a name="glos_stored_generated_column">
</a>
<span class="glossterm">
stored generated column
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030626128">
</a>
A column whose values are computed from an expression included
in the column definition. Column values are evaluated and stored
when rows are inserted or updated. A stored generated column
requires storage space and can be indexed.
</p>
<p>
Contrast with
<span class="bold">
<strong>
virtual generated
column
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_base_column">
base column
</a>
,
<a class="glossseealso" href="glossary.html#glos_generated_column">
generated column
</a>
,
<a class="glossseealso" href="glossary.html#glos_virtual_generated_column">
virtual generated column
</a>
.
</p>
</dd>
<dt>
<a name="glos_stored-object">
</a>
<span class="glossterm">
stored object
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030621136">
</a>
A stored program or view.
</p>
</dd>
<dt>
<a name="glos_stored-program">
</a>
<span class="glossterm">
stored program
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030619040">
</a>
A stored routine (procedure or function), trigger, or Event
Scheduler event.
</p>
</dd>
<dt>
<a name="glos_stored-routine">
</a>
<span class="glossterm">
stored routine
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030616944">
</a>
A stored procedure or function.
</p>
</dd>
<dt>
<a name="glos_strict_mode">
</a>
<span class="glossterm">
strict mode
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030614832">
</a>
The general name for the setting controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_strict_mode">
<code class="literal">
innodb_strict_mode
</code>
</a>
option.
Turning on this setting causes certain conditions that are
normally treated as warnings, to be considered errors. For
example, certain invalid combinations of options related to
<span class="bold">
<strong>
file format
</strong>
</span>
and
<span class="bold">
<strong>
row format
</strong>
</span>
, that normally
produce a warning and continue with default values, now cause
the
<code class="literal">
CREATE TABLE
</code>
operation to fail.
<a class="link" href="innodb-parameters.html#sysvar_innodb_strict_mode">
<code class="literal">
innodb_strict_mode
</code>
</a>
is enabled
by default in MySQL 5.7.
</p>
<p>
MySQL also has something called strict mode. See
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_file_format">
file format
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_strict_mode">
innodb_strict_mode
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_format">
row format
</a>
.
</p>
</dd>
<dt>
<a name="glos_sublist">
</a>
<span class="glossterm">
sublist
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030604880">
</a>
Within the list structure that represents the
<span class="bold">
<strong>
buffer pool
</strong>
</span>
, pages that are
relatively old and relatively new are represented by different
portions of the
<span class="bold">
<strong>
list
</strong>
</span>
. A set of
parameters control the size of these portions and the dividing
point between the new and old pages.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_eviction">
eviction
</a>
,
<a class="glossseealso" href="glossary.html#glos_list">
list
</a>
,
<a class="glossseealso" href="glossary.html#glos_lru">
LRU
</a>
.
</p>
</dd>
<dt>
<a name="glos_supremum_record">
</a>
<span class="glossterm">
supremum record
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030599056">
</a>
A
<span class="bold">
<strong>
pseudo-record
</strong>
</span>
in an index,
representing the
<span class="bold">
<strong>
gap
</strong>
</span>
above the
largest value in that index. If a transaction has a statement
such as
<code class="literal">
SELECT ... FROM ... WHERE col > 10 FOR
UPDATE;
</code>
, and the largest value in the column is 20, it
is a lock on the supremum record that prevents other
transactions from inserting even larger values such as 50, 100,
and so on.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_gap">
gap
</a>
,
<a class="glossseealso" href="glossary.html#glos_infimum_record">
infimum record
</a>
,
<a class="glossseealso" href="glossary.html#glos_pseudo_record">
pseudo-record
</a>
.
</p>
</dd>
<dt>
<a name="glos_surrogate_key">
</a>
<span class="glossterm">
surrogate key
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030593040">
</a>
Synonym name for
<span class="bold">
<strong>
synthetic key
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_synthetic_key">
synthetic key
</a>
.
</p>
</dd>
<dt>
<a name="glos_synthetic_key">
</a>
<span class="glossterm">
synthetic key
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030589712">
</a>
An indexed column, typically a
<span class="bold">
<strong>
primary
key
</strong>
</span>
, where the values are assigned arbitrarily. Often
done using an
<span class="bold">
<strong>
auto-increment
</strong>
</span>
column. By treating the value as completely arbitrary, you can
avoid overly restrictive rules and faulty application
assumptions. For example, a numeric sequence representing
employee numbers might have a gap if an employee was approved
for hiring but never actually joined. Or employee number 100
might have a later hiring date than employee number 500, if they
left the company and later rejoined. Numeric values also produce
shorter values of predictable length. For example, storing
numeric codes meaning
<span class="quote">
“
<span class="quote">
Road
</span>
”
</span>
,
<span class="quote">
“
<span class="quote">
Boulevard
</span>
”
</span>
,
<span class="quote">
“
<span class="quote">
Expressway
</span>
”
</span>
, and so on
is more space-efficient than repeating those strings over and
over.
</p>
<p>
Also known as a
<span class="bold">
<strong>
surrogate key
</strong>
</span>
.
Contrast with
<span class="bold">
<strong>
natural key
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_auto_increment">
auto-increment
</a>
,
<a class="glossseealso" href="glossary.html#glos_natural_key">
natural key
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
,
<a class="glossseealso" href="glossary.html#glos_surrogate_key">
surrogate key
</a>
.
</p>
</dd>
<dt>
<a name="glos_system_tablespace">
</a>
<span class="glossterm">
system tablespace
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030580144">
</a>
One or more data files (
<span class="bold">
<strong>
ibdata
files
</strong>
</span>
) containing the metadata for
<code class="literal">
InnoDB
</code>
-related objects, and the storage areas
for the
<span class="bold">
<strong>
change buffer
</strong>
</span>
, and the
<span class="bold">
<strong>
doublewrite buffer
</strong>
</span>
. It may also
contain table and index data for
<code class="literal">
InnoDB
</code>
tables if tables were created in the system tablespace instead
of
<span class="bold">
<strong>
file-per-table
</strong>
</span>
or
<span class="bold">
<strong>
general tablespaces
</strong>
</span>
. The data
and metadata in the system tablespace apply to all
<span class="bold">
<strong>
databases
</strong>
</span>
in a MySQL
<span class="bold">
<strong>
instance
</strong>
</span>
.
</p>
<p>
Prior to MySQL 5.6.7, the default was to keep all
<code class="literal">
InnoDB
</code>
tables and indexes inside the system
tablespace, often causing this file to become very large.
Because the system tablespace never shrinks, storage problems
could arise if large amounts of temporary data were loaded and
then deleted. In MySQL 8.0, the default is
<span class="bold">
<strong>
file-per-table
</strong>
</span>
mode, where each
table and its associated indexes are stored in a separate
<span class="bold">
<strong>
.ibd file
</strong>
</span>
. This default makes
it easier to use
<code class="literal">
InnoDB
</code>
features that rely on
<code class="literal">
DYNAMIC
</code>
and
<code class="literal">
COMPRESSED
</code>
row
formats, such as table
<span class="bold">
<strong>
compression
</strong>
</span>
, efficient storage
of
<span class="bold">
<strong>
off-page columns
</strong>
</span>
, and large
index key prefixes.
</p>
<p>
Keeping all table data in the system tablespace or in separate
<code class="filename">
.ibd
</code>
files has implications for storage
management in general. The
<span class="bold">
<strong>
MySQL Enterprise Backup
</strong>
</span>
product might back up a small set
of large files, or many smaller files. On systems with thousands
of tables, the file system operations to process thousands of
<code class="filename">
.ibd
</code>
files can cause bottlenecks.
</p>
<p>
<code class="literal">
InnoDB
</code>
introduced general tablespaces in
MySQL 5.7.6, which are also represented by
<code class="filename">
.ibd
</code>
files. General tablespaces are shared
tablespaces created using
<a class="link" href="create-tablespace.html" title="15.1.21 CREATE TABLESPACE Statement">
<code class="literal">
CREATE
TABLESPACE
</code>
</a>
syntax. They can be created outside of the
data directory, are capable of holding multiple tables, and
support tables of all row formats.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_change_buffer">
change buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_compression">
compression
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_dictionary">
data dictionary
</a>
,
<a class="glossseealso" href="glossary.html#glos_database">
database
</a>
,
<a class="glossseealso" href="glossary.html#glos_doublewrite_buffer">
doublewrite buffer
</a>
,
<a class="glossseealso" href="glossary.html#glos_dynamic_row_format">
dynamic row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_general_tablespace">
general tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibdata_file">
ibdata file
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_file_per_table">
innodb_file_per_table
</a>
,
<a class="glossseealso" href="glossary.html#glos_instance">
instance
</a>
,
<a class="glossseealso" href="glossary.html#glos_mysql_enterprise_backup">
MySQL Enterprise Backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_off_page_column">
off-page column
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
T
</h3>
<dl>
<dt>
<a name="glos_table">
</a>
<span class="glossterm">
table
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030549552">
</a>
Each MySQL table is associated with a particular
<span class="bold">
<strong>
storage engine
</strong>
</span>
.
<span class="bold">
<strong>
InnoDB
</strong>
</span>
tables have particular
<span class="bold">
<strong>
physical
</strong>
</span>
and
<span class="bold">
<strong>
logical
</strong>
</span>
characteristics that
affect performance,
<span class="bold">
<strong>
scalability
</strong>
</span>
,
<span class="bold">
<strong>
backup
</strong>
</span>
, administration, and
application development.
</p>
<p>
In terms of file storage, an
<code class="literal">
InnoDB
</code>
table
belongs to one of the following tablespace types:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The shared
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
system tablespace
</strong>
</span>
, which is
comprised of one or more
<span class="bold">
<strong>
ibdata
files
</strong>
</span>
.
</p>
</li>
<li class="listitem">
<p>
A
<span class="bold">
<strong>
file-per-table
</strong>
</span>
tablespace, comprised of an individual
<span class="bold">
<strong>
.ibd file
</strong>
</span>
.
</p>
</li>
<li class="listitem">
<p>
A shared
<span class="bold">
<strong>
general
tablespace
</strong>
</span>
, comprised of an individual
<code class="filename">
.ibd
</code>
file. General tablespaces were
introduced in MySQL 5.7.6.
</p>
</li>
</ul>
</div>
<p>
<span class="bold">
<strong>
<code class="literal">
.ibd
</code>
</strong>
</span>
data
files contain both table and
<span class="bold">
<strong>
index
</strong>
</span>
data.
</p>
<p>
<code class="literal">
InnoDB
</code>
tables created in file-per-table
tablespaces can use
<span class="bold">
<strong>
DYNAMIC
</strong>
</span>
or
<span class="bold">
<strong>
COMPRESSED
</strong>
</span>
row format. These
row formats enable
<code class="literal">
InnoDB
</code>
features such as
<span class="bold">
<strong>
compression
</strong>
</span>
, efficient storage
of
<span class="bold">
<strong>
off-page columns
</strong>
</span>
, and large
index key prefixes. General tablespaces support all row formats.
</p>
<p>
The system tablespace supports tables that use
<span class="bold">
<strong>
REDUNDANT
</strong>
</span>
,
<span class="bold">
<strong>
COMPACT
</strong>
</span>
, and
<span class="bold">
<strong>
DYNAMIC
</strong>
</span>
row formats. System
tablespace support for the
<span class="bold">
<strong>
DYNAMIC
</strong>
</span>
row format was added in
MySQL 5.7.6.
</p>
<p>
The
<span class="bold">
<strong>
rows
</strong>
</span>
of an
<code class="literal">
InnoDB
</code>
table are organized into an index
structure known as the
<span class="bold">
<strong>
clustered
index
</strong>
</span>
, with entries sorted based on the
<span class="bold">
<strong>
primary key
</strong>
</span>
columns of the
table. Data access is optimized for queries that filter and sort
on the primary key columns, and each index contains a copy of
the associated primary key columns for each entry. Modifying
values for any of the primary key columns is an expensive
operation. Thus an important aspect of
<code class="literal">
InnoDB
</code>
table design is choosing a primary key with columns that are
used in the most important queries, and keeping the primary key
short, with rarely changing values.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_backup">
backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_clustered_index">
clustered index
</a>
,
<a class="glossseealso" href="glossary.html#glos_compact_row_format">
compact row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_compressed_row_format">
compressed row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_compression">
compression
</a>
,
<a class="glossseealso" href="glossary.html#glos_dynamic_row_format">
dynamic row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_fast_index_creation">
Fast Index Creation
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_off_page_column">
off-page column
</a>
,
<a class="glossseealso" href="glossary.html#glos_primary_key">
primary key
</a>
,
<a class="glossseealso" href="glossary.html#glos_redundant_row_format">
redundant row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_row">
row
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_table_lock">
</a>
<span class="glossterm">
table lock
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030510320">
</a>
A lock that prevents any other
<span class="bold">
<strong>
transaction
</strong>
</span>
from accessing a
table.
<code class="literal">
InnoDB
</code>
makes considerable effort to
make such locks unnecessary, by using techniques such as
<span class="bold">
<strong>
online DDL
</strong>
</span>
,
<span class="bold">
<strong>
row locks
</strong>
</span>
and
<span class="bold">
<strong>
consistent reads
</strong>
</span>
for processing
<span class="bold">
<strong>
DML
</strong>
</span>
statements and
<span class="bold">
<strong>
queries
</strong>
</span>
. You can create such a
lock through SQL using the
<code class="literal">
LOCK TABLE
</code>
statement; one of the steps in migrating from other database
systems or MySQL storage engines is to remove such statements
wherever practical.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_consistent_read">
consistent read
</a>
,
<a class="glossseealso" href="glossary.html#glos_dml">
DML
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_locking">
locking
</a>
,
<a class="glossseealso" href="glossary.html#glos_online_ddl">
online DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_query">
query
</a>
,
<a class="glossseealso" href="glossary.html#glos_row_lock">
row lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_table_scan">
</a>
<span class="glossterm">
table scan
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_full_table_scan">
full table scan
</a>
.
</p>
</dd>
<dt>
<a name="glos_table_statistics">
</a>
<span class="glossterm">
table statistics
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_statistics">
statistics
</a>
.
</p>
</dd>
<dt>
<a name="glos_table_type">
</a>
<span class="glossterm">
table type
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030494896">
</a>
Obsolete synonym for
<span class="bold">
<strong>
storage
engine
</strong>
</span>
. We refer to
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
tables,
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
tables, and so on.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_innodb">
InnoDB
</a>
,
<a class="glossseealso" href="glossary.html#glos_storage_engine">
storage engine
</a>
.
</p>
</dd>
<dt>
<a name="glos_tablespace">
</a>
<span class="glossterm">
tablespace
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030488640">
</a>
A data file that can hold data for one or more
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
tables
</strong>
</span>
and associated
<span class="bold">
<strong>
indexes
</strong>
</span>
.
</p>
<p>
The
<span class="bold">
<strong>
system tablespace
</strong>
</span>
contains
the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
data
dictionary
</strong>
</span>
, and prior to MySQL 5.6 holds all other
<code class="literal">
InnoDB
</code>
tables by default.
</p>
<p>
The
<a class="link" href="innodb-parameters.html#sysvar_innodb_file_per_table">
<code class="literal">
innodb_file_per_table
</code>
</a>
option, enabled by default in MySQL 5.6 and higher, allows
tables to be created in their own tablespaces. File-per-table
tablespaces support features such as efficient storage of
<span class="bold">
<strong>
off-page columns
</strong>
</span>
, table
compression, and transportable tablespaces. See
<a class="xref" href="innodb-file-per-table-tablespaces.html" title="17.6.3.2 File-Per-Table Tablespaces">
Section 17.6.3.2, “File-Per-Table Tablespaces”
</a>
for details.
</p>
<p>
<code class="literal">
InnoDB
</code>
introduced general tablespaces in
MySQL 5.7.6. General tablespaces are shared tablespaces created
using
<a class="link" href="create-tablespace.html" title="15.1.21 CREATE TABLESPACE Statement">
<code class="literal">
CREATE TABLESPACE
</code>
</a>
syntax.
They can be created outside of the MySQL data directory, are
capable of holding multiple tables, and support tables of all
row formats.
</p>
<p>
MySQL NDB Cluster also groups its tables into tablespaces. See
<a class="xref" href="mysql-cluster-disk-data-objects.html" title="25.6.11.1 NDB Cluster Disk Data Objects">
Section 25.6.11.1, “NDB Cluster Disk Data Objects”
</a>
for details.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_compressed_row_format">
compressed row format
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_dictionary">
data dictionary
</a>
,
<a class="glossseealso" href="glossary.html#glos_data_files">
data files
</a>
,
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_general_tablespace">
general tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_index">
index
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_file_per_table">
innodb_file_per_table
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_tcl">
</a>
<span class="glossterm">
Tcl
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030469184">
</a>
A programming language originating in the Unix scripting world.
Sometimes extended by code written in
<span class="bold">
<strong>
C
</strong>
</span>
,
<span class="bold">
<strong>
C++
</strong>
</span>
, or
<span class="bold">
<strong>
Java
</strong>
</span>
. For the open-source Tcl
<span class="bold">
<strong>
API
</strong>
</span>
for MySQL, see
<a class="xref" href="apis-tcl.html" title="31.12 MySQL Tcl API">
Section 31.12, “MySQL Tcl API”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_api">
API
</a>
.
</p>
</dd>
<dt>
<a name="glos_temporary_table">
</a>
<span class="glossterm">
temporary table
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030463056">
</a>
A
<span class="bold">
<strong>
table
</strong>
</span>
whose data does not
need to be truly permanent. For example, temporary tables might
be used as storage areas for intermediate results in complicated
calculations or transformations; this intermediate data would
not need to be recovered after a crash. Database products can
take various shortcuts to improve the performance of operations
on temporary tables, by being less scrupulous about writing data
to disk and other measures to protect the data across restarts.
</p>
<p>
Sometimes, the data itself is removed automatically at a set
time, such as when the transaction ends or when the session
ends. With some database products, the table itself is removed
automatically too.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_table">
table
</a>
.
</p>
</dd>
<dt>
<a name="glos_temporary_tablespace">
</a>
<span class="glossterm">
temporary tablespace
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030458576">
</a>
<code class="literal">
InnoDB
</code>
uses two types of temporary
tablespace.
<span class="emphasis">
<em>
Session temporary tablespaces
</em>
</span>
store user-created temporary tables and internal temporary
tables created by the optimizer. The
<span class="emphasis">
<em>
global temporary
tablespace
</em>
</span>
stores
<span class="emphasis">
<em>
rollback
segments
</em>
</span>
for changes made to user-created temporary
tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_global_temporary_tablespace">
global temporary tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_session_temporary_tablespace">
session temporary tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_temporary_table">
temporary table
</a>
.
</p>
</dd>
<dt>
<a name="glos_text_collection">
</a>
<span class="glossterm">
text collection
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030452512">
</a>
The set of columns included in a
<span class="bold">
<strong>
FULLTEXT
index
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_fulltext_index">
FULLTEXT index
</a>
.
</p>
</dd>
<dt>
<a name="glos_tgs">
</a>
<span class="glossterm">
TGS
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030449120">
</a>
A Kerberos ticket-granting server. TGS can also refer to the
ticket-granting service provided by a ticket-granting server.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ticket_granting_server">
ticket-granting server
</a>
.
</p>
</dd>
<dt>
<a name="glos_tgt">
</a>
<span class="glossterm">
TGT
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_ticket_granting_ticket">
ticket-granting ticket
</a>
.
</p>
</dd>
<dt>
<a name="glos_thread">
</a>
<span class="glossterm">
thread
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030445104">
</a>
A unit of processing that is typically more lightweight than a
<span class="bold">
<strong>
process
</strong>
</span>
, allowing for greater
<span class="bold">
<strong>
concurrency
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_master_thread">
master thread
</a>
,
<a class="glossseealso" href="glossary.html#glos_process">
process
</a>
,
<a class="glossseealso" href="glossary.html#glos_pthreads">
Pthreads
</a>
.
</p>
</dd>
<dt>
<a name="glos_ticket_granting_server">
</a>
<span class="glossterm">
ticket-granting server
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030439296">
</a>
In Kerberos, a server that provides tickets. The ticket-granting
server (TGS) combined with an authentication server (AS) make up
a key distribution center (KDC).
</p>
<p>
TGS can also refer to the ticket-granting service provided by
the ticket-granting server.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_authentication_server">
authentication server
</a>
,
<a class="glossseealso" href="glossary.html#glos_key_distribution_center">
key distribution center
</a>
.
</p>
</dd>
<dt>
<a name="glos_ticket_granting_ticket">
</a>
<span class="glossterm">
ticket-granting ticket
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030435472">
</a>
In Kerberos, a ticket-granting ticket is presented to the
ticket-granting server (TGS) to obtain service tickets for
service access.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ticket_granting_server">
ticket-granting server
</a>
.
</p>
</dd>
<dt>
<a name="glos_tomcat">
</a>
<span class="glossterm">
Tomcat
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030432768">
</a>
An open source
<span class="bold">
<strong>
J2EE
</strong>
</span>
application
server, implementing the Java Servlet and JavaServer Pages
programming technologies. Consists of a web server and Java
servlet container. With MySQL, typically used in conjunction
with
<span class="bold">
<strong>
Connector/J
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_j2ee">
J2EE
</a>
.
</p>
</dd>
<dt>
<a name="glos_torn_page">
</a>
<span class="glossterm">
torn page
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030428560">
</a>
An error condition that can occur due to a combination of I/O
device configuration and hardware failure. If data is written
out in chunks smaller than the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
page size
</strong>
</span>
(by default, 16KB), a
hardware failure while writing could result in only part of a
page being stored to disk. The
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
doublewrite buffer
</strong>
</span>
guards
against this possibility.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_doublewrite_buffer">
doublewrite buffer
</a>
.
</p>
</dd>
<dt>
<a name="glos_tps">
</a>
<span class="glossterm">
TPS
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030422816">
</a>
Acronym for
<span class="quote">
“
<span class="quote">
<span class="bold">
<strong>
transactions
</strong>
</span>
per second
</span>
”
</span>
, a unit of measurement sometimes used in
benchmarks. Its value depends on the
<span class="bold">
<strong>
workload
</strong>
</span>
represented by a
particular benchmark test, combined with factors that you
control such as the hardware capacity and database
configuration.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_workload">
workload
</a>
.
</p>
</dd>
<dt>
<a name="glos_transaction">
</a>
<span class="glossterm">
transaction
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030417872">
</a>
Transactions are atomic units of work that can be
<span class="bold">
<strong>
committed
</strong>
</span>
or
<span class="bold">
<strong>
rolled back
</strong>
</span>
. When a transaction
makes multiple changes to the database, either all the changes
succeed when the transaction is committed, or all the changes
are undone when the transaction is rolled back.
</p>
<p>
Database transactions, as implemented by
<code class="literal">
InnoDB
</code>
, have properties that are collectively
known by the acronym
<span class="bold">
<strong>
ACID
</strong>
</span>
, for
atomicity, consistency, isolation, and durability.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_isolation_level">
isolation level
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
.
</p>
</dd>
<dt>
<a name="glos_transaction_id">
</a>
<span class="glossterm">
transaction ID
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030409600">
</a>
An internal field associated with each
<span class="bold">
<strong>
row
</strong>
</span>
. This field is physically
changed by
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
,
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
, and
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
operations to record which
<span class="bold">
<strong>
transaction
</strong>
</span>
has locked the row.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_implicit_row_lock">
implicit row lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_row">
row
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_transparent_page_compression">
</a>
<span class="glossterm">
transparent page compression
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030400688">
</a>
A feature added in MySQL 5.7.8 that permits page-level
compression for
<code class="literal">
InnoDB
</code>
tables that reside in
<span class="bold">
<strong>
file-per-table
</strong>
</span>
tablespaces.
Page compression is enabled by specifying the
<code class="literal">
COMPRESSION
</code>
attribute with
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
</code>
</a>
or
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
. For more
information, see
<a class="xref" href="innodb-page-compression.html" title="17.9.2 InnoDB Page Compression">
Section 17.9.2, “InnoDB Page Compression”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_file_per_table">
file-per-table
</a>
,
<a class="glossseealso" href="glossary.html#glos_hole_punching">
hole punching
</a>
,
<a class="glossseealso" href="glossary.html#glos_sparse_file">
sparse file
</a>
.
</p>
</dd>
<dt>
<a name="glos_transportable_tablespace">
</a>
<span class="glossterm">
transportable tablespace
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030391520">
</a>
A feature that allows a
<span class="bold">
<strong>
tablespace
</strong>
</span>
to be moved from one
instance to another. Traditionally, this has not been possible
for
<code class="literal">
InnoDB
</code>
tablespaces because all table data
was part of the
<span class="bold">
<strong>
system
tablespace
</strong>
</span>
. In MySQL 5.6 and higher, the
<a class="link" href="flush.html#flush-tables-for-export-with-list">
<code class="literal">
FLUSH
TABLES ... FOR EXPORT
</code>
</a>
syntax prepares an
<code class="literal">
InnoDB
</code>
table for copying to another server;
running
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
... DISCARD TABLESPACE
</code>
</a>
and
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE ...
IMPORT TABLESPACE
</code>
</a>
on the other server brings the
copied data file into the other instance. A separate
<span class="bold">
<strong>
.cfg file
</strong>
</span>
, copied along with
the
<span class="bold">
<strong>
.ibd file
</strong>
</span>
, is used to
update the table metadata (for example the
<span class="bold">
<strong>
space ID
</strong>
</span>
) as the tablespace is
imported. See
<a class="xref" href="innodb-table-import.html" title="17.6.1.3 Importing InnoDB Tables">
Section 17.6.1.3, “Importing InnoDB Tables”
</a>
for usage
information.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cfg_file">
.cfg file
</a>
,
<a class="glossseealso" href="glossary.html#glos_ibd_file">
.ibd file
</a>
,
<a class="glossseealso" href="glossary.html#glos_space_id">
space ID
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_tablespace">
tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_troubleshooting">
</a>
<span class="glossterm">
troubleshooting
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030376864">
</a>
The process of determining the source of a problem. Some of the
resources for troubleshooting MySQL problems include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="xref" href="starting-server-troubleshooting.html" title="2.9.2.1 Troubleshooting Problems Starting the MySQL Server">
Section 2.9.2.1, “Troubleshooting Problems Starting the MySQL Server”
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="problems-connecting.html" title="8.2.22 Troubleshooting Problems Connecting to MySQL">
Section 8.2.22, “Troubleshooting Problems Connecting to MySQL”
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="resetting-permissions.html" title="B.3.3.2 How to Reset the Root Password">
Section B.3.3.2, “How to Reset the Root Password”
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="common-errors.html" title="B.3.2 Common Errors When Using MySQL Programs">
Section B.3.2, “Common Errors When Using MySQL Programs”
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="innodb-troubleshooting.html" title="17.20 InnoDB Troubleshooting">
Section 17.20, “InnoDB Troubleshooting”
</a>
.
</p>
</li>
</ul>
</div>
</dd>
<dt>
<a name="glos_truncate">
</a>
<span class="glossterm">
truncate
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030367232">
</a>
A
<span class="bold">
<strong>
DDL
</strong>
</span>
operation that removes
the entire contents of a table, while leaving the table and
related indexes intact. Contrast with
<span class="bold">
<strong>
drop
</strong>
</span>
. Although conceptually it
has the same result as a
<code class="literal">
DELETE
</code>
statement
with no
<code class="literal">
WHERE
</code>
clause, it operates differently
behind the scenes:
<code class="literal">
InnoDB
</code>
creates a new empty
table, drops the old table, then renames the new table to take
the place of the old one. Because this is a DDL operation, it
cannot be
<span class="bold">
<strong>
rolled back
</strong>
</span>
.
</p>
<p>
If the table being truncated contains
<span class="bold">
<strong>
foreign keys
</strong>
</span>
that reference
another table, the truncation operation uses a slower method of
operation, deleting one row at a time so that corresponding rows
in the referenced table can be deleted as needed by any
<code class="literal">
ON DELETE CASCADE
</code>
clause. (MySQL 5.5 and
higher do not allow this slower form of truncate, and return an
error instead if foreign keys are involved. In this case, use a
<code class="literal">
DELETE
</code>
statement instead.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ddl">
DDL
</a>
,
<a class="glossseealso" href="glossary.html#glos_drop">
drop
</a>
,
<a class="glossseealso" href="glossary.html#glos_foreign_key">
foreign key
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
.
</p>
</dd>
<dt>
<a name="glos_truststore">
</a>
<span class="glossterm">
truststore
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030355472">
</a>
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ssl">
SSL
</a>
.
</p>
</dd>
<dt>
<a name="glos_tuple">
</a>
<span class="glossterm">
tuple
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030352992">
</a>
A technical term designating an ordered set of elements. It is
an abstract notion, used in formal discussions of database
theory. In the database field, tuples are usually represented by
the columns of a table row. They could also be represented by
the result sets of queries, for example, queries that retrieved
only some columns of a table, or columns from joined tables.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cursor">
cursor
</a>
.
</p>
</dd>
<dt>
<a name="glos_two_phase_commit">
</a>
<span class="glossterm">
two-phase commit
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030350000">
</a>
An operation that is part of a distributed
<span class="bold">
<strong>
transaction
</strong>
</span>
, under the
<span class="bold">
<strong>
XA
</strong>
</span>
specification. (Sometimes
abbreviated as 2PC.) When multiple databases participate in the
transaction, either all databases
<span class="bold">
<strong>
commit
</strong>
</span>
the changes, or all
databases
<span class="bold">
<strong>
roll back
</strong>
</span>
the
changes.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_xa">
XA
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
U
</h3>
<dl>
<dt>
<a name="glos_undo">
</a>
<span class="glossterm">
undo
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030342176">
</a>
Data that is maintained throughout the life of a
<span class="bold">
<strong>
transaction
</strong>
</span>
, recording all
changes so that they can be undone in case of a
<span class="bold">
<strong>
rollback
</strong>
</span>
operation. It is
stored in
<span class="bold">
<strong>
undo logs
</strong>
</span>
either
within the
<span class="bold">
<strong>
system tablespace
</strong>
</span>
(in MySQL 5.7 or earlier) or in separate
<span class="bold">
<strong>
undo tablespaces
</strong>
</span>
. As of MySQL
8.0, undo logs reside in undo tablespaces by default.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback_segment">
rollback segment
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_tablespace">
undo tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_undo_buffer">
</a>
<span class="glossterm">
undo buffer
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_undo_log">
undo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_undo_log">
</a>
<span class="glossterm">
undo log
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030331808">
</a>
A storage area that holds copies of data modified by active
<span class="bold">
<strong>
transactions
</strong>
</span>
. If another
transaction needs to see the original data (as part of a
<span class="bold">
<strong>
consistent read
</strong>
</span>
operation), the
unmodified data is retrieved from this storage area.
</p>
<p>
In MySQL 5.6 and MySQL 5.7, you can use the
<a class="link" href="innodb-parameters.html#sysvar_innodb_undo_tablespaces">
<code class="literal">
innodb_undo_tablespaces
</code>
</a>
variable have undo logs reside in
<span class="bold">
<strong>
undo
tablespaces
</strong>
</span>
, which can be placed on another storage
device such as an
<span class="bold">
<strong>
SSD
</strong>
</span>
. In MySQL
8.0, undo logs reside in two default undo tablespaces that are
created when MySQL is initialized, and additional undo
tablespaces can be created using
<a class="link" href="create-tablespace.html" title="15.1.21 CREATE TABLESPACE Statement">
<code class="literal">
CREATE UNDO
TABLESPACE
</code>
</a>
syntax.
</p>
<p>
The undo log is split into separate portions, the
<span class="bold">
<strong>
insert undo buffer
</strong>
</span>
and the
<span class="bold">
<strong>
update undo buffer
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_consistent_read">
consistent read
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback_segment">
rollback segment
</a>
,
<a class="glossseealso" href="glossary.html#glos_ssd">
SSD
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_tablespace">
undo tablespace
</a>
.
</p>
</dd>
<dt>
<a name="glos_undo_log_segment">
</a>
<span class="glossterm">
undo log segment
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030318528">
</a>
A collection of
<span class="bold">
<strong>
undo logs
</strong>
</span>
. Undo
log segments exists within
<span class="bold">
<strong>
rollback
segments
</strong>
</span>
. An undo log segment might contain undo logs
from multiple transactions. An undo log segment can only be used
by one transaction at a time but can be reused after it is
released at transaction
<span class="bold">
<strong>
commit
</strong>
</span>
or
<span class="bold">
<strong>
rollback
</strong>
</span>
. May also be
referred to as an
<span class="quote">
“
<span class="quote">
undo segment
</span>
”
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback">
rollback
</a>
,
<a class="glossseealso" href="glossary.html#glos_rollback_segment">
rollback segment
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
.
</p>
</dd>
<dt>
<a name="glos_undo_tablespace">
</a>
<span class="glossterm">
undo tablespace
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030310768">
</a>
An undo tablespace contains
<span class="bold">
<strong>
undo
logs
</strong>
</span>
. Undo logs exist within
<span class="bold">
<strong>
undo log segments
</strong>
</span>
, which are
contained within
<span class="bold">
<strong>
rollback
segments
</strong>
</span>
. Rollback segments have traditionally
resided in the system tablespace. As of MySQL 5.6, rollback
segments can reside in undo tablespaces. In MySQL 5.6 and MySQL
5.7, the number of undo tablespaces is controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_undo_tablespaces">
<code class="literal">
innodb_undo_tablespaces
</code>
</a>
configuration option. In MySQL 8.0, two default undo tablespaces
are created when the MySQL instance is initialized, and
additional undo tablespaces can be created using
<a class="link" href="create-tablespace.html" title="15.1.21 CREATE TABLESPACE Statement">
<code class="literal">
CREATE UNDO
TABLESPACE
</code>
</a>
syntax.
</p>
<p>
For more information, see
<a class="xref" href="innodb-undo-tablespaces.html" title="17.6.3.4 Undo Tablespaces">
Section 17.6.3.4, “Undo Tablespaces”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_rollback_segment">
rollback segment
</a>
,
<a class="glossseealso" href="glossary.html#glos_system_tablespace">
system tablespace
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log">
undo log
</a>
,
<a class="glossseealso" href="glossary.html#glos_undo_log_segment">
undo log segment
</a>
.
</p>
</dd>
<dt>
<a name="glos_unicode">
</a>
<span class="glossterm">
Unicode
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030300352">
</a>
A system for supporting national characters, character sets,
code pages, and other internationalization aspects in a flexible
and standardized way.
</p>
<p>
Unicode support is an important aspect of the
<span class="bold">
<strong>
ODBC
</strong>
</span>
standard.
<span class="bold">
<strong>
Connector/ODBC
</strong>
</span>
5.1 is a Unicode
driver, as opposed to Connector/ODBC 3.51, which is an
<span class="bold">
<strong>
ANSI
</strong>
</span>
driver.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_ansi">
ANSI
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_odbc">
Connector/ODBC
</a>
,
<a class="glossseealso" href="glossary.html#glos_odbc">
ODBC
</a>
.
</p>
</dd>
<dt>
<a name="glos_unique_constraint">
</a>
<span class="glossterm">
unique constraint
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030293808">
</a>
A kind of
<span class="bold">
<strong>
constraint
</strong>
</span>
that
asserts that a column cannot contain any duplicate values. In
terms of
<span class="bold">
<strong>
relational
</strong>
</span>
algebra, it
is used to specify 1-to-1 relationships. For efficiency in
checking whether a value can be inserted (that is, the value
does not already exist in the column), a unique constraint is
supported by an underlying
<span class="bold">
<strong>
unique
index
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_constraint">
constraint
</a>
,
<a class="glossseealso" href="glossary.html#glos_relational">
relational
</a>
,
<a class="glossseealso" href="glossary.html#glos_unique_index">
unique index
</a>
.
</p>
</dd>
<dt>
<a name="glos_unique_index">
</a>
<span class="glossterm">
unique index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030287776">
</a>
An index on a column or set of columns that have a
<span class="bold">
<strong>
unique constraint
</strong>
</span>
. Because the
index is known not to contain any duplicate values, certain
kinds of lookups and count operations are more efficient than in
the normal kind of index. Most of the lookups against this type
of index are simply to determine if a certain value exists or
not. The number of values in the index is the same as the number
of rows in the table, or at least the number of rows with
non-null values for the associated columns.
</p>
<p>
<span class="bold">
<strong>
Change buffering
</strong>
</span>
optimization
does not apply to unique indexes. As a workaround, you can
temporarily set
<code class="literal">
unique_checks=0
</code>
while doing a
bulk data load into an
<code class="literal">
InnoDB
</code>
table.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cardinality">
cardinality
</a>
,
<a class="glossseealso" href="glossary.html#glos_change_buffering">
change buffering
</a>
,
<a class="glossseealso" href="glossary.html#glos_unique_constraint">
unique constraint
</a>
,
<a class="glossseealso" href="glossary.html#glos_unique_key">
unique key
</a>
.
</p>
</dd>
<dt>
<a name="glos_unique_key">
</a>
<span class="glossterm">
unique key
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030279616">
</a>
The set of columns (one or more) comprising a
<span class="bold">
<strong>
unique index
</strong>
</span>
. When you can
define a
<code class="literal">
WHERE
</code>
condition that matches exactly
one row, and the query can use an associated unique index, the
lookup and error handling can be performed very efficiently.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_cardinality">
cardinality
</a>
,
<a class="glossseealso" href="glossary.html#glos_unique_constraint">
unique constraint
</a>
,
<a class="glossseealso" href="glossary.html#glos_unique_index">
unique index
</a>
.
</p>
</dd>
<dt>
<a name="glos_upn">
</a>
<span class="glossterm">
UPN
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_user_principal_name">
user principal name
</a>
.
</p>
</dd>
<dt>
<a name="glos_user_principal_name">
</a>
<span class="glossterm">
user principal name
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030272912">
</a>
The name for a Kerberos named entity that represents a user.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_principal">
principal
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
V
</h3>
<dl>
<dt>
<a name="glos_variable_length_type">
</a>
<span class="glossterm">
variable-length type
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030269648">
</a>
A data type of variable length.
<a class="link" href="char.html" title="13.3.2 The CHAR and VARCHAR Types">
<code class="literal">
VARCHAR
</code>
</a>
,
<a class="link" href="binary-varbinary.html" title="13.3.3 The BINARY and VARBINARY Types">
<code class="literal">
VARBINARY
</code>
</a>
, and
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
BLOB
</code>
</a>
and
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
TEXT
</code>
</a>
types are variable-length
types.
</p>
<p>
<code class="literal">
InnoDB
</code>
treats fixed-length fields greater
than or equal to 768 bytes in length as variable-length fields,
which can be stored
<span class="bold">
<strong>
off-page
</strong>
</span>
.
For example, a
<code class="literal">
CHAR(255)
</code>
column can exceed
768 bytes if the maximum byte length of the character set is
greater than 3, as it is with
<code class="literal">
utf8mb4
</code>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_off_page_column">
off-page column
</a>
,
<a class="glossseealso" href="glossary.html#glos_overflow_page">
overflow page
</a>
.
</p>
</dd>
<dt>
<a name="glos_victim">
</a>
<span class="glossterm">
victim
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030258080">
</a>
The
<span class="bold">
<strong>
transaction
</strong>
</span>
that is
automatically chosen to be
<span class="bold">
<strong>
rolled
back
</strong>
</span>
when a
<span class="bold">
<strong>
deadlock
</strong>
</span>
is detected.
<code class="literal">
InnoDB
</code>
rolls back the
transaction that has updated the fewest rows.
</p>
<p>
<span class="bold">
<strong>
Deadlock detection
</strong>
</span>
can be
disabled using the
<a class="link" href="innodb-parameters.html#sysvar_innodb_deadlock_detect">
<code class="literal">
innodb_deadlock_detect
</code>
</a>
configuration option.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_deadlock">
deadlock
</a>
,
<a class="glossseealso" href="glossary.html#glos_deadlock_detection">
deadlock detection
</a>
,
<a class="glossseealso" href="glossary.html#glos_innodb_lock_wait_timeout">
innodb_lock_wait_timeout
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
.
</p>
</dd>
<dt>
<a name="glos_view">
</a>
<span class="glossterm">
view
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030248416">
</a>
A stored query that when invoked produces a result set. A view
acts as a virtual table.
</p>
</dd>
<dt>
<a name="glos_virtual_column">
</a>
<span class="glossterm">
virtual column
</span>
</dt>
<dd>
<p>
See
<a class="glosssee" href="glossary.html#glos_virtual_generated_column">
virtual generated column
</a>
.
</p>
</dd>
<dt>
<a name="glos_virtual_generated_column">
</a>
<span class="glossterm">
virtual generated column
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030244928">
</a>
A column whose values are computed from an expression included
in the column definition. Column values are not stored, but are
evaluated when rows are read, immediately after any
<code class="literal">
BEFORE
</code>
triggers. A virtual generated column
takes no storage.
<code class="literal">
InnoDB
</code>
supports secondary
indexes on virtual generated columns.
</p>
<p>
Contrast with
<span class="bold">
<strong>
stored generated
column
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_base_column">
base column
</a>
,
<a class="glossseealso" href="glossary.html#glos_generated_column">
generated column
</a>
,
<a class="glossseealso" href="glossary.html#glos_stored_generated_column">
stored generated column
</a>
.
</p>
</dd>
<dt>
<a name="glos_virtual_index">
</a>
<span class="glossterm">
virtual index
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030238384">
</a>
A virtual index is a
<span class="bold">
<strong>
secondary
index
</strong>
</span>
on one or more
<span class="bold">
<strong>
virtual
generated columns
</strong>
</span>
or on a combination of virtual
generated columns and regular columns or stored generated
columns. For more information, see
<a class="xref" href="create-table-secondary-indexes.html" title="15.1.20.9 Secondary Indexes and Generated Columns">
Section 15.1.20.9, “Secondary Indexes and Generated Columns”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_secondary_index">
secondary index
</a>
,
<a class="glossseealso" href="glossary.html#glos_stored_generated_column">
stored generated column
</a>
,
<a class="glossseealso" href="glossary.html#glos_virtual_generated_column">
virtual generated column
</a>
.
</p>
</dd>
<dt>
<a name="glos_visual_studio">
</a>
<span class="glossterm">
Visual Studio
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030232352">
</a>
For supported versions of Visual Studio, see the following
references:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Connector/NET:
<a class="ulink" href="/doc/connector-net/en/connector-net-versions.html" target="_top">
Connector/NET Versions
</a>
</p>
</li>
<li class="listitem">
<p>
Connector/C++ 8.0:
<a class="ulink" href="/doc/connector-cpp/9.1/en/connector-cpp-introduction.html#connector-cpp-prerequisites" target="_top">
Platform Support and Prerequisites
</a>
</p>
</li>
</ul>
</div>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_connector_c__">
Connector/C++
</a>
,
<a class="glossseealso" href="glossary.html#glos_connector_net">
Connector/NET
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
W
</h3>
<dl>
<dt>
<a name="glos_wait">
</a>
<span class="glossterm">
wait
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030225072">
</a>
When an operation, such as acquiring a
<span class="bold">
<strong>
lock
</strong>
</span>
,
<span class="bold">
<strong>
mutex
</strong>
</span>
, or
<span class="bold">
<strong>
latch
</strong>
</span>
, cannot be completed
immediately,
<code class="literal">
InnoDB
</code>
pauses and tries again.
The mechanism for pausing is elaborate enough that this
operation has its own name, the
<span class="bold">
<strong>
wait
</strong>
</span>
. Individual threads are
paused using a combination of internal
<code class="literal">
InnoDB
</code>
scheduling, operating system
<code class="literal">
wait()
</code>
calls,
and short-duration
<span class="bold">
<strong>
spin
</strong>
</span>
loops.
</p>
<p>
On systems with heavy load and many transactions, you might use
the output from the
<code class="literal">
SHOW INNODB STATUS
</code>
command or
<span class="bold">
<strong>
Performance Schema
</strong>
</span>
to determine whether threads are spending too much time waiting,
and if so, how you can improve
<span class="bold">
<strong>
concurrency
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_concurrency">
concurrency
</a>
,
<a class="glossseealso" href="glossary.html#glos_latch">
latch
</a>
,
<a class="glossseealso" href="glossary.html#glos_lock">
lock
</a>
,
<a class="glossseealso" href="glossary.html#glos_mutex">
mutex
</a>
,
<a class="glossseealso" href="glossary.html#glos_performance_schema">
Performance Schema
</a>
,
<a class="glossseealso" href="glossary.html#glos_spin">
spin
</a>
.
</p>
</dd>
<dt>
<a name="glos_warm_backup">
</a>
<span class="glossterm">
warm backup
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030211152">
</a>
A
<span class="bold">
<strong>
backup
</strong>
</span>
taken while the
database is running, but that restricts some database operations
during the backup process. For example, tables might become
read-only. For busy applications and websites, you might prefer
a
<span class="bold">
<strong>
hot backup
</strong>
</span>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_backup">
backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_cold_backup">
cold backup
</a>
,
<a class="glossseealso" href="glossary.html#glos_hot_backup">
hot backup
</a>
.
</p>
</dd>
<dt>
<a name="glos_warm_up">
</a>
<span class="glossterm">
warm up
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030205872">
</a>
To run a system under a typical
<span class="bold">
<strong>
workload
</strong>
</span>
for some time after
startup, so that the
<span class="bold">
<strong>
buffer
pool
</strong>
</span>
and other memory regions are filled as they
would be under normal conditions. This process happens naturally
over time when a MySQL server is restarted or subjected to a new
workload.
</p>
<p>
Typically, you run a workload for some time to warm up the
buffer pool before running performance tests, to ensure
consistent results across multiple runs; otherwise, performance
might be artificially low during the first run.
</p>
<p>
In MySQL 5.6, you can speed up the warmup process by enabling
the
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_dump_at_shutdown">
<code class="literal">
innodb_buffer_pool_dump_at_shutdown
</code>
</a>
and
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_load_at_startup">
<code class="literal">
innodb_buffer_pool_load_at_startup
</code>
</a>
configuration options, to bring the contents of the buffer pool
back into memory after a restart. These options are enabled by
default in MySQL 5.7. See
<a class="xref" href="innodb-preload-buffer-pool.html" title="17.8.3.6 Saving and Restoring the Buffer Pool State">
Section 17.8.3.6, “Saving and Restoring the Buffer Pool State”
</a>
.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_workload">
workload
</a>
.
</p>
</dd>
<dt>
<a name="glos_workload">
</a>
<span class="glossterm">
workload
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030196400">
</a>
The combination and volume of
<span class="bold">
<strong>
SQL
</strong>
</span>
and other database
operations, performed by a database application during typical
or peak usage. You can subject the database to a particular
workload during performance testing to identify
<span class="bold">
<strong>
bottlenecks
</strong>
</span>
, or during capacity
planning.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_bottleneck">
bottleneck
</a>
,
<a class="glossseealso" href="glossary.html#glos_cpu_bound">
CPU-bound
</a>
,
<a class="glossseealso" href="glossary.html#glos_disk_bound">
disk-bound
</a>
,
<a class="glossseealso" href="glossary.html#glos_sql">
SQL
</a>
.
</p>
</dd>
<dt>
<a name="glos_write_combining">
</a>
<span class="glossterm">
write combining
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030190608">
</a>
An optimization technique that reduces write operations when
<span class="bold">
<strong>
dirty pages
</strong>
</span>
are
<span class="bold">
<strong>
flushed
</strong>
</span>
from the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
buffer
pool
</strong>
</span>
. If a row in a page is updated multiple times,
or multiple rows on the same page are updated, all of those
changes are stored to the data files in a single write operation
rather than one write for each change.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_dirty_page">
dirty page
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
X
</h3>
<dl>
<dt>
<a name="glos_xa">
</a>
<span class="glossterm">
XA
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030183280">
</a>
A standard interface for coordinating distributed
<span class="bold">
<strong>
transactions
</strong>
</span>
, allowing multiple
databases to participate in a transaction while maintaining
<span class="bold">
<strong>
ACID
</strong>
</span>
compliance. For full
details, see
<a class="xref" href="xa.html" title="15.3.8 XA Transactions">
Section 15.3.8, “XA Transactions”
</a>
.
</p>
<p>
XA Distributed Transaction support is enabled by default.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_acid">
ACID
</a>
,
<a class="glossseealso" href="glossary.html#glos_binary_log">
binary log
</a>
,
<a class="glossseealso" href="glossary.html#glos_commit">
commit
</a>
,
<a class="glossseealso" href="glossary.html#glos_transaction">
transaction
</a>
,
<a class="glossseealso" href="glossary.html#glos_two_phase_commit">
two-phase commit
</a>
.
</p>
</dd>
</dl>
</div>
<div class="glossdiv">
<h3 class="title">
Y
</h3>
<dl>
<dt>
<a name="glos_young">
</a>
<span class="glossterm">
young
</span>
</dt>
<dd class="glossdef">
<p>
<a class="indexterm" name="idm46045030175280">
</a>
A characteristic of a
<span class="bold">
<strong>
page
</strong>
</span>
in
the
<code class="literal">
InnoDB
</code>
<span class="bold">
<strong>
buffer
pool
</strong>
</span>
meaning that it has been accessed recently, and
so is moved within the buffer pool data structure, so that it is
not
<span class="bold">
<strong>
flushed
</strong>
</span>
too soon by the
<span class="bold">
<strong>
LRU
</strong>
</span>
algorithm. This term is
used in some
<span class="bold">
<strong>
INFORMATION_SCHEMA
</strong>
</span>
column names of tables related to the buffer pool.
</p>
<p>
See Also
<a class="glossseealso" href="glossary.html#glos_buffer_pool">
buffer pool
</a>
,
<a class="glossseealso" href="glossary.html#glos_flush">
flush
</a>
,
<a class="glossseealso" href="glossary.html#glos_information_schema">
INFORMATION_SCHEMA
</a>
,
<a class="glossseealso" href="glossary.html#glos_lru">
LRU
</a>
,
<a class="glossseealso" href="glossary.html#glos_page">
page
</a>
.
</p>
</dd>
</dl>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/telemetry-metrics-meters.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="telemetry-metrics-meters">
</a>
35.4.2 Server Meters
</h3>
</div>
</div>
</div>
<p>
The server metrics are organised in groups, called Meters.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa68490063"><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></span> <span class="token keyword">select</span> <span class="token operator">*</span> <span class="token keyword">from</span> performance_schema<span class="token punctuation">.</span>setup_meters<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 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> NAME <span class="token punctuation">|</span> FREQUENCY <span class="token punctuation">|</span> ENABLED <span class="token punctuation">|</span> DESCRIPTION <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 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> mysql.inno <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql InnoDB metrics <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mysql.inno.buffer_pool <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql InnoDB buffer pool metrics <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mysql.inno.data <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql InnoDB data metrics <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mysql.x <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql X plugin metrics <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mysql.x.stmt <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql X plugin statement statistics <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mysql.stats <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql core metrics <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mysql.stats.com <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql command stats <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mysql.stats.connection <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql connection stats <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mysql.stats.handler <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql handler stats <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mysql.stats.ssl <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql TLS related stats <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mysql.myisam <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql MyISAM storage engine stats <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> mysql.perf_schema <span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> YES <span class="token punctuation">|</span> MySql performance_schema lost instruments <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 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>
<code class="literal">
FREQUENCY
</code>
and
<code class="literal">
ENABLED
</code>
can
be edited. For example, to update the frequency of the
mysql.inno metrics:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa51840041"><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></span><span class="token keyword">update</span> performance_schema<span class="token punctuation">.</span>setup_meters <span class="token keyword">set</span> FREQUENCY<span class="token operator">=</span><span class="token string">'30'</span> <span class="token keyword">where</span> <span class="token keyword">name</span> <span class="token operator">=</span> <span class="token string">'mysql.inno'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The maximum number of meter instruments which can be created is
set by
<a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_max_meter_classes">
<code class="literal">
performance_schema_max_meter_classes
</code>
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/upgrade-best-practices.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="upgrade-best-practices">
</a>
3.3 Upgrade Best Practices
</h2>
</div>
</div>
</div>
<a class="indexterm" name="idm46045326315808">
</a>
<p>
MySQL supports upgrading between minor versions (within an LTS
series) and to the next major version (across an LTS series).
Upgrading provides the latest features, performance, and security
fixes.
</p>
<p>
To prepare and help ensure that your upgrade to the latest MySQL
release is successful, we recommend the following best practices:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-version" title="Decide on Major or Minor Version for Upgrade">
Decide on Major or Minor Version for Upgrade
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-type" title="Decide on Upgrade Type">
Decide on Upgrade Type
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-platform" title="Review Supported Platforms">
Review Supported Platforms
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-changes" title="Understand MySQL Server Changes">
Understand MySQL Server Changes
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-check" title="Run Upgrade Checker and Fix Incompatibilities">
Run Upgrade Checker and Fix Incompatibilities
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-test" title="Run Applications in a Test Environment">
Run Applications in a Test Environment
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-benchmark" title="Benchmark Applications and Workload Performance">
Benchmark Applications and Workload Performance
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-compare" title="Run Both MySQL Versions in Parallel">
Run Both MySQL Versions in Parallel
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-final-test" title="Run Final Test Upgrade">
Run Final Test Upgrade
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-backup" title="Check MySQL Backup">
Check MySQL Backup
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-production" title="Upgrade Production Server">
Upgrade Production Server
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="upgrade-best-practices.html#upgrade-best-practices-support" title="Enterprise Support">
Enterprise Support
</a>
</p>
</li>
</ul>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-version">
</a>
Decide on Major or Minor Version for Upgrade
</h3>
</div>
</div>
</div>
<p>
The MySQL Release Model makes a distinction between LTS (Long Term
Support) and Innovation Releases. LTS releases have 8+ years of
support and are meant for production use. Innovation Releases
provide users with the latest features and capabilities. Learn
more about the
<a class="link" href="mysql-releases.html" title="1.3 MySQL Releases: Innovation and LTS">
MySQL Release
Model
</a>
.
</p>
<p>
Performing a minor version upgrade is straightforward while major
version upgrades require strategic planning and additional testing
before the upgrade. This guide is especially useful for major
version upgrades.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-type">
</a>
Decide on Upgrade Type
</h3>
</div>
</div>
</div>
<p>
There are three main ways to upgrade MySQL; read the associated
documentation to determine which type of upgrade is best suited
for your situation.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="link" href="upgrade-binary-package.html#upgrade-procedure-inplace" title="In-Place Upgrade">
An in-place
upgrade
</a>
: replacing the MySQL Server packages.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="upgrade-binary-package.html#upgrade-procedure-logical" title="Logical Upgrade">
A logical
upgrade
</a>
: exporting SQL from the old MySQL instance to
the new.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="replication-upgrade.html" title="19.5.3 Upgrading or Downgrading a Replication Topology">
A replication topology
upgrade
</a>
: account for each server's topology role.
</p>
</li>
</ul>
</div>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-platform">
</a>
Review Supported Platforms
</h3>
</div>
</div>
</div>
<p>
If your current operating system is not supported by the new
version of MySQL, then plan to upgrade the operating system as
otherwise an in-place upgrade is not supported.
</p>
<p>
For a current list of supported platforms, see:
<a class="ulink" href="https://www.mysql.com/support/supportedplatforms/database.html" target="_blank">
https://www.mysql.com/support/supportedplatforms/database.html
</a>
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-changes">
</a>
Understand MySQL Server Changes
</h3>
</div>
</div>
</div>
<p>
Each major version comes with new features, changes in behavior,
deprecations, and removals. It is important to understand the
impact of each of these to existing applications.
</p>
<p>
See:
<a class="xref" href="upgrading-from-previous-series.html" title="3.5 Changes in MySQL 8.4">
Section 3.5, “Changes in MySQL 8.4”
</a>
.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-check">
</a>
Run Upgrade Checker and Fix Incompatibilities
</h3>
</div>
</div>
</div>
<p>
MySQL Shell's
<a class="ulink" href="/doc/mysql-shell/8.4/en/mysql-shell-utilities-upgrade.html" target="_top">
Upgrade Checker Utility
</a>
detects incompatibilities between database versions that must be
addressed before performing the upgrade. The
<span class="command">
<strong>
util.checkForServerUpgrade()
</strong>
</span>
function verifies
that MySQL server instances are ready to upgrade. Connect to the
existing MySQL server and select the MySQL Server version you plan
to upgrade to for the utility to report issues to address prior to
an upgrade. These include incompatibilities in data types, storage
engines, and so on.
</p>
<p>
You are ready to upgrade when the upgrade checking utility no
longer reports any issues.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-test">
</a>
Run Applications in a Test Environment
</h3>
</div>
</div>
</div>
<p>
After completing the upgrade checker's requirements, next
test your applications on the new target MySQL server. Check for
errors and warnings in the MySQL error log and application logs.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-benchmark">
</a>
Benchmark Applications and Workload Performance
</h3>
</div>
</div>
</div>
<p>
We recommend benchmarking your own applications and workloads by
comparing how they perform using the previous and new versions of
MySQL. Usually, newer MySQL versions add features and improve
performance but there are cases where an upgrade might run slower
for specific queries. Possible issues resulting in performance
regressions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Prior server configuration is not optimal for newer version
</p>
</li>
<li class="listitem">
<p>
Changes to data types
</p>
</li>
<li class="listitem">
<p>
Additional storage required by Multi-byte character set
support
</p>
</li>
<li class="listitem">
<p>
Storage engines changes
</p>
</li>
<li class="listitem">
<p>
Dropped or changed indexes
</p>
</li>
<li class="listitem">
<p>
Stronger encryption
</p>
</li>
<li class="listitem">
<p>
Stronger authentication
</p>
</li>
<li class="listitem">
<p>
SQL optimizer changes
</p>
</li>
<li class="listitem">
<p>
Newer version of MySQL require additional memory
</p>
</li>
<li class="listitem">
<p>
Physical or Virtual Hardware is slower - compute or storage
</p>
</li>
</ul>
</div>
<p>
For related information and potential mitigation techniques, see
<a class="ulink" href="/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-performance-regressions" target="_top">
Valid Performance Regressions
</a>
.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-compare">
</a>
Run Both MySQL Versions in Parallel
</h3>
</div>
</div>
</div>
<p>
To minimize risk, it is best keep the current system running while
running the upgraded system in parallel.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-final-test">
</a>
Run Final Test Upgrade
</h3>
</div>
</div>
</div>
<p>
Practice and do a run though prior to upgrading your production
server. Thoroughly test the upgrade procedures before upgrading a
production system.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-backup">
</a>
Check MySQL Backup
</h3>
</div>
</div>
</div>
<p>
Check that the full backup exists and is viable before performing
the upgrade.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-production">
</a>
Upgrade Production Server
</h3>
</div>
</div>
</div>
<p>
You are ready to complete the upgrade.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="upgrade-best-practices-support">
</a>
Enterprise Support
</h3>
</div>
</div>
</div>
<p>
If you're a MySQL Enterprise Edition customer, you can also contact the MySQL Support
Team experts with any questions you may have.
</p>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/rewriter-query-rewrite-plugin.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="rewriter-query-rewrite-plugin">
</a>
7.6.4 The Rewriter Query Rewrite Plugin
</h3>
</div>
</div>
</div>
<div class="toc">
<dl class="toc">
<dt>
<span class="section">
<a href="rewriter-query-rewrite-plugin-installation.html">
7.6.4.1 Installing or Uninstalling the Rewriter Query Rewrite Plugin
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="rewriter-query-rewrite-plugin-usage.html">
7.6.4.2 Using the Rewriter Query Rewrite Plugin
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="rewriter-query-rewrite-plugin-reference.html">
7.6.4.3 Rewriter Query Rewrite Plugin Reference
</a>
</span>
</dt>
</dl>
</div>
<a class="indexterm" name="idm46045256648128">
</a>
<a class="indexterm" name="idm46045256647040">
</a>
<p>
MySQL supports query rewrite plugins that can examine and possibly
modify SQL statements received by the server before the server
executes them. See
<a class="ulink" href="/doc/extending-mysql/8.4/en/plugin-types.html#query-rewrite-plugin-type" target="_top">
Query Rewrite Plugins
</a>
.
</p>
<p>
MySQL distributions include a postparse query rewrite plugin named
<code class="literal">
Rewriter
</code>
and scripts for installing the plugin
and its associated elements. These elements work together to
provide statement-rewriting capability:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
A server-side plugin named
<code class="literal">
Rewriter
</code>
examines statements and may rewrite them, based on its
in-memory cache of rewrite rules.
</p>
</li>
<li class="listitem">
<p>
These statements are subject to rewriting:
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
,
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
,
<a class="link" href="replace.html" title="15.2.12 REPLACE Statement">
<code class="literal">
REPLACE
</code>
</a>
,
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
, and
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
.
</p>
<p>
Standalone statements and prepared statements are subject to
rewriting. Statements occurring within view definitions or
stored programs are not subject to rewriting.
</p>
</li>
<li class="listitem">
<p>
The
<code class="literal">
Rewriter
</code>
plugin uses a database named
<code class="literal">
query_rewrite
</code>
containing a table named
<code class="literal">
rewrite_rules
</code>
. The table provides
persistent storage for the rules that the plugin uses to
decide whether to rewrite statements. Users communicate with
the plugin by modifying the set of rules stored in this table.
The plugin communicates with users by setting the
<code class="literal">
message
</code>
column of table rows.
</p>
</li>
<li class="listitem">
<p>
The
<code class="literal">
query_rewrite
</code>
database contains a
stored procedure named
<code class="literal">
flush_rewrite_rules()
</code>
that loads the
contents of the rules table into the plugin.
</p>
</li>
<li class="listitem">
<p>
A loadable function named
<a class="link" href="rewriter-query-rewrite-plugin-reference.html#function_load-rewrite-rules">
<code class="literal">
load_rewrite_rules()
</code>
</a>
is used by
the
<code class="literal">
flush_rewrite_rules()
</code>
stored procedure.
</p>
</li>
<li class="listitem">
<p>
The
<code class="literal">
Rewriter
</code>
plugin exposes system
variables that enable plugin configuration and status
variables that provide runtime operational information. This
plugin also supports a privilege
(
<a class="link" href="privileges-provided.html#priv_skip-query-rewrite">
<code class="literal">
SKIP_QUERY_REWRITE
</code>
</a>
) that
protects a given user's queries from being rewritten.
</p>
</li>
</ul>
</div>
<p>
The following sections describe how to install and use the
<code class="literal">
Rewriter
</code>
plugin, and provide reference
information for its associated elements.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/performance-schema-status-variable-summary-tables.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="performance-schema-status-variable-summary-tables">
</a>
29.12.20.12 Status Variable Summary Tables
</h4>
</div>
</div>
</div>
<p>
The Performance Schema makes status variable information
available in the tables described in
<a class="xref" href="performance-schema-status-variable-tables.html" title="29.12.15 Performance Schema Status Variable Tables">
Section 29.12.15, “Performance Schema Status Variable Tables”
</a>
.
It also makes aggregated status variable information available
in summary tables, described here. Each status variable
summary table has one or more grouping columns to indicate how
the table aggregates status values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
<code class="literal">
status_by_account
</code>
</a>
has
<code class="literal">
USER
</code>
,
<code class="literal">
HOST
</code>
, and
<code class="literal">
VARIABLE_NAME
</code>
columns to summarize
status variables by account.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
<code class="literal">
status_by_host
</code>
</a>
has
<code class="literal">
HOST
</code>
and
<code class="literal">
VARIABLE_NAME
</code>
columns to summarize
status variables by the host from which clients connected.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
<code class="literal">
status_by_user
</code>
</a>
has
<code class="literal">
USER
</code>
and
<code class="literal">
VARIABLE_NAME
</code>
columns to summarize
status variables by client user name.
</p>
</li>
</ul>
</div>
<p>
Each status variable summary table has this summary column
containing aggregated values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
VARIABLE_VALUE
</code>
</p>
<p>
The aggregated status variable value for active and
terminated sessions.
</p>
</li>
</ul>
</div>
<p>
The status variable summary tables have these indexes:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
<code class="literal">
status_by_account
</code>
</a>
:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
Primary key on (
<code class="literal">
USER
</code>
,
<code class="literal">
HOST
</code>
,
<code class="literal">
VARIABLE_NAME
</code>
)
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
<code class="literal">
status_by_host
</code>
</a>
:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
Primary key on (
<code class="literal">
HOST
</code>
,
<code class="literal">
VARIABLE_NAME
</code>
)
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
<code class="literal">
status_by_user
</code>
</a>
:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
Primary key on (
<code class="literal">
USER
</code>
,
<code class="literal">
VARIABLE_NAME
</code>
)
</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<p>
The meaning of
<span class="quote">
“
<span class="quote">
account
</span>
”
</span>
in these tables is
similar to its meaning in the MySQL grant tables in the
<code class="literal">
mysql
</code>
system database, in the sense that
the term refers to a combination of user and host values. They
differ in that, for grant tables, the host part of an account
can be a pattern, whereas for Performance Schema tables, the
host value is always a specific nonpattern host name.
</p>
<p>
Account status is collected when sessions terminate. The
session status counters are added to the global status
counters and the corresponding account status counters. If
account statistics are not collected, the session status is
added to host and user status, if host and user status are
collected.
</p>
<p>
Account, host, and user statistics are not collected if the
<a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_accounts_size">
<code class="literal">
performance_schema_accounts_size
</code>
</a>
,
<a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_hosts_size">
<code class="literal">
performance_schema_hosts_size
</code>
</a>
,
and
<a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_users_size">
<code class="literal">
performance_schema_users_size
</code>
</a>
system variables, respectively, are set to 0.
</p>
<p>
The Performance Schema supports
<a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
<code class="literal">
TRUNCATE
TABLE
</code>
</a>
for status variable summary tables as follows;
in all cases, status for active sessions is unaffected:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
<code class="literal">
status_by_account
</code>
</a>
: Aggregates
account status from terminated sessions to user and host
status, then resets account status.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
<code class="literal">
status_by_host
</code>
</a>
: Resets
aggregated host status from terminated sessions.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
<code class="literal">
status_by_user
</code>
</a>
: Resets
aggregated user status from terminated sessions.
</p>
</li>
</ul>
</div>
<p>
<a class="link" href="flush.html#flush-status">
<code class="literal">
FLUSH STATUS
</code>
</a>
adds the session
status from all active sessions to the global status
variables, resets the status of all active sessions, and
resets account, host, and user status values aggregated from
disconnected sessions.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/checksum-table.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="checksum-table">
</a>
15.7.3.3 CHECKSUM TABLE Statement
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045172248144">
</a>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa6616595"><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">CHECKSUM</span> <span class="token keyword">TABLE</span> <em class="replaceable">tbl_name</em> <span class="token punctuation">[</span><span class="token punctuation">,</span> <em class="replaceable">tbl_name</em><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 keyword">QUICK</span> <span class="token operator">|</span> <span class="token keyword">EXTENDED</span><span class="token punctuation">]</span></code></pre>
</div>
<p>
<a class="link" href="checksum-table.html" title="15.7.3.3 CHECKSUM TABLE Statement">
<code class="literal">
CHECKSUM TABLE
</code>
</a>
reports a
<a class="link" href="glossary.html#glos_checksum" title="checksum">
checksum
</a>
for the contents
of a table. You can use this statement to verify that the
contents are the same before and after a backup, rollback, or
other operation that is intended to put the data back to a known
state.
</p>
<p>
This statement requires the
<a class="link" href="privileges-provided.html#priv_select">
<code class="literal">
SELECT
</code>
</a>
privilege for the table.
</p>
<p>
This statement is not supported for views. If you run
<a class="link" href="checksum-table.html" title="15.7.3.3 CHECKSUM TABLE Statement">
<code class="literal">
CHECKSUM TABLE
</code>
</a>
against a view,
the
<code class="literal">
Checksum
</code>
value is always
<code class="literal">
NULL
</code>
, and a warning is returned.
</p>
<p>
For a nonexistent table,
<a class="link" href="checksum-table.html" title="15.7.3.3 CHECKSUM TABLE Statement">
<code class="literal">
CHECKSUM
TABLE
</code>
</a>
returns
<code class="literal">
NULL
</code>
and generates a
warning.
</p>
<p>
During the checksum operation, the table is locked with a read
lock for
<code class="literal">
InnoDB
</code>
and
<code class="literal">
MyISAM
</code>
.
</p>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="checksum-table-performance-considerations">
</a>
Performance Considerations
</h5>
</div>
</div>
</div>
<p>
By default, the entire table is read row by row and the
checksum is calculated. For large tables, this could take a
long time, thus you would only perform this operation
occasionally. This row-by-row calculation is what you get with
the
<code class="literal">
EXTENDED
</code>
clause, with
<code class="literal">
InnoDB
</code>
and all other storage engines other
than
<code class="literal">
MyISAM
</code>
, and with
<code class="literal">
MyISAM
</code>
tables not created with the
<code class="literal">
CHECKSUM=1
</code>
clause.
</p>
<p>
For
<code class="literal">
MyISAM
</code>
tables created with the
<code class="literal">
CHECKSUM=1
</code>
clause,
<a class="link" href="checksum-table.html" title="15.7.3.3 CHECKSUM TABLE Statement">
<code class="literal">
CHECKSUM TABLE
</code>
</a>
or
<a class="link" href="checksum-table.html" title="15.7.3.3 CHECKSUM TABLE Statement">
<code class="literal">
CHECKSUM TABLE
... QUICK
</code>
</a>
returns the
<span class="quote">
“
<span class="quote">
live
</span>
”
</span>
table
checksum that can be returned very fast. If the table does not
meet all these conditions, the
<code class="literal">
QUICK
</code>
method
returns
<code class="literal">
NULL
</code>
. The
<code class="literal">
QUICK
</code>
method is not supported with
<code class="literal">
InnoDB
</code>
tables.
See
<a class="xref" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
Section 15.1.20, “CREATE TABLE Statement”
</a>
for the syntax of the
<code class="literal">
CHECKSUM
</code>
clause.
</p>
<p>
The checksum value depends on the table row format. If the row
format changes, the checksum also changes. For example, the
storage format for temporal types such as
<a class="link" href="time.html" title="13.2.3 The TIME Type">
<code class="literal">
TIME
</code>
</a>
,
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATETIME
</code>
</a>
, and
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
changed in MySQL 5.6
prior to MySQL 5.6.5, so if a 5.5 table is upgraded to MySQL
5.6, the checksum value may change.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
If the checksums for two tables are different, then it is
almost certain that the tables are different in some way.
However, because the hashing function used by
<a class="link" href="checksum-table.html" title="15.7.3.3 CHECKSUM TABLE Statement">
<code class="literal">
CHECKSUM TABLE
</code>
</a>
is not
guaranteed to be collision-free, there is a slight chance
that two tables which are not identical can produce the same
checksum.
</p>
</div>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/innodb-performance-multiple_io_threads.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="innodb-performance-multiple_io_threads">
</a>
17.8.5 Configuring the Number of Background InnoDB I/O Threads
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045162734656">
</a>
<a class="indexterm" name="idm46045162733584">
</a>
<a class="indexterm" name="idm46045162732512">
</a>
<a class="indexterm" name="idm46045162731024">
</a>
<p>
<code class="literal">
InnoDB
</code>
uses background
<a class="link" href="glossary.html#glos_thread" title="thread">
threads
</a>
to service various
types of I/O requests. You can configure the number of background
threads that service read and write I/O on data pages using the
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_io_threads">
<code class="literal">
innodb_read_io_threads
</code>
</a>
and
<a class="link" href="innodb-parameters.html#sysvar_innodb_write_io_threads">
<code class="literal">
innodb_write_io_threads
</code>
</a>
configuration parameters. These parameters signify the number of
background threads used for read and write requests, respectively.
They are effective on all supported platforms. You can set values
for these parameters in the MySQL option file
(
<code class="literal">
my.cnf
</code>
or
<code class="literal">
my.ini
</code>
); you
cannot change values dynamically. The default value for
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_io_threads">
<code class="literal">
innodb_read_io_threads
</code>
</a>
is the
number of available logical processors on the system divided by 2,
with a minimum default value of
<code class="literal">
4
</code>
. The default
value for
<a class="link" href="innodb-parameters.html#sysvar_innodb_write_io_threads">
<code class="literal">
innodb_write_io_threads
</code>
</a>
is 4. The permissible values range from
<code class="literal">
1-64
</code>
for both options.
</p>
<p>
The purpose of these configuration options to make
<code class="literal">
InnoDB
</code>
more scalable on high end systems. Each
background thread can handle up to 256 pending I/O requests. A
major source of background I/O is
<a class="link" href="glossary.html#glos_read_ahead" title="read-ahead">
read-ahead
</a>
requests.
<code class="literal">
InnoDB
</code>
tries to balance the load of incoming
requests in such way that most background threads share work
equally.
<code class="literal">
InnoDB
</code>
also attempts to allocate read
requests from the same extent to the same thread, to increase the
chances of coalescing the requests. If you have a high end I/O
subsystem and you see more than 64 ×
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_io_threads">
<code class="literal">
innodb_read_io_threads
</code>
</a>
pending
read requests in
<code class="literal">
SHOW ENGINE INNODB STATUS
</code>
output, you might improve performance by increasing the value of
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_io_threads">
<code class="literal">
innodb_read_io_threads
</code>
</a>
.
</p>
<p>
On Linux systems,
<code class="literal">
InnoDB
</code>
uses the asynchronous
I/O subsystem by default to perform read-ahead and write requests
for data file pages, which changes the way that
<code class="literal">
InnoDB
</code>
background threads service these types
of I/O requests. For more information, see
<a class="xref" href="innodb-linux-native-aio.html" title="17.8.6 Using Asynchronous I/O on Linux">
Section 17.8.6, “Using Asynchronous I/O on Linux”
</a>
.
</p>
<p>
For more information about
<code class="literal">
InnoDB
</code>
I/O
performance, see
<a class="xref" href="optimizing-innodb-diskio.html" title="10.5.8 Optimizing InnoDB Disk I/O">
Section 10.5.8, “Optimizing InnoDB Disk I/O”
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/performance-schema-replication-applier-filters-table.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="performance-schema-replication-applier-filters-table">
</a>
29.12.11.3 The replication_applier_filters Table
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045071526848">
</a>
<a class="indexterm" name="idm46045071525344">
</a>
<p>
This table shows the replication channel specific filters
configured on this replica. Each row provides information on a
replication channel's configured type of filter. The
<code class="literal">
replication_applier_filters
</code>
table has these
columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
CHANNEL_NAME
</code>
</p>
<p>
The name of replication channel with a replication filter
configured.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
FILTER_NAME
</code>
</p>
<p>
The type of replication filter that has been configured
for this replication channel.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
FILTER_RULE
</code>
</p>
<p>
The rules configured for the replication filter type using
either
<code class="option">
--replicate-*
</code>
command options or
<a class="link" href="change-replication-filter.html" title="15.4.2.1 CHANGE REPLICATION FILTER Statement">
<code class="literal">
CHANGE REPLICATION FILTER
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
CONFIGURED_BY
</code>
</p>
<p>
The method used to configure the replication filter, can
be one of:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
CHANGE_REPLICATION_FILTER
</code>
configured by a global replication filter using a
<a class="link" href="change-replication-filter.html" title="15.4.2.1 CHANGE REPLICATION FILTER Statement">
<code class="literal">
CHANGE REPLICATION
FILTER
</code>
</a>
statement.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
STARTUP_OPTIONS
</code>
configured by a
global replication filter using a
<code class="option">
--replicate-*
</code>
option.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
CHANGE_REPLICATION_FILTER_FOR_CHANNEL
</code>
configured by a channel specific replication filter
using a
<code class="literal">
CHANGE REPLICATION FILTER FOR
CHANNEL
</code>
statement.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
STARTUP_OPTIONS_FOR_CHANNEL
</code>
configured by a channel specific replication filter
using a
<code class="option">
--replicate-*
</code>
option.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<code class="literal">
ACTIVE_SINCE
</code>
</p>
<p>
Timestamp of when the replication filter was configured.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
COUNTER
</code>
</p>
<p>
The number of times the replication filter has been used
since it was configured.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/start-group-replication.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="start-group-replication">
</a>
15.4.3.1 START GROUP_REPLICATION Statement
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045176853024">
</a>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa76646187"><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">START</span> <span class="token keyword">GROUP_REPLICATION</span>
<span class="token punctuation">[</span><span class="token keyword">USER</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">user_name</em>'</span><span class="token punctuation">]</span>
<span class="token punctuation">[</span><span class="token punctuation">,</span> <span class="token keyword">PASSWORD</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">user_pass</em>'</span><span class="token punctuation">]</span>
<span class="token punctuation">[</span><span class="token punctuation">,</span> <span class="token keyword">DEFAULT_AUTH</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">plugin_name</em>'</span><span class="token punctuation">]</span></code></pre>
</div>
<p>
Starts group replication. This statement requires the
<a class="link" href="privileges-provided.html#priv_group-replication-admin">
<code class="literal">
GROUP_REPLICATION_ADMIN
</code>
</a>
privilege
(or the deprecated
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege). If
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only=ON
</code>
</a>
is set and
the member should join as a primary,
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
is set to
<code class="literal">
OFF
</code>
once Group Replication successfully
starts.
</p>
<p>
A server that participates in a group in single-primary mode
should use
<a class="link" href="replication-options-replica.html#sysvar_skip_replica_start">
<code class="literal">
skip_replica_start=ON
</code>
</a>
.
Otherwise, the server is not allowed to join a group as a
secondary.
</p>
<p>
You can specify user credentials for distributed recovery in the
<code class="literal">
START GROUP_REPLICATION
</code>
statement using the
<code class="literal">
USER
</code>
,
<code class="literal">
PASSWORD
</code>
, and
<code class="literal">
DEFAULT_AUTH
</code>
options, as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
USER
</code>
: The replication user for
distributed recovery. For instructions to set up this
account, see
<a class="xref" href="group-replication-user-credentials.html" title="20.2.1.3 User Credentials For Distributed Recovery">
Section 20.2.1.3, “User Credentials For Distributed Recovery”
</a>
. You
cannot specify an empty or null string, or omit the
<code class="literal">
USER
</code>
option if
<code class="literal">
PASSWORD
</code>
is specified.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PASSWORD
</code>
: The password for the
replication user account. The password cannot be encrypted,
but it is masked in the query log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DEFAULT_AUTH
</code>
: The name of the
authentication plugin used for the replication user account.
If you do not specify this option, MySQL native
authentication (the
<code class="literal">
mysql_native_password
</code>
plugin) is assumed. This option acts as a hint to the
server, and the donor for distributed recovery overrides it
if a different plugin is associated with the user account on
that server. The authentication plugin used by default when
you create user accounts in MySQL 8 is the caching SHA-2
authentication plugin
(
<code class="literal">
caching_sha2_password
</code>
). See
<a class="xref" href="pluggable-authentication.html" title="8.2.17 Pluggable Authentication">
Section 8.2.17, “Pluggable Authentication”
</a>
for more
information on authentication plugins.
</p>
</li>
</ul>
</div>
<p>
These credentials are used for distributed recovery on the
<code class="literal">
group_replication_recovery
</code>
channel. When you
specify user credentials on
<code class="literal">
START
GROUP_REPLICATION
</code>
, the credentials are saved in memory
only, and are removed by a
<code class="literal">
STOP
GROUP_REPLICATION
</code>
statement or server shutdown. You
must issue a
<code class="literal">
START GROUP_REPLICATION
</code>
statement to provide the credentials again. This method is
therefore not compatible with starting Group Replication
automatically on server start, as specified by the
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_start_on_boot">
<code class="literal">
group_replication_start_on_boot
</code>
</a>
system variable.
</p>
<p>
User credentials specified on
<code class="literal">
START
GROUP_REPLICATION
</code>
take precedence over any user
credentials set for the
<code class="literal">
group_replication_recovery
</code>
channel using a
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE TO
</code>
</a>
.
Note that user credentials set using these statements are stored
in the replication metadata repositories, and are used when
<code class="literal">
START GROUP_REPLICATION
</code>
is specified without
user credentials, including automatic starts if the
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_start_on_boot">
<code class="literal">
group_replication_start_on_boot
</code>
</a>
system variable is set to
<code class="literal">
ON
</code>
. To gain the
security benefits of specifying user credentials on
<code class="literal">
START GROUP_REPLICATION
</code>
, ensure that
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_start_on_boot">
<code class="literal">
group_replication_start_on_boot
</code>
</a>
is set to
<code class="literal">
OFF
</code>
(the default is
<code class="literal">
ON
</code>
), and clear any user credentials
previously set for the
<code class="literal">
group_replication_recovery
</code>
channel, following
the instructions in
<a class="xref" href="group-replication-distributed-recovery-securing.html" title="20.6.3 Securing Distributed Recovery Connections">
Section 20.6.3, “Securing Distributed Recovery Connections”
</a>
.
</p>
<p>
While a member is rejoining a replication group, its status can
be displayed as
<code class="literal">
OFFLINE
</code>
or
<code class="literal">
ERROR
</code>
before the group completes the
compatibility checks and accepts it as a member. When the member
is catching up with the group's transactions, its status is
<code class="literal">
RECOVERING
</code>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/information-schema-innodb-buffer-page-table.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="information-schema-innodb-buffer-page-table">
</a>
28.4.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045077795008">
</a>
<p>
The
<a class="link" href="information-schema-innodb-buffer-page-table.html" title="28.4.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table">
<code class="literal">
INNODB_BUFFER_PAGE
</code>
</a>
table provides
information about each
<a class="link" href="glossary.html#glos_page" title="page">
page
</a>
in
the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
.
</p>
<p>
For related usage information and examples, see
<a class="xref" href="innodb-information-schema-buffer-pool-tables.html" title="17.15.5 InnoDB INFORMATION_SCHEMA Buffer Pool Tables">
Section 17.15.5, “InnoDB INFORMATION_SCHEMA Buffer Pool Tables”
</a>
.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Warning
</div>
<p>
Querying the
<a class="link" href="information-schema-innodb-buffer-page-table.html" title="28.4.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table">
<code class="literal">
INNODB_BUFFER_PAGE
</code>
</a>
table can affect performance. Do not query this table on a
production system unless you are aware of the performance impact
and have determined it to be acceptable. To avoid impacting
performance on a production system, reproduce the issue you want
to investigate and query buffer pool statistics on a test
instance.
</p>
</div>
<p>
The
<a class="link" href="information-schema-innodb-buffer-page-table.html" title="28.4.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table">
<code class="literal">
INNODB_BUFFER_PAGE
</code>
</a>
table has
these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
POOL_ID
</code>
</p>
<p>
The buffer pool ID. This is an identifier to distinguish
between multiple buffer pool instances.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
BLOCK_ID
</code>
</p>
<p>
The buffer pool block ID.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
SPACE
</code>
</p>
<p>
The tablespace ID; the same value as
<code class="literal">
INNODB_TABLES.SPACE
</code>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PAGE_NUMBER
</code>
</p>
<p>
The page number.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PAGE_TYPE
</code>
</p>
<p>
The page type. The following table shows the permitted values.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_buffer_page_table-page-type">
</a>
<p class="title">
<b>
Table 28.4 INNODB_BUFFER_PAGE.PAGE_TYPE Values
</b>
</p>
<div class="table-contents">
<table summary="Mapping for interpreting INNODB_BUFFER_PAGE.PAGE_TYPE values.">
<colgroup>
<col style="width: 30%"/>
<col style="width: 30%"/>
</colgroup>
<thead>
<tr>
<th>
Page Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="literal">
ALLOCATED
</code>
</td>
<td>
Freshly allocated page
</td>
</tr>
<tr>
<td>
<code class="literal">
BLOB
</code>
</td>
<td>
Uncompressed BLOB page
</td>
</tr>
<tr>
<td>
<code class="literal">
COMPRESSED_BLOB2
</code>
</td>
<td>
Subsequent comp BLOB page
</td>
</tr>
<tr>
<td>
<code class="literal">
COMPRESSED_BLOB
</code>
</td>
<td>
First compressed BLOB page
</td>
</tr>
<tr>
<td>
<code class="literal">
ENCRYPTED_RTREE
</code>
</td>
<td>
Encrypted R-tree
</td>
</tr>
<tr>
<td>
<code class="literal">
EXTENT_DESCRIPTOR
</code>
</td>
<td>
Extent descriptor page
</td>
</tr>
<tr>
<td>
<code class="literal">
FILE_SPACE_HEADER
</code>
</td>
<td>
File space header
</td>
</tr>
<tr>
<td>
<code class="literal">
FIL_PAGE_TYPE_UNUSED
</code>
</td>
<td>
Unused
</td>
</tr>
<tr>
<td>
<code class="literal">
IBUF_BITMAP
</code>
</td>
<td>
Insert buffer bitmap
</td>
</tr>
<tr>
<td>
<code class="literal">
IBUF_FREE_LIST
</code>
</td>
<td>
Insert buffer free list
</td>
</tr>
<tr>
<td>
<code class="literal">
IBUF_INDEX
</code>
</td>
<td>
Insert buffer index
</td>
</tr>
<tr>
<td>
<code class="literal">
INDEX
</code>
</td>
<td>
B-tree node
</td>
</tr>
<tr>
<td>
<code class="literal">
INODE
</code>
</td>
<td>
Index node
</td>
</tr>
<tr>
<td>
<code class="literal">
LOB_DATA
</code>
</td>
<td>
Uncompressed LOB data
</td>
</tr>
<tr>
<td>
<code class="literal">
LOB_FIRST
</code>
</td>
<td>
First page of uncompressed LOB
</td>
</tr>
<tr>
<td>
<code class="literal">
LOB_INDEX
</code>
</td>
<td>
Uncompressed LOB index
</td>
</tr>
<tr>
<td>
<code class="literal">
PAGE_IO_COMPRESSED
</code>
</td>
<td>
Compressed page
</td>
</tr>
<tr>
<td>
<code class="literal">
PAGE_IO_COMPRESSED_ENCRYPTED
</code>
</td>
<td>
Compressed and encrypted page
</td>
</tr>
<tr>
<td>
<code class="literal">
PAGE_IO_ENCRYPTED
</code>
</td>
<td>
Encrypted page
</td>
</tr>
<tr>
<td>
<code class="literal">
RSEG_ARRAY
</code>
</td>
<td>
Rollback segment array
</td>
</tr>
<tr>
<td>
<code class="literal">
RTREE_INDEX
</code>
</td>
<td>
R-tree index
</td>
</tr>
<tr>
<td>
<code class="literal">
SDI_BLOB
</code>
</td>
<td>
Uncompressed SDI BLOB
</td>
</tr>
<tr>
<td>
<code class="literal">
SDI_COMPRESSED_BLOB
</code>
</td>
<td>
Compressed SDI BLOB
</td>
</tr>
<tr>
<td>
<code class="literal">
SDI_INDEX
</code>
</td>
<td>
SDI index
</td>
</tr>
<tr>
<td>
<code class="literal">
SYSTEM
</code>
</td>
<td>
System page
</td>
</tr>
<tr>
<td>
<code class="literal">
TRX_SYSTEM
</code>
</td>
<td>
Transaction system data
</td>
</tr>
<tr>
<td>
<code class="literal">
UNDO_LOG
</code>
</td>
<td>
Undo log page
</td>
</tr>
<tr>
<td>
<code class="literal">
UNKNOWN
</code>
</td>
<td>
Unknown
</td>
</tr>
<tr>
<td>
<code class="literal">
ZLOB_DATA
</code>
</td>
<td>
Compressed LOB data
</td>
</tr>
<tr>
<td>
<code class="literal">
ZLOB_FIRST
</code>
</td>
<td>
First page of compressed LOB
</td>
</tr>
<tr>
<td>
<code class="literal">
ZLOB_FRAG
</code>
</td>
<td>
Compressed LOB fragment
</td>
</tr>
<tr>
<td>
<code class="literal">
ZLOB_FRAG_ENTRY
</code>
</td>
<td>
Compressed LOB fragment index
</td>
</tr>
<tr>
<td>
<code class="literal">
ZLOB_INDEX
</code>
</td>
<td>
Compressed LOB index
</td>
</tr>
</tbody>
</table>
</div>
<div class="table-contents">
<table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 431px; width: 709px;">
<thead>
<tr>
<th style="width: 365.062px;">
Page Type
</th>
<th style="width: 342.938px;">
Description
</th>
</tr>
</thead>
</table>
</div>
</div>
<br class="table-break"/>
</li>
<li class="listitem">
<p>
<code class="literal">
FLUSH_TYPE
</code>
</p>
<p>
The flush type.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
FIX_COUNT
</code>
</p>
<p>
The number of threads using this block within the buffer pool.
When zero, the block is eligible to be evicted.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
IS_HASHED
</code>
</p>
<p>
Whether a hash index has been built on this page.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
NEWEST_MODIFICATION
</code>
</p>
<p>
The Log Sequence Number of the youngest modification.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
OLDEST_MODIFICATION
</code>
</p>
<p>
The Log Sequence Number of the oldest modification.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ACCESS_TIME
</code>
</p>
<p>
An abstract number used to judge the first access time of the
page.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TABLE_NAME
</code>
</p>
<p>
The name of the table the page belongs to. This column is
applicable only to pages with a
<code class="literal">
PAGE_TYPE
</code>
value of
<code class="literal">
INDEX
</code>
. The column is
<code class="literal">
NULL
</code>
if the server has not yet accessed the
table.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
INDEX_NAME
</code>
</p>
<p>
The name of the index the page belongs to. This can be the
name of a clustered index or a secondary index. This column is
applicable only to pages with a
<code class="literal">
PAGE_TYPE
</code>
value of
<code class="literal">
INDEX
</code>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
NUMBER_RECORDS
</code>
</p>
<p>
The number of records within the page.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DATA_SIZE
</code>
</p>
<p>
The sum of the sizes of the records. This column is applicable
only to pages with a
<code class="literal">
PAGE_TYPE
</code>
value of
<code class="literal">
INDEX
</code>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
COMPRESSED_SIZE
</code>
</p>
<p>
The compressed page size.
<code class="literal">
NULL
</code>
for pages
that are not compressed.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PAGE_STATE
</code>
</p>
<p>
The page state. The following table shows the permitted
values.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_buffer_page_table-page-state">
</a>
<p class="title">
<b>
Table 28.5 INNODB_BUFFER_PAGE.PAGE_STATE Values
</b>
</p>
<div class="table-contents">
<table summary="Mapping for interpreting INNODB_BUFFER_PAGE.PAGE_STATE values.">
<colgroup>
<col style="width: 25%"/>
<col style="width: 75%"/>
</colgroup>
<thead>
<tr>
<th>
Page State
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="literal">
FILE_PAGE
</code>
</td>
<td>
A buffered file page
</td>
</tr>
<tr>
<td>
<code class="literal">
MEMORY
</code>
</td>
<td>
Contains a main memory object
</td>
</tr>
<tr>
<td>
<code class="literal">
NOT_USED
</code>
</td>
<td>
In the free list
</td>
</tr>
<tr>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
Clean compressed pages, compressed pages in the flush list, pages used
as buffer pool watch sentinels
</td>
</tr>
<tr>
<td>
<code class="literal">
READY_FOR_USE
</code>
</td>
<td>
A free page
</td>
</tr>
<tr>
<td>
<code class="literal">
REMOVE_HASH
</code>
</td>
<td>
Hash index should be removed before placing in the free list
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br class="table-break"/>
</li>
<li class="listitem">
<p>
<code class="literal">
IO_FIX
</code>
</p>
<p>
Whether any I/O is pending for this page:
<code class="literal">
IO_NONE
</code>
= no pending I/O,
<code class="literal">
IO_READ
</code>
= read pending,
<code class="literal">
IO_WRITE
</code>
= write pending,
<code class="literal">
IO_PIN
</code>
= relocation and removal from the
flush not permitted.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
IS_OLD
</code>
</p>
<p>
Whether the block is in the sublist of old blocks in the LRU
list.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
FREE_PAGE_CLOCK
</code>
</p>
<p>
The value of the
<code class="literal">
freed_page_clock
</code>
counter
when the block was the last placed at the head of the LRU
list. The
<code class="literal">
freed_page_clock
</code>
counter tracks
the number of blocks removed from the end of the LRU list.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
IS_STALE
</code>
</p>
<p>
Whether the page is stale.
</p>
</li>
</ul>
</div>
<h4>
<a name="idm46045077618752">
</a>
Example
</h4>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa4716963"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>INNODB_BUFFER_PAGE <span class="token keyword">LIMIT</span> <span class="token number">1</span>\G
<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> 1. row <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>
POOL_ID<span class="token punctuation">:</span> 0
BLOCK_ID<span class="token punctuation">:</span> 0
SPACE<span class="token punctuation">:</span> 97
PAGE_NUMBER<span class="token punctuation">:</span> 2473
PAGE_TYPE<span class="token punctuation">:</span> INDEX
FLUSH_TYPE<span class="token punctuation">:</span> 1
FIX_COUNT<span class="token punctuation">:</span> 0
IS_HASHED<span class="token punctuation">:</span> YES
NEWEST_MODIFICATION<span class="token punctuation">:</span> 733855581
OLDEST_MODIFICATION<span class="token punctuation">:</span> 0
ACCESS_TIME<span class="token punctuation">:</span> 3378385672
TABLE_NAME<span class="token punctuation">:</span> `employees`.`salaries`
INDEX_NAME<span class="token punctuation">:</span> PRIMARY
NUMBER_RECORDS<span class="token punctuation">:</span> 468
DATA_SIZE<span class="token punctuation">:</span> 14976
COMPRESSED_SIZE<span class="token punctuation">:</span> 0
PAGE_STATE<span class="token punctuation">:</span> FILE_PAGE
IO_FIX<span class="token punctuation">:</span> IO_NONE
IS_OLD<span class="token punctuation">:</span> YES
FREE_PAGE_CLOCK<span class="token punctuation">:</span> 66
IS_STALE<span class="token punctuation">:</span> NO</span></code></pre>
</div>
<h4>
<a name="idm46045077615760">
</a>
Notes
</h4>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
This table is useful primarily for expert-level performance
monitoring, or when developing performance-related extensions
for MySQL.
</p>
</li>
<li class="listitem">
<p>
You must have the
<a class="link" href="privileges-provided.html#priv_process">
<code class="literal">
PROCESS
</code>
</a>
privilege to query this table.
</p>
</li>
<li class="listitem">
<p>
Use the
<code class="literal">
INFORMATION_SCHEMA
</code>
<a class="link" href="information-schema-columns-table.html" title="28.3.8 The INFORMATION_SCHEMA COLUMNS Table">
<code class="literal">
COLUMNS
</code>
</a>
table or the
<a class="link" href="show-columns.html" title="15.7.7.6 SHOW COLUMNS Statement">
<code class="literal">
SHOW COLUMNS
</code>
</a>
statement to view
additional information about the columns of this table,
including data types and default values.
</p>
</li>
<li class="listitem">
<p>
When tables, table rows, partitions, or indexes are deleted,
associated pages remain in the buffer pool until space is
required for other data. The
<a class="link" href="information-schema-innodb-buffer-page-table.html" title="28.4.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table">
<code class="literal">
INNODB_BUFFER_PAGE
</code>
</a>
table reports
information about these pages until they are evicted from the
buffer pool. For more information about how the
<code class="literal">
InnoDB
</code>
manages buffer pool data, see
<a class="xref" href="innodb-buffer-pool.html" title="17.5.1 Buffer Pool">
Section 17.5.1, “Buffer Pool”
</a>
.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/number-literals.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="number-literals">
</a>
11.1.2 Numeric Literals
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045220470192">
</a>
<a class="indexterm" name="idm46045220469104">
</a>
<a class="indexterm" name="idm46045220468016">
</a>
<a class="indexterm" name="idm46045220466528">
</a>
<a class="indexterm" name="idm46045220465040">
</a>
<a class="indexterm" name="idm46045220463552">
</a>
<a class="indexterm" name="idm46045220462480">
</a>
<a class="indexterm" name="idm46045220460992">
</a>
<a class="indexterm" name="idm46045220459920">
</a>
<a class="indexterm" name="idm46045220458848">
</a>
<a class="indexterm" name="idm46045220457776">
</a>
<a class="indexterm" name="idm46045220456704">
</a>
<p>
Number literals include exact-value (integer and
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DECIMAL
</code>
</a>
) literals and
approximate-value (floating-point) literals.
</p>
<p>
Integers are represented as a sequence of digits. Numbers may
include
<code class="literal">
.
</code>
as a decimal separator. Numbers may
be preceded by
<code class="literal">
-
</code>
or
<code class="literal">
+
</code>
to
indicate a negative or positive value, respectively. Numbers
represented in scientific notation with a mantissa and exponent
are approximate-value numbers.
</p>
<p>
Exact-value numeric literals have an integer part or fractional
part, or both. They may be signed. Examples:
<code class="literal">
1
</code>
,
<code class="literal">
.2
</code>
,
<code class="literal">
3.4
</code>
,
<code class="literal">
-5
</code>
,
<code class="literal">
-6.78
</code>
,
<code class="literal">
+9.10
</code>
.
</p>
<p>
Approximate-value numeric literals are represented in scientific
notation with a mantissa and exponent. Either or both parts may
be signed. Examples:
<code class="literal">
1.2E3
</code>
,
<code class="literal">
1.2E-3
</code>
,
<code class="literal">
-1.2E3
</code>
,
<code class="literal">
-1.2E-3
</code>
.
</p>
<p>
Two numbers that look similar may be treated differently. For
example,
<code class="literal">
2.34
</code>
is an exact-value (fixed-point)
number, whereas
<code class="literal">
2.34E0
</code>
is an
approximate-value (floating-point) number.
</p>
<p>
The
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DECIMAL
</code>
</a>
data type is a
fixed-point type and calculations are exact. In MySQL, the
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DECIMAL
</code>
</a>
type has several
synonyms:
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
NUMERIC
</code>
</a>
,
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DEC
</code>
</a>
,
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
FIXED
</code>
</a>
. The integer types also are
exact-value types. For more information about exact-value
calculations, see
<a class="xref" href="precision-math.html" title="14.24 Precision Math">
Section 14.24, “Precision Math”
</a>
.
</p>
<p>
The
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT
</code>
</a>
and
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
data types are
floating-point types and calculations are approximate. In MySQL,
types that are synonymous with
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT
</code>
</a>
or
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
are
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE PRECISION
</code>
</a>
and
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
REAL
</code>
</a>
.
</p>
<p>
An integer may be used in floating-point context; it is
interpreted as the equivalent floating-point number.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/group-replication-adding-instances.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="group-replication-adding-instances">
</a>
20.2.1.6 Adding Instances to the Group
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045134066720">
</a>
<p>
At this point, the group has one member in it, server s1, which
has some data in it. It is now time to expand the group by
adding the other two servers configured previously.
</p>
<div class="section">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="group-replication-adding-a-second-instance">
</a>
20.2.1.6.1 Adding a Second Instance
</h5>
</div>
</div>
</div>
<a class="indexterm" name="idm46045134063392">
</a>
<p>
In order to add a second instance, server s2, first create the
configuration file for it. The configuration is similar to the
one used for server s1, except for things such as the
<a class="link" href="replication-options.html#sysvar_server_id">
<code class="literal">
server_id
</code>
</a>
.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-ini"><div class="docs-select-all right" id="sa9923863"><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 comment" spellcheck="true">#</span>
<span class="token comment" spellcheck="true"># Disable other storage engines</span>
<span class="token comment" spellcheck="true">#</span>
<span class="token constant">disabled_storage_engines</span><span class="token attr-value"><span class="token punctuation">=</span>"MyISAM,BLACKHOLE,FEDERATED,ARCHIVE,MEMORY"</span>
<span class="token comment" spellcheck="true">#</span>
<span class="token comment" spellcheck="true"># Replication configuration parameters</span>
<span class="token comment" spellcheck="true">#</span>
<span class="token constant">server_id</span><span class="token attr-value"><span class="token punctuation">=</span>2</span>
<span class="token constant">gtid_mode</span><span class="token attr-value"><span class="token punctuation">=</span>ON</span>
<span class="token constant">enforce_gtid_consistency</span><span class="token attr-value"><span class="token punctuation">=</span>ON</span>
<span class="token comment" spellcheck="true">#</span>
<span class="token comment" spellcheck="true"># Group Replication configuration</span>
<span class="token comment" spellcheck="true">#</span>
<span class="token constant">plugin_load_add</span><span class="token attr-value"><span class="token punctuation">=</span>'group_replication.so'</span>
<span class="token constant">group_replication_group_name</span><span class="token attr-value"><span class="token punctuation">=</span>"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"</span>
<span class="token constant">group_replication_start_on_boot</span><span class="token attr-value"><span class="token punctuation">=</span>off</span>
<span class="token constant">group_replication_local_address</span><span class="token attr-value"><span class="token punctuation">=</span> "s2:33061"</span>
<span class="token constant">group_replication_group_seeds</span><span class="token attr-value"><span class="token punctuation">=</span> "s1:33061,s2:33061,s3:33061"</span>
<span class="token constant">group_replication_bootstrap_group</span><span class="token attr-value"><span class="token punctuation">=</span> off</span></code></pre>
</div>
<p>
Similar to the procedure for server s1, with the option file
in place you launch the server. Then configure the distributed
recovery credentials as follows. The operations are the same
as used when setting up server s1 as the user is shared within
the group. This member needs to have the same replication user
configured in
<a class="xref" href="group-replication-user-credentials.html" title="20.2.1.3 User Credentials For Distributed Recovery">
Section 20.2.1.3, “User Credentials For Distributed Recovery”
</a>
. If you
are relying on distributed recovery to configure the user on
all members, when s2 connects to the seed s1 the replication
user is replicated or cloned to s1. If you did not have binary
logging enabled when you configured the user credentials on
s1, and a remote cloning operation is not used for state
transfer, you must create the replication user on s2. In this
case, connect to s2 and issue:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa80035957"><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> SQL_LOG_BIN<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">USER</span> <em class="replaceable">rpl_user</em>@<span class="token string">'%'</span> <span class="token keyword">IDENTIFIED</span> <span class="token keyword">BY</span> <span class="token string">'<em class="replaceable">password</em>'</span><span class="token punctuation">;</span>
<span class="token keyword">GRANT</span> <span class="token keyword">REPLICATION</span> <span class="token keyword">SLAVE</span> <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <em class="replaceable">rpl_user</em>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token keyword">GRANT</span> CONNECTION_ADMIN <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <em class="replaceable">rpl_user</em>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token keyword">GRANT</span> BACKUP_ADMIN <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <em class="replaceable">rpl_user</em>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token keyword">GRANT</span> GROUP_REPLICATION_STREAM <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <em class="replaceable">rpl_user</em>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token keyword">FLUSH</span> <span class="token keyword">PRIVILEGES</span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> SQL_LOG_BIN<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
If you are providing user credentials using a
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE TO
</code>
</a>
,
issue the following statement after that:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa14182341"><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">CHANGE</span> <span class="token keyword">REPLICATION</span> <span class="token keyword">SOURCE</span> <span class="token keyword">TO</span> <span class="token keyword">SOURCE_USER</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">rpl_user</em>'</span><span class="token punctuation">,</span> <span class="token keyword">SOURCE_PASSWORD</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">password</em>'</span> \
<span class="token keyword">FOR</span> <span class="token keyword">CHANNEL</span> <span class="token string">'group_replication_recovery'</span><span class="token punctuation">;</span></code></pre>
</div>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Tip
</div>
<p>
If you are using the caching SHA-2 authentication plugin
(the default), see
<a class="xref" href="group-replication-secure-user.html#group-replication-caching-sha2-user-credentials" title="20.6.3.1.1 Replication User With The Caching SHA-2 Authentication Plugin">
Section 20.6.3.1.1, “Replication User With The Caching SHA-2 Authentication Plugin”
</a>
.
</p>
</div>
<p>
If necessary, install the Group Replication plugin, see
<a class="xref" href="group-replication-launching.html" title="20.2.1.4 Launching Group Replication">
Section 20.2.1.4, “Launching Group Replication”
</a>
.
</p>
<p>
Start Group Replication and s2 starts the process of joining
the group.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa44637950"><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></span> <span class="token keyword">START</span> <span class="token keyword">GROUP_REPLICATION</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
If you are providing user credentials for distributed recovery
as part of
<a class="link" href="start-group-replication.html" title="15.4.3.1 START GROUP_REPLICATION Statement">
<code class="literal">
START
GROUP_REPLICATION
</code>
</a>
, you can do so like this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa65529644"><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></span> <span class="token keyword">START</span> <span class="token keyword">GROUP_REPLICATION</span> <span class="token keyword">USER</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">rpl_user</em>'</span><span class="token punctuation">,</span> <span class="token keyword">PASSWORD</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">password</em>'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Unlike the previous steps that were the same as those executed
on s1, here there is a difference in that you do
<span class="emphasis">
<em>
not
</em>
</span>
need to bootstrap the group because
the group already exists. In other words on s2
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_bootstrap_group">
<code class="literal">
group_replication_bootstrap_group
</code>
</a>
is set to
<code class="literal">
OFF
</code>
, and you do not issue
<code class="literal">
SET GLOBAL
group_replication_bootstrap_group=ON;
</code>
before
starting Group Replication, because the group has already been
created and bootstrapped by server s1. At this point server s2
only needs to be added to the already existing group.
</p>
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Tip
</div>
<p>
When Group Replication starts successfully and the server
joins the group it checks the
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
variable.
By setting
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
to ON in the member's configuration file, you can
ensure that servers which fail when starting Group
Replication for any reason do not accept transactions. If
the server should join the group as a read/write instance,
for example as the primary in a single-primary group or as a
member of a multi-primary group, when
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
is set to
<code class="literal">
ON
</code>
then it is set to
<code class="literal">
OFF
</code>
upon joining the group.
</p>
</div>
<p>
Checking the
<a class="link" href="performance-schema-replication-group-members-table.html" title="29.12.11.16 The replication_group_members Table">
<code class="literal">
performance_schema.replication_group_members
</code>
</a>
table again shows that there are now two
<code class="literal">
ONLINE
</code>
servers in the group.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa59162489"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>replication_group_members<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 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 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> CHANNEL_NAME <span class="token punctuation">|</span> MEMBER_ID <span class="token punctuation">|</span> MEMBER_HOST <span class="token punctuation">|</span> MEMBER_PORT <span class="token punctuation">|</span> MEMBER_STATE <span class="token punctuation">|</span> MEMBER_ROLE <span class="token punctuation">|</span> MEMBER_VERSION <span class="token punctuation">|</span> MEMBER_COMMUNICATION_STACK <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 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 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> group_replication_applier <span class="token punctuation">|</span> 395409e1<span class="token punctuation">-</span>6dfa<span class="token punctuation">-</span>11e6<span class="token punctuation">-</span>970b<span class="token punctuation">-</span>00212844f856 <span class="token punctuation">|</span> s1 <span class="token punctuation">|</span> 3306 <span class="token punctuation">|</span> ONLINE <span class="token punctuation">|</span> PRIMARY <span class="token punctuation">|</span> 8.4.3 <span class="token punctuation">|</span> XCom <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> group_replication_applier <span class="token punctuation">|</span> ac39f1e6<span class="token punctuation">-</span>6dfa<span class="token punctuation">-</span>11e6<span class="token punctuation">-</span>a69d<span class="token punctuation">-</span>00212844f856 <span class="token punctuation">|</span> s2 <span class="token punctuation">|</span> 3306 <span class="token punctuation">|</span> ONLINE <span class="token punctuation">|</span> SECONDARY <span class="token punctuation">|</span> 8.4.3 <span class="token punctuation">|</span> XCom <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 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 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>
When s2 attempted to join the group,
<a class="xref" href="group-replication-distributed-recovery.html" title="20.5.4 Distributed Recovery">
Section 20.5.4, “Distributed Recovery”
</a>
ensured that s2 applied the same transactions which s1 had
applied. Once this process completed, s2 could join the group
as a member, and at this point it is marked as
<code class="literal">
ONLINE
</code>
. In other words it must have already
caught up with server s1 automatically. Once s2 is
<code class="literal">
ONLINE
</code>
, it then begins to process
transactions with the group. Verify that s2 has indeed
synchronized with server s1 as follows.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa47315220"><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></span> <span class="token keyword">SHOW</span> <span class="token keyword">DATABASES</span> <span class="token operator">LIKE</span> <span class="token string">'test'</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>
<span class="token output"><span class="token punctuation">|</span> Database (test) <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>
<span class="token output"><span class="token punctuation">|</span> test <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> test<span class="token punctuation">.</span>t1<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>
<span class="token output"><span class="token punctuation">|</span> c1 <span class="token punctuation">|</span> c2 <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>
<span class="token output"><span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> Luis <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>
<span class="token prompt">mysql></span> <span class="token keyword">SHOW</span> <span class="token keyword">BINLOG</span> <span class="token keyword">EVENTS</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 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> Log_name <span class="token punctuation">|</span> Pos <span class="token punctuation">|</span> Event_type <span class="token punctuation">|</span> Server_id <span class="token punctuation">|</span> End_log_pos <span class="token punctuation">|</span> Info <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 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> binlog.000001 <span class="token punctuation">|</span> 4 <span class="token punctuation">|</span> Format_desc <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 123 <span class="token punctuation">|</span> Server ver: 8.4.3<span class="token punctuation">-</span>log, Binlog ver: 4 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 123 <span class="token punctuation">|</span> Previous_gtids <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 150 <span class="token punctuation">|</span> <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 150 <span class="token punctuation">|</span> Gtid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 211 <span class="token punctuation">|</span> SET @@SESSION.GTID_NEXT= 'aaaaaaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaaaaaaaaaa:1' <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 211 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 270 <span class="token punctuation">|</span> BEGIN <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 270 <span class="token punctuation">|</span> View_change <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 369 <span class="token punctuation">|</span> view_id=14724832985483517:1 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 369 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 434 <span class="token punctuation">|</span> COMMIT <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 434 <span class="token punctuation">|</span> Gtid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 495 <span class="token punctuation">|</span> SET @@SESSION.GTID_NEXT= 'aaaaaaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaaaaaaaaaa:2' <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 495 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 585 <span class="token punctuation">|</span> CREATE DATABASE test <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 585 <span class="token punctuation">|</span> Gtid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 646 <span class="token punctuation">|</span> SET @@SESSION.GTID_NEXT= 'aaaaaaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaaaaaaaaaa:3' <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 646 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 770 <span class="token punctuation">|</span> use `test`; CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 TEXT NOT NULL) <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 770 <span class="token punctuation">|</span> Gtid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 831 <span class="token punctuation">|</span> SET @@SESSION.GTID_NEXT= 'aaaaaaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaaaaaaaaaa:4' <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 831 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 890 <span class="token punctuation">|</span> BEGIN <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 890 <span class="token punctuation">|</span> Table_map <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 933 <span class="token punctuation">|</span> table_id: 108 (test.t1) <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 933 <span class="token punctuation">|</span> Write_rows <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 975 <span class="token punctuation">|</span> table_id: 108 flags: STMT_END_F <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 975 <span class="token punctuation">|</span> Xid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1002 <span class="token punctuation">|</span> COMMIT /* xid=30 */ <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1002 <span class="token punctuation">|</span> Gtid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1063 <span class="token punctuation">|</span> SET @@SESSION.GTID_NEXT= 'aaaaaaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaaaaaaaaaa:5' <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1063 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1122 <span class="token punctuation">|</span> BEGIN <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1122 <span class="token punctuation">|</span> View_change <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1261 <span class="token punctuation">|</span> view_id=14724832985483517:2 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1261 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1326 <span class="token punctuation">|</span> COMMIT <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 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>
As seen above, the second server has been added to the group
and it has replicated the changes from server s1
automatically. In other words, the transactions applied on s1
up to the point in time that s2 joined the group have been
replicated to s2.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="group-replication-adding-additional-instances">
</a>
20.2.1.6.2 Adding Additional Instances
</h5>
</div>
</div>
</div>
<a class="indexterm" name="idm46045134003456">
</a>
<p>
Adding additional instances to the group is essentially the
same sequence of steps as adding the second server, except
that the configuration has to be changed as it had to be for
server s2. To summarise the required operations:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Create the configuration file.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-ini"><div class="docs-select-all right" id="sa73242633"><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 comment" spellcheck="true">#</span>
<span class="token comment" spellcheck="true"># Disable other storage engines</span>
<span class="token comment" spellcheck="true">#</span>
<span class="token constant">disabled_storage_engines</span><span class="token attr-value"><span class="token punctuation">=</span>"MyISAM,BLACKHOLE,FEDERATED,ARCHIVE,MEMORY"</span>
<span class="token comment" spellcheck="true">#</span>
<span class="token comment" spellcheck="true"># Replication configuration parameters</span>
<span class="token comment" spellcheck="true">#</span>
<span class="token constant">server_id</span><span class="token attr-value"><span class="token punctuation">=</span>3</span>
<span class="token constant">gtid_mode</span><span class="token attr-value"><span class="token punctuation">=</span>ON</span>
<span class="token constant">enforce_gtid_consistency</span><span class="token attr-value"><span class="token punctuation">=</span>ON</span>
<span class="token comment" spellcheck="true">#</span>
<span class="token comment" spellcheck="true"># Group Replication configuration</span>
<span class="token comment" spellcheck="true">#</span>
<span class="token constant">plugin_load_add</span><span class="token attr-value"><span class="token punctuation">=</span>'group_replication.so'</span>
<span class="token constant">group_replication_group_name</span><span class="token attr-value"><span class="token punctuation">=</span>"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"</span>
<span class="token constant">group_replication_start_on_boot</span><span class="token attr-value"><span class="token punctuation">=</span>off</span>
<span class="token constant">group_replication_local_address</span><span class="token attr-value"><span class="token punctuation">=</span> "s3:33061"</span>
<span class="token constant">group_replication_group_seeds</span><span class="token attr-value"><span class="token punctuation">=</span> "s1:33061,s2:33061,s3:33061"</span>
<span class="token constant">group_replication_bootstrap_group</span><span class="token attr-value"><span class="token punctuation">=</span> off</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Start the server and connect to it. Create the replication
user for distributed recovery.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa4812000"><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> SQL_LOG_BIN<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">USER</span> <em class="replaceable">rpl_user</em>@<span class="token string">'%'</span> <span class="token keyword">IDENTIFIED</span> <span class="token keyword">BY</span> <span class="token string">'<em class="replaceable">password</em>'</span><span class="token punctuation">;</span>
<span class="token keyword">GRANT</span> <span class="token keyword">REPLICATION</span> <span class="token keyword">SLAVE</span> <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <em class="replaceable">rpl_user</em>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token keyword">GRANT</span> CONNECTION_ADMIN <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <em class="replaceable">rpl_user</em>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token keyword">GRANT</span> BACKUP_ADMIN <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <em class="replaceable">rpl_user</em>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token keyword">GRANT</span> GROUP_REPLICATION_STREAM <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <em class="replaceable">rpl_user</em>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token keyword">FLUSH</span> <span class="token keyword">PRIVILEGES</span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> SQL_LOG_BIN<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
If you are providing user credentials using a
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE
TO
</code>
</a>
statement, issue the following statement
after that:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa72660400"><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></span> <span class="token keyword">CHANGE</span> <span class="token keyword">REPLICATION</span> <span class="token keyword">SOURCE</span> <span class="token keyword">TO</span> <span class="token keyword">SOURCE_USER</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">rpl_user</em>'</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token keyword">SOURCE_PASSWORD</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">password</em>'</span>
<span class="token prompt"> -></span> <span class="token keyword">FOR</span> <span class="token keyword">CHANNEL</span> <span class="token string">'group_replication_recovery'</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Install the Group Replication plugin if necessary, like
this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa33784114"><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></span> <span class="token keyword">INSTALL</span> <span class="token keyword">PLUGIN</span> <span class="token keyword">group_replication</span> <span class="token keyword">SONAME</span> <span class="token string">'group_replication.so'</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Start Group Replication:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa90426065"><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></span> <span class="token keyword">START</span> <span class="token keyword">GROUP_REPLICATION</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
If you are providing user credentials for distributed
recovery in the
<a class="link" href="start-group-replication.html" title="15.4.3.1 START GROUP_REPLICATION Statement">
<code class="literal">
START
GROUP_REPLICATION
</code>
</a>
statement, you can do so like
this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa71756435"><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></span> <span class="token keyword">START</span> <span class="token keyword">GROUP_REPLICATION</span> <span class="token keyword">USER</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">rpl_user</em>'</span><span class="token punctuation">,</span> <span class="token keyword">PASSWORD</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">password</em>'</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
</ol>
</div>
<p>
At this point server s3 is booted and running, has joined the
group and caught up with the other servers in the group.
Consulting the
<a class="link" href="performance-schema-replication-group-members-table.html" title="29.12.11.16 The replication_group_members Table">
<code class="literal">
performance_schema.replication_group_members
</code>
</a>
table again confirms this is the case.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa84280414"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>replication_group_members<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 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 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> CHANNEL_NAME <span class="token punctuation">|</span> MEMBER_ID <span class="token punctuation">|</span> MEMBER_HOST <span class="token punctuation">|</span> MEMBER_PORT <span class="token punctuation">|</span> MEMBER_STATE <span class="token punctuation">|</span> MEMBER_ROLE <span class="token punctuation">|</span> MEMBER_VERSION <span class="token punctuation">|</span> MEMBER_COMMUNICATION_STACK <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 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 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> group_replication_applier <span class="token punctuation">|</span> 395409e1<span class="token punctuation">-</span>6dfa<span class="token punctuation">-</span>11e6<span class="token punctuation">-</span>970b<span class="token punctuation">-</span>00212844f856 <span class="token punctuation">|</span> s1 <span class="token punctuation">|</span> 3306 <span class="token punctuation">|</span> ONLINE <span class="token punctuation">|</span> PRIMARY <span class="token punctuation">|</span> 8.4.3 <span class="token punctuation">|</span> XCom <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> group_replication_applier <span class="token punctuation">|</span> 7eb217ff<span class="token punctuation">-</span>6df3<span class="token punctuation">-</span>11e6<span class="token punctuation">-</span>966c<span class="token punctuation">-</span>00212844f856 <span class="token punctuation">|</span> s3 <span class="token punctuation">|</span> 3306 <span class="token punctuation">|</span> ONLINE <span class="token punctuation">|</span> SECONDARY <span class="token punctuation">|</span> 8.4.3 <span class="token punctuation">|</span> XCom <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> group_replication_applier <span class="token punctuation">|</span> ac39f1e6<span class="token punctuation">-</span>6dfa<span class="token punctuation">-</span>11e6<span class="token punctuation">-</span>a69d<span class="token punctuation">-</span>00212844f856 <span class="token punctuation">|</span> s2 <span class="token punctuation">|</span> 3306 <span class="token punctuation">|</span> ONLINE <span class="token punctuation">|</span> SECONDARY <span class="token punctuation">|</span> 8.4.3 <span class="token punctuation">|</span> XCom <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 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 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>
Issuing this same query on server s2 or server s1 yields the
same result. Also, you can verify that server s3 has caught
up:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa12109846"><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></span> <span class="token keyword">SHOW</span> <span class="token keyword">DATABASES</span> <span class="token operator">LIKE</span> <span class="token string">'test'</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>
<span class="token output"><span class="token punctuation">|</span> Database (test) <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>
<span class="token output"><span class="token punctuation">|</span> test <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> test<span class="token punctuation">.</span>t1<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>
<span class="token output"><span class="token punctuation">|</span> c1 <span class="token punctuation">|</span> c2 <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>
<span class="token output"><span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> Luis <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>
<span class="token prompt">mysql></span> <span class="token keyword">SHOW</span> <span class="token keyword">BINLOG</span> <span class="token keyword">EVENTS</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 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> Log_name <span class="token punctuation">|</span> Pos <span class="token punctuation">|</span> Event_type <span class="token punctuation">|</span> Server_id <span class="token punctuation">|</span> End_log_pos <span class="token punctuation">|</span> Info <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 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> binlog.000001 <span class="token punctuation">|</span> 4 <span class="token punctuation">|</span> Format_desc <span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> 123 <span class="token punctuation">|</span> Server ver: 8.4.3<span class="token punctuation">-</span>log, Binlog ver: 4 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 123 <span class="token punctuation">|</span> Previous_gtids <span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> 150 <span class="token punctuation">|</span> <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 150 <span class="token punctuation">|</span> Gtid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 211 <span class="token punctuation">|</span> SET @@SESSION.GTID_NEXT= 'aaaaaaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaaaaaaaaaa:1' <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 211 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 270 <span class="token punctuation">|</span> BEGIN <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 270 <span class="token punctuation">|</span> View_change <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 369 <span class="token punctuation">|</span> view_id=14724832985483517:1 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 369 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 434 <span class="token punctuation">|</span> COMMIT <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 434 <span class="token punctuation">|</span> Gtid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 495 <span class="token punctuation">|</span> SET @@SESSION.GTID_NEXT= 'aaaaaaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaaaaaaaaaa:2' <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 495 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 585 <span class="token punctuation">|</span> CREATE DATABASE test <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 585 <span class="token punctuation">|</span> Gtid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 646 <span class="token punctuation">|</span> SET @@SESSION.GTID_NEXT= 'aaaaaaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaaaaaaaaaa:3' <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 646 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 770 <span class="token punctuation">|</span> use `test`; CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 TEXT NOT NULL) <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 770 <span class="token punctuation">|</span> Gtid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 831 <span class="token punctuation">|</span> SET @@SESSION.GTID_NEXT= 'aaaaaaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaaaaaaaaaa:4' <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 831 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 890 <span class="token punctuation">|</span> BEGIN <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 890 <span class="token punctuation">|</span> Table_map <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 933 <span class="token punctuation">|</span> table_id: 108 (test.t1) <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 933 <span class="token punctuation">|</span> Write_rows <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 975 <span class="token punctuation">|</span> table_id: 108 flags: STMT_END_F <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 975 <span class="token punctuation">|</span> Xid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1002 <span class="token punctuation">|</span> COMMIT /* xid=29 */ <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1002 <span class="token punctuation">|</span> Gtid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1063 <span class="token punctuation">|</span> SET @@SESSION.GTID_NEXT= 'aaaaaaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaaaaaaaaaa:5' <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1063 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1122 <span class="token punctuation">|</span> BEGIN <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1122 <span class="token punctuation">|</span> View_change <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1261 <span class="token punctuation">|</span> view_id=14724832985483517:2 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1261 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1326 <span class="token punctuation">|</span> COMMIT <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1326 <span class="token punctuation">|</span> Gtid <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1387 <span class="token punctuation">|</span> SET @@SESSION.GTID_NEXT= 'aaaaaaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaa<span class="token punctuation">-</span>aaaaaaaaaaaa:6' <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1387 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1446 <span class="token punctuation">|</span> BEGIN <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1446 <span class="token punctuation">|</span> View_change <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1585 <span class="token punctuation">|</span> view_id=14724832985483517:3 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000001 <span class="token punctuation">|</span> 1585 <span class="token punctuation">|</span> Query <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1650 <span class="token punctuation">|</span> COMMIT <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 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>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/server-status-variables.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="server-status-variables">
</a>
7.1.10 Server Status Variables
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045263608544">
</a>
<a class="indexterm" name="idm46045263607472">
</a>
<p>
The MySQL server maintains many status variables that provide
information about its operation. You can view these variables and
their values by using the
<code class="literal">
SHOW [GLOBAL | SESSION]
STATUS
</code>
statement (see
<a class="xref" href="show-status.html" title="15.7.7.37 SHOW STATUS Statement">
Section 15.7.7.37, “SHOW STATUS Statement”
</a>
).
The optional
<code class="literal">
GLOBAL
</code>
keyword aggregates the
values over all connections, and
<code class="literal">
SESSION
</code>
shows
the values for the current connection.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa34608703"><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></span> <span class="token keyword">SHOW</span> <span class="token keyword">GLOBAL</span> <span class="token keyword">STATUS</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>
<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>
<span class="token output"><span class="token punctuation">|</span> Aborted_clients <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Aborted_connects <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Bytes_received <span class="token punctuation">|</span> 155372598 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Bytes_sent <span class="token punctuation">|</span> 1176560426 <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> Connections <span class="token punctuation">|</span> 30023 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Created_tmp_disk_tables <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Created_tmp_files <span class="token punctuation">|</span> 3 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Created_tmp_tables <span class="token punctuation">|</span> 2 <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> Threads_created <span class="token punctuation">|</span> 217 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Threads_running <span class="token punctuation">|</span> 88 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Uptime <span class="token punctuation">|</span> 1389872 <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></code></pre>
</div>
<p>
Many status variables are reset to 0 by the
<a class="link" href="flush.html#flush-status">
<code class="literal">
FLUSH STATUS
</code>
</a>
statement.
</p>
<p>
This section provides a description of each status variable. For a
status variable summary, see
<a class="xref" href="server-status-variable-reference.html" title="7.1.6 Server Status Variable Reference">
Section 7.1.6, “Server Status Variable Reference”
</a>
. For
information about status variables specific to NDB Cluster, see
<a class="xref" href="mysql-cluster-options-variables.html#mysql-cluster-status-variables" title="25.4.3.9.3 NDB Cluster Status Variables">
Section 25.4.3.9.3, “NDB Cluster Status Variables”
</a>
.
</p>
<p>
The status variables have the following meanings.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a name="statvar_Aborted_clients">
</a>
<a class="link" href="server-status-variables.html#statvar_Aborted_clients">
<code class="literal">
Aborted_clients
</code>
</a>
</p>
<a class="indexterm" name="idm46045263593936">
</a>
<a class="indexterm" name="idm46045263592848">
</a>
<p>
The number of connections that were aborted because the client
died without closing the connection properly. See
<a class="xref" href="communication-errors.html" title="B.3.2.9 Communication Errors and Aborted Connections">
Section B.3.2.9, “Communication Errors and Aborted Connections”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Aborted_connects">
</a>
<a class="link" href="server-status-variables.html#statvar_Aborted_connects">
<code class="literal">
Aborted_connects
</code>
</a>
</p>
<a class="indexterm" name="idm46045263587520">
</a>
<a class="indexterm" name="idm46045263586480">
</a>
<p>
The number of failed attempts to connect to the MySQL server.
See
<a class="xref" href="communication-errors.html" title="B.3.2.9 Communication Errors and Aborted Connections">
Section B.3.2.9, “Communication Errors and Aborted Connections”
</a>
.
</p>
<p>
For additional connection-related information, check the
<a class="link" href="server-status-variables.html#statvar_Connection_errors_xxx">
<code class="literal">
Connection_errors_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
</a>
status variables and the
<a class="link" href="performance-schema-host-cache-table.html" title="29.12.22.3 The host_cache Table">
<code class="literal">
host_cache
</code>
</a>
table.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Authentication_ldap_sasl_supported_methods">
</a>
<a class="link" href="server-status-variables.html#statvar_Authentication_ldap_sasl_supported_methods">
<code class="literal">
Authentication_ldap_sasl_supported_methods
</code>
</a>
</p>
<a class="indexterm" name="idm46045263577808">
</a>
<a class="indexterm" name="idm46045263576688">
</a>
<p>
The
<code class="literal">
authentication_ldap_sasl
</code>
plugin that
implements SASL LDAP authentication supports multiple
authentication methods, but depending on host system
configuration, they might not all be available. The
<a class="link" href="server-status-variables.html#statvar_Authentication_ldap_sasl_supported_methods">
<code class="literal">
Authentication_ldap_sasl_supported_methods
</code>
</a>
variable provides discoverability for the supported methods.
Its value is a string consisting of supported method names
separated by spaces. Example:
<code class="literal">
"SCRAM-SHA 1
SCRAM-SHA-256 GSSAPI"
</code>
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Binlog_cache_disk_use">
</a>
<a class="link" href="server-status-variables.html#statvar_Binlog_cache_disk_use">
<code class="literal">
Binlog_cache_disk_use
</code>
</a>
</p>
<a class="indexterm" name="idm46045263569168">
</a>
<a class="indexterm" name="idm46045263568128">
</a>
<p>
The number of transactions that used the temporary binary log
cache but that exceeded the value of
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_cache_size">
<code class="literal">
binlog_cache_size
</code>
</a>
and used a
temporary file to store statements from the transaction.
</p>
<p>
The number of nontransactional statements that caused the
binary log transaction cache to be written to disk is tracked
separately in the
<a class="link" href="server-status-variables.html#statvar_Binlog_stmt_cache_disk_use">
<code class="literal">
Binlog_stmt_cache_disk_use
</code>
</a>
status variable.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Acl_cache_items_count">
</a>
<a class="link" href="server-status-variables.html#statvar_Acl_cache_items_count">
<code class="literal">
Acl_cache_items_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045263560464">
</a>
<a class="indexterm" name="idm46045263559424">
</a>
<a class="indexterm" name="idm46045263557936">
</a>
<a class="indexterm" name="idm46045263556848">
</a>
<p>
The number of cached privilege objects. Each object is the
privilege combination of a user and its active roles.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Binlog_cache_use">
</a>
<a class="link" href="server-status-variables.html#statvar_Binlog_cache_use">
<code class="literal">
Binlog_cache_use
</code>
</a>
</p>
<a class="indexterm" name="idm46045263552368">
</a>
<a class="indexterm" name="idm46045263551328">
</a>
<p>
The number of transactions that used the binary log cache.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Binlog_stmt_cache_disk_use">
</a>
<a class="link" href="server-status-variables.html#statvar_Binlog_stmt_cache_disk_use">
<code class="literal">
Binlog_stmt_cache_disk_use
</code>
</a>
</p>
<a class="indexterm" name="idm46045263546880">
</a>
<a class="indexterm" name="idm46045263545776">
</a>
<p>
The number of nontransaction statements that used the binary
log statement cache but that exceeded the value of
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_stmt_cache_size">
<code class="literal">
binlog_stmt_cache_size
</code>
</a>
and
used a temporary file to store those statements.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Binlog_stmt_cache_use">
</a>
<a class="link" href="server-status-variables.html#statvar_Binlog_stmt_cache_use">
<code class="literal">
Binlog_stmt_cache_use
</code>
</a>
</p>
<a class="indexterm" name="idm46045263539952">
</a>
<a class="indexterm" name="idm46045263538912">
</a>
<p>
The number of nontransactional statements that used the binary
log statement cache.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Bytes_received">
</a>
<a class="link" href="server-status-variables.html#statvar_Bytes_received">
<code class="literal">
Bytes_received
</code>
</a>
</p>
<a class="indexterm" name="idm46045263534512">
</a>
<a class="indexterm" name="idm46045263533424">
</a>
<p>
The number of bytes received from all clients.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Bytes_sent">
</a>
<a class="link" href="server-status-variables.html#statvar_Bytes_sent">
<code class="literal">
Bytes_sent
</code>
</a>
</p>
<a class="indexterm" name="idm46045263529136">
</a>
<a class="indexterm" name="idm46045263528048">
</a>
<p>
The number of bytes sent to all clients.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Caching_sha2_password_rsa_public_key">
</a>
<a class="link" href="server-status-variables.html#statvar_Caching_sha2_password_rsa_public_key">
<code class="literal">
Caching_sha2_password_rsa_public_key
</code>
</a>
</p>
<a class="indexterm" name="idm46045263523552">
</a>
<a class="indexterm" name="idm46045263522512">
</a>
<p>
The public key used by the
<code class="literal">
caching_sha2_password
</code>
authentication plugin
for RSA key pair-based password exchange. The value is
nonempty only if the server successfully initializes the
private and public keys in the files named by the
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_private_key_path">
<code class="literal">
caching_sha2_password_private_key_path
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_public_key_path">
<code class="literal">
caching_sha2_password_public_key_path
</code>
</a>
system variables. The value of
<a class="link" href="server-status-variables.html#statvar_Caching_sha2_password_rsa_public_key">
<code class="literal">
Caching_sha2_password_rsa_public_key
</code>
</a>
comes from the latter file.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Com_xxx">
</a>
<code class="literal">
Com_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
</p>
<p>
The
<code class="literal">
Com_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
statement counter variables indicate the number of times each
<em class="replaceable">
<code>
xxx
</code>
</em>
statement has been executed.
There is one status variable for each type of statement. For
example,
<code class="literal">
Com_delete
</code>
and
<code class="literal">
Com_update
</code>
count
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
and
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
statements,
respectively.
<code class="literal">
Com_delete_multi
</code>
and
<code class="literal">
Com_update_multi
</code>
are similar but apply to
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
and
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
statements that use
multiple-table syntax.
</p>
<p>
All
<code class="literal">
Com_stmt_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
variables are increased even if a prepared statement argument
is unknown or an error occurred during execution. In other
words, their values correspond to the number of requests
issued, not to the number of requests successfully completed.
For example, because status variables are initialized for each
server startup and do not persist across restarts, the
<code class="literal">
Com_restart
</code>
and
<code class="literal">
Com_shutdown
</code>
variables that track
<a class="link" href="restart.html" title="15.7.8.8 RESTART Statement">
<code class="literal">
RESTART
</code>
</a>
and
<a class="link" href="shutdown.html" title="15.7.8.9 SHUTDOWN Statement">
<code class="literal">
SHUTDOWN
</code>
</a>
statements normally
have a value of zero, but can be nonzero if
<a class="link" href="restart.html" title="15.7.8.8 RESTART Statement">
<code class="literal">
RESTART
</code>
</a>
or
<a class="link" href="shutdown.html" title="15.7.8.9 SHUTDOWN Statement">
<code class="literal">
SHUTDOWN
</code>
</a>
statements were
executed but failed.
</p>
<p>
The
<code class="literal">
Com_stmt_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
status variables are as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
Com_stmt_prepare
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
Com_stmt_execute
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
Com_stmt_fetch
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
Com_stmt_send_long_data
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
Com_stmt_reset
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
Com_stmt_close
</code>
</p>
</li>
</ul>
</div>
<p>
Those variables stand for prepared statement commands. Their
names refer to the
<code class="literal">
COM_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
command
set used in the network layer. In other words, their values
increase whenever prepared statement API calls such as
<span class="command">
<strong>
mysql_stmt_prepare()
</strong>
</span>
,
<span class="command">
<strong>
mysql_stmt_execute()
</strong>
</span>
, and so forth are
executed. However,
<code class="literal">
Com_stmt_prepare
</code>
,
<code class="literal">
Com_stmt_execute
</code>
and
<code class="literal">
Com_stmt_close
</code>
also increase for
<a class="link" href="prepare.html" title="15.5.1 PREPARE Statement">
<code class="literal">
PREPARE
</code>
</a>
,
<a class="link" href="execute.html" title="15.5.2 EXECUTE Statement">
<code class="literal">
EXECUTE
</code>
</a>
, or
<a class="link" href="deallocate-prepare.html" title="15.5.3 DEALLOCATE PREPARE Statement">
<code class="literal">
DEALLOCATE PREPARE
</code>
</a>
,
respectively. Additionally, the values of the older statement
counter variables
<code class="literal">
Com_prepare_sql
</code>
,
<code class="literal">
Com_execute_sql
</code>
, and
<code class="literal">
Com_dealloc_sql
</code>
increase for the
<a class="link" href="prepare.html" title="15.5.1 PREPARE Statement">
<code class="literal">
PREPARE
</code>
</a>
,
<a class="link" href="execute.html" title="15.5.2 EXECUTE Statement">
<code class="literal">
EXECUTE
</code>
</a>
, and
<a class="link" href="deallocate-prepare.html" title="15.5.3 DEALLOCATE PREPARE Statement">
<code class="literal">
DEALLOCATE PREPARE
</code>
</a>
statements.
<code class="literal">
Com_stmt_fetch
</code>
stands for the total number
of network round-trips issued when fetching from cursors.
</p>
<p>
<code class="literal">
Com_stmt_reprepare
</code>
indicates the number of
times statements were automatically reprepared by the server,
for example, after metadata changes to tables or views
referred to by the statement. A reprepare operation increments
<code class="literal">
Com_stmt_reprepare
</code>
, and also
<code class="literal">
Com_stmt_prepare
</code>
.
</p>
<p>
<code class="literal">
Com_explain_other
</code>
indicates the number of
<a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
<code class="literal">
EXPLAIN FOR
CONNECTION
</code>
</a>
statements executed. See
<a class="xref" href="explain-for-connection.html" title="10.8.4 Obtaining Execution Plan Information for a Named Connection">
Section 10.8.4, “Obtaining Execution Plan Information for a Named Connection”
</a>
.
</p>
<p>
<code class="literal">
Com_change_repl_filter
</code>
indicates the number
of
<a class="link" href="change-replication-filter.html" title="15.4.2.1 CHANGE REPLICATION FILTER Statement">
<code class="literal">
CHANGE REPLICATION FILTER
</code>
</a>
statements executed.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Compression">
</a>
<a class="link" href="server-status-variables.html#statvar_Compression">
<code class="literal">
Compression
</code>
</a>
</p>
<a class="indexterm" name="idm46045263457376">
</a>
<a class="indexterm" name="idm46045263456288">
</a>
<p>
Whether the client connection uses compression in the
client/server protocol.
</p>
<p>
This status variable is deprecated; expect it to be removed in
a future version of MySQL. See
<a class="xref" href="connection-compression-control.html#connection-compression-legacy-configuration" title="Configuring Legacy Connection Compression">
Configuring Legacy Connection Compression
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Compression_algorithm">
</a>
<a class="link" href="server-status-variables.html#statvar_Compression_algorithm">
<code class="literal">
Compression_algorithm
</code>
</a>
</p>
<a class="indexterm" name="idm46045263450576">
</a>
<a class="indexterm" name="idm46045263449536">
</a>
<p>
The name of the compression algorithm in use for the current
connection to the server. The value can be any algorithm
permitted in the value of the
<a class="link" href="server-system-variables.html#sysvar_protocol_compression_algorithms">
<code class="literal">
protocol_compression_algorithms
</code>
</a>
system variable. For example, the value is
<code class="literal">
uncompressed
</code>
if the connection does not use
compression, or
<code class="literal">
zlib
</code>
if the connection uses
the
<code class="literal">
zlib
</code>
algorithm.
</p>
<p>
For more information, see
<a class="xref" href="connection-compression-control.html" title="6.2.8 Connection Compression Control">
Section 6.2.8, “Connection Compression Control”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Compression_level">
</a>
<a class="link" href="server-status-variables.html#statvar_Compression_level">
<code class="literal">
Compression_level
</code>
</a>
</p>
<a class="indexterm" name="idm46045263440240">
</a>
<a class="indexterm" name="idm46045263439200">
</a>
<p>
The compression level in use for the current connection to the
server. The value is 6 for
<code class="literal">
zlib
</code>
connections
(the default
<code class="literal">
zlib
</code>
algorithm compression
level), 1 to 22 for
<code class="literal">
zstd
</code>
connections, and 0
for
<code class="literal">
uncompressed
</code>
connections.
</p>
<p>
For more information, see
<a class="xref" href="connection-compression-control.html" title="6.2.8 Connection Compression Control">
Section 6.2.8, “Connection Compression Control”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Connection_errors_xxx">
</a>
<a class="link" href="server-status-variables.html#statvar_Connection_errors_xxx">
<code class="literal">
Connection_errors_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
</a>
</p>
<p>
These variables provide information about errors that occur
during the client connection process. They are global only and
represent error counts aggregated across connections from all
hosts. These variables track errors not accounted for by the
host cache (see
<a class="xref" href="host-cache.html" title="7.1.12.3 DNS Lookups and the Host Cache">
Section 7.1.12.3, “DNS Lookups and the Host Cache”
</a>
), such as errors
that are not associated with TCP connections, occur very early
in the connection process (even before an IP address is
known), or are not specific to any particular IP address (such
as out-of-memory conditions).
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<a name="statvar_Connection_errors_accept">
</a>
<a class="link" href="server-status-variables.html#statvar_Connection_errors_accept">
<code class="literal">
Connection_errors_accept
</code>
</a>
</p>
<a class="indexterm" name="idm46045263426128">
</a>
<a class="indexterm" name="idm46045263425024">
</a>
<p>
The number of errors that occurred during calls to
<code class="literal">
accept()
</code>
on the listening port.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Connection_errors_internal">
</a>
<a class="link" href="server-status-variables.html#statvar_Connection_errors_internal">
<code class="literal">
Connection_errors_internal
</code>
</a>
</p>
<a class="indexterm" name="idm46045263419888">
</a>
<a class="indexterm" name="idm46045263418784">
</a>
<p>
The number of connections refused due to internal errors
in the server, such as failure to start a new thread or an
out-of-memory condition.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Connection_errors_max_connections">
</a>
<a class="link" href="server-status-variables.html#statvar_Connection_errors_max_connections">
<code class="literal">
Connection_errors_max_connections
</code>
</a>
</p>
<a class="indexterm" name="idm46045263414144">
</a>
<a class="indexterm" name="idm46045263413104">
</a>
<p>
The number of connections refused because the server
<a class="link" href="server-system-variables.html#sysvar_max_connections">
<code class="literal">
max_connections
</code>
</a>
limit was
reached.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Connection_errors_peer_address">
</a>
<a class="link" href="server-status-variables.html#statvar_Connection_errors_peer_address">
<code class="literal">
Connection_errors_peer_address
</code>
</a>
</p>
<a class="indexterm" name="idm46045263407376">
</a>
<a class="indexterm" name="idm46045263406272">
</a>
<p>
The number of errors that occurred while searching for
connecting client IP addresses.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Connection_errors_select">
</a>
<a class="link" href="server-status-variables.html#statvar_Connection_errors_select">
<code class="literal">
Connection_errors_select
</code>
</a>
</p>
<a class="indexterm" name="idm46045263401824">
</a>
<a class="indexterm" name="idm46045263400720">
</a>
<p>
The number of errors that occurred during calls to
<code class="literal">
select()
</code>
or
<code class="literal">
poll()
</code>
on the listening port. (Failure of this operation does not
necessarily means a client connection was rejected.)
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Connection_errors_tcpwrap">
</a>
<a class="link" href="server-status-variables.html#statvar_Connection_errors_tcpwrap">
<code class="literal">
Connection_errors_tcpwrap
</code>
</a>
</p>
<a class="indexterm" name="idm46045263394736">
</a>
<a class="indexterm" name="idm46045263393632">
</a>
<p>
The number of connections refused by the
<code class="literal">
libwrap
</code>
library.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a name="statvar_Connections">
</a>
<a class="link" href="server-status-variables.html#statvar_Connections">
<code class="literal">
Connections
</code>
</a>
</p>
<a class="indexterm" name="idm46045263388288">
</a>
<a class="indexterm" name="idm46045263387200">
</a>
<p>
The number of connection attempts (successful or not) to the
MySQL server.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Created_tmp_disk_tables">
</a>
<a class="link" href="server-status-variables.html#statvar_Created_tmp_disk_tables">
<code class="literal">
Created_tmp_disk_tables
</code>
</a>
</p>
<a class="indexterm" name="idm46045263382688">
</a>
<a class="indexterm" name="idm46045263381648">
</a>
<p>
The number of internal on-disk temporary tables created by the
server while executing statements.
</p>
<p>
You can compare the number of internal on-disk temporary
tables created to the total number of internal temporary
tables created by comparing
<a class="link" href="server-status-variables.html#statvar_Created_tmp_disk_tables">
<code class="literal">
Created_tmp_disk_tables
</code>
</a>
and
<a class="link" href="server-status-variables.html#statvar_Created_tmp_tables">
<code class="literal">
Created_tmp_tables
</code>
</a>
values.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Due to a known limitation,
<a class="link" href="server-status-variables.html#statvar_Created_tmp_disk_tables">
<code class="literal">
Created_tmp_disk_tables
</code>
</a>
does not count on-disk temporary tables created in
memory-mapped files. By default, the TempTable storage
engine overflow mechanism creates internal temporary tables
in memory-mapped files. This behavior is controlled by the
<a class="link" href="server-system-variables.html#sysvar_temptable_use_mmap">
<code class="literal">
temptable_use_mmap
</code>
</a>
variable.
</p>
</div>
<p>
See also
<a class="xref" href="internal-temporary-tables.html" title="10.4.4 Internal Temporary Table Use in MySQL">
Section 10.4.4, “Internal Temporary Table Use in MySQL”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Created_tmp_files">
</a>
<a class="link" href="server-status-variables.html#statvar_Created_tmp_files">
<code class="literal">
Created_tmp_files
</code>
</a>
</p>
<a class="indexterm" name="idm46045263369312">
</a>
<a class="indexterm" name="idm46045263368272">
</a>
<p>
How many temporary files
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
has
created.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Created_tmp_tables">
</a>
<a class="link" href="server-status-variables.html#statvar_Created_tmp_tables">
<code class="literal">
Created_tmp_tables
</code>
</a>
</p>
<a class="indexterm" name="idm46045263362592">
</a>
<a class="indexterm" name="idm46045263361552">
</a>
<p>
The number of internal temporary tables created by the server
while executing statements.
</p>
<p>
You can compare the number of internal on-disk temporary
tables created to the total number of internal temporary
tables created by comparing
<a class="link" href="server-status-variables.html#statvar_Created_tmp_disk_tables">
<code class="literal">
Created_tmp_disk_tables
</code>
</a>
and
<a class="link" href="server-status-variables.html#statvar_Created_tmp_tables">
<code class="literal">
Created_tmp_tables
</code>
</a>
values.
</p>
<p>
See also
<a class="xref" href="internal-temporary-tables.html" title="10.4.4 Internal Temporary Table Use in MySQL">
Section 10.4.4, “Internal Temporary Table Use in MySQL”
</a>
.
</p>
<p>
Each invocation of the
<a class="link" href="show-status.html" title="15.7.7.37 SHOW STATUS Statement">
<code class="literal">
SHOW
STATUS
</code>
</a>
statement uses an internal temporary table
and increments the global
<a class="link" href="server-status-variables.html#statvar_Created_tmp_tables">
<code class="literal">
Created_tmp_tables
</code>
</a>
value.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Current_tls_ca">
</a>
<a class="link" href="server-status-variables.html#statvar_Current_tls_ca">
<code class="literal">
Current_tls_ca
</code>
</a>
</p>
<a class="indexterm" name="idm46045263349920">
</a>
<a class="indexterm" name="idm46045263348832">
</a>
<p>
The active
<a class="link" href="server-system-variables.html#sysvar_ssl_ca">
<code class="literal">
ssl_ca
</code>
</a>
value in
the SSL context that the server uses for new connections. This
context value may differ from the current
<a class="link" href="server-system-variables.html#sysvar_ssl_ca">
<code class="literal">
ssl_ca
</code>
</a>
system variable value
if the system variable has been changed but
<a class="link" href="alter-instance.html#alter-instance-reload-tls">
<code class="literal">
ALTER INSTANCE RELOAD TLS
</code>
</a>
has
not subsequently been executed to reconfigure the SSL context
from the context-related system variable values and update the
corresponding status variables. (This potential difference in
values applies to each corresponding pair of context-related
system and status variables. See
<a class="xref" href="using-encrypted-connections.html#using-encrypted-connections-server-side-runtime-configuration" title="Server-Side Runtime Configuration and Monitoring for Encrypted Connections">
Server-Side Runtime Configuration and Monitoring for Encrypted
Connections
</a>
.)
</p>
<p>
The
<code class="literal">
Current_tls_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
status variable values are also available through the
Performance Schema
<a class="link" href="performance-schema-tls-channel-status-table.html" title="29.12.22.9 The tls_channel_status Table">
<code class="literal">
tls_channel_status
</code>
</a>
table. See
<a class="xref" href="performance-schema-tls-channel-status-table.html" title="29.12.22.9 The tls_channel_status Table">
Section 29.12.22.9, “The tls_channel_status Table”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Current_tls_capath">
</a>
<a class="link" href="server-status-variables.html#statvar_Current_tls_capath">
<code class="literal">
Current_tls_capath
</code>
</a>
</p>
<a class="indexterm" name="idm46045263335584">
</a>
<a class="indexterm" name="idm46045263334544">
</a>
<p>
The active
<a class="link" href="server-system-variables.html#sysvar_ssl_capath">
<code class="literal">
ssl_capath
</code>
</a>
value
in the TLS context that the server uses for new connections.
For notes about the relationship between this status variable
and its corresponding system variable, see the description of
<a class="link" href="server-status-variables.html#statvar_Current_tls_ca">
<code class="literal">
Current_tls_ca
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Current_tls_cert">
</a>
<a class="link" href="server-status-variables.html#statvar_Current_tls_cert">
<code class="literal">
Current_tls_cert
</code>
</a>
</p>
<a class="indexterm" name="idm46045263327504">
</a>
<a class="indexterm" name="idm46045263326464">
</a>
<p>
The active
<a class="link" href="server-system-variables.html#sysvar_ssl_cert">
<code class="literal">
ssl_cert
</code>
</a>
value in
the TLS context that the server uses for new connections. For
notes about the relationship between this status variable and
its corresponding system variable, see the description of
<a class="link" href="server-status-variables.html#statvar_Current_tls_ca">
<code class="literal">
Current_tls_ca
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Current_tls_cipher">
</a>
<a class="link" href="server-status-variables.html#statvar_Current_tls_cipher">
<code class="literal">
Current_tls_cipher
</code>
</a>
</p>
<a class="indexterm" name="idm46045263319360">
</a>
<a class="indexterm" name="idm46045263318320">
</a>
<p>
The active
<a class="link" href="server-system-variables.html#sysvar_ssl_cipher">
<code class="literal">
ssl_cipher
</code>
</a>
value
in the TLS context that the server uses for new connections.
For notes about the relationship between this status variable
and its corresponding system variable, see the description of
<a class="link" href="server-status-variables.html#statvar_Current_tls_ca">
<code class="literal">
Current_tls_ca
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Current_tls_ciphersuites">
</a>
<a class="link" href="server-status-variables.html#statvar_Current_tls_ciphersuites">
<code class="literal">
Current_tls_ciphersuites
</code>
</a>
</p>
<a class="indexterm" name="idm46045263311248">
</a>
<a class="indexterm" name="idm46045263310144">
</a>
<p>
The active
<a class="link" href="server-system-variables.html#sysvar_tls_ciphersuites">
<code class="literal">
tls_ciphersuites
</code>
</a>
value in the TLS context that the server uses for new
connections. For notes about the relationship between this
status variable and its corresponding system variable, see the
description of
<a class="link" href="server-status-variables.html#statvar_Current_tls_ca">
<code class="literal">
Current_tls_ca
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Current_tls_crl">
</a>
<a class="link" href="server-status-variables.html#statvar_Current_tls_crl">
<code class="literal">
Current_tls_crl
</code>
</a>
</p>
<a class="indexterm" name="idm46045263303200">
</a>
<a class="indexterm" name="idm46045263302112">
</a>
<p>
The active
<a class="link" href="server-system-variables.html#sysvar_ssl_crl">
<code class="literal">
ssl_crl
</code>
</a>
value in
the TLS context that the server uses for new connections. For
notes about the relationship between this status variable and
its corresponding system variable, see the description of
<a class="link" href="server-status-variables.html#statvar_Current_tls_ca">
<code class="literal">
Current_tls_ca
</code>
</a>
.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
When you reload the TLS context, OpenSSL reloads the file
containing the CRL (certificate revocation list) as part of
the process. If the CRL file is large, the server allocates
a large chunk of memory (ten times the file size), which is
doubled while the new instance is being loaded and the old
one has not yet been released. The process resident memory
is not immediately reduced after a large allocation is
freed, so if you issue the
<code class="literal">
ALTER INSTANCE RELOAD
TLS
</code>
statement repeatedly with a large CRL file,
the process resident memory usage may grow as a result of
this.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="statvar_Current_tls_crlpath">
</a>
<a class="link" href="server-status-variables.html#statvar_Current_tls_crlpath">
<code class="literal">
Current_tls_crlpath
</code>
</a>
</p>
<a class="indexterm" name="idm46045263292896">
</a>
<a class="indexterm" name="idm46045263291856">
</a>
<p>
The active
<a class="link" href="server-system-variables.html#sysvar_ssl_crlpath">
<code class="literal">
ssl_crlpath
</code>
</a>
value
in the TLS context that the server uses for new connections.
For notes about the relationship between this status variable
and its corresponding system variable, see the description of
<a class="link" href="server-status-variables.html#statvar_Current_tls_ca">
<code class="literal">
Current_tls_ca
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Current_tls_key">
</a>
<a class="link" href="server-status-variables.html#statvar_Current_tls_key">
<code class="literal">
Current_tls_key
</code>
</a>
</p>
<a class="indexterm" name="idm46045263284928">
</a>
<a class="indexterm" name="idm46045263283840">
</a>
<p>
The active
<a class="link" href="server-system-variables.html#sysvar_ssl_key">
<code class="literal">
ssl_key
</code>
</a>
value in
the TLS context that the server uses for new connections. For
notes about the relationship between this status variable and
its corresponding system variable, see the description of
<a class="link" href="server-status-variables.html#statvar_Current_tls_ca">
<code class="literal">
Current_tls_ca
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Current_tls_version">
</a>
<a class="link" href="server-status-variables.html#statvar_Current_tls_version">
<code class="literal">
Current_tls_version
</code>
</a>
</p>
<a class="indexterm" name="idm46045263276736">
</a>
<a class="indexterm" name="idm46045263275696">
</a>
<p>
The active
<a class="link" href="server-system-variables.html#sysvar_tls_version">
<code class="literal">
tls_version
</code>
</a>
value
in the TLS context that the server uses for new connections.
For notes about the relationship between this status variable
and its corresponding system variable, see the description of
<a class="link" href="server-status-variables.html#statvar_Current_tls_ca">
<code class="literal">
Current_tls_ca
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Delayed_errors">
</a>
<a class="link" href="server-status-variables.html#statvar_Delayed_errors">
<code class="literal">
Delayed_errors
</code>
</a>
</p>
<a class="indexterm" name="idm46045263268704">
</a>
<a class="indexterm" name="idm46045263267616">
</a>
<p>
This status variable is deprecated (because
<code class="literal">
DELAYED
</code>
inserts are not supported); expect
it to be removed in a future release.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Delayed_insert_threads">
</a>
<a class="link" href="server-status-variables.html#statvar_Delayed_insert_threads">
<code class="literal">
Delayed_insert_threads
</code>
</a>
</p>
<a class="indexterm" name="idm46045263262432">
</a>
<a class="indexterm" name="idm46045263261392">
</a>
<p>
This status variable is deprecated (because
<code class="literal">
DELAYED
</code>
inserts are not supported); expect
it to be removed in a future release.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Delayed_writes">
</a>
<a class="link" href="server-status-variables.html#statvar_Delayed_writes">
<code class="literal">
Delayed_writes
</code>
</a>
</p>
<a class="indexterm" name="idm46045263256240">
</a>
<a class="indexterm" name="idm46045263255152">
</a>
<p>
This status variable is deprecated (because
<code class="literal">
DELAYED
</code>
inserts are not supported); expect
it to be removed in a future release.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Deprecated_use_i_s_processlist_count">
</a>
<a class="link" href="server-status-variables.html#statvar_Deprecated_use_i_s_processlist_count">
<code class="literal">
Deprecated_use_i_s_processlist_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045263249792">
</a>
<a class="indexterm" name="idm46045263248752">
</a>
<p>
How many times the
<a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
<code class="literal">
information_schema.processlist
</code>
</a>
table has been accessed since the last restart.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Deprecated_use_i_s_processlist_last_timestamp">
</a>
<a class="link" href="server-status-variables.html#statvar_Deprecated_use_i_s_processlist_last_timestamp">
<code class="literal">
Deprecated_use_i_s_processlist_last_timestamp
</code>
</a>
</p>
<a class="indexterm" name="idm46045263242976">
</a>
<a class="indexterm" name="idm46045263241856">
</a>
<p>
A timestamp indicating the last time the
<a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
<code class="literal">
information_schema.processlist
</code>
</a>
table has been accessed since the last restart. Shows
microseconds since the Unix Epoch.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_dragnet.Status">
</a>
<a class="link" href="server-status-variables.html#statvar_dragnet.Status">
<code class="literal">
dragnet.Status
</code>
</a>
</p>
<a class="indexterm" name="idm46045263236096">
</a>
<a class="indexterm" name="idm46045263235008">
</a>
<p>
The result of the most recent assignment to the
<a class="link" href="server-system-variables.html#sysvar_dragnet.log_error_filter_rules">
<code class="literal">
dragnet.log_error_filter_rules
</code>
</a>
system variable, empty if no such assignment has occurred.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Error_log_buffered_bytes">
</a>
<a class="link" href="server-status-variables.html#statvar_Error_log_buffered_bytes">
<code class="literal">
Error_log_buffered_bytes
</code>
</a>
</p>
<a class="indexterm" name="idm46045263229232">
</a>
<a class="indexterm" name="idm46045263228128">
</a>
<p>
The number of bytes currently used in the Performance Schema
<a class="link" href="performance-schema-error-log-table.html" title="29.12.22.2 The error_log Table">
<code class="literal">
error_log
</code>
</a>
table. It is possible
for the value to decrease, for example, if a new event cannot
fit until discarding an old event, but the new event is
smaller than the old one.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Error_log_buffered_events">
</a>
<a class="link" href="server-status-variables.html#statvar_Error_log_buffered_events">
<code class="literal">
Error_log_buffered_events
</code>
</a>
</p>
<a class="indexterm" name="idm46045263222096">
</a>
<a class="indexterm" name="idm46045263220992">
</a>
<p>
The number of events currently present in the Performance
Schema
<a class="link" href="performance-schema-error-log-table.html" title="29.12.22.2 The error_log Table">
<code class="literal">
error_log
</code>
</a>
table. As with
<a class="link" href="server-status-variables.html#statvar_Error_log_buffered_bytes">
<code class="literal">
Error_log_buffered_bytes
</code>
</a>
, it
is possible for the value to decrease.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Error_log_expired_events">
</a>
<a class="link" href="server-status-variables.html#statvar_Error_log_expired_events">
<code class="literal">
Error_log_expired_events
</code>
</a>
</p>
<a class="indexterm" name="idm46045263213920">
</a>
<a class="indexterm" name="idm46045263212816">
</a>
<p>
The number of events discarded from the Performance Schema
<a class="link" href="performance-schema-error-log-table.html" title="29.12.22.2 The error_log Table">
<code class="literal">
error_log
</code>
</a>
table to make room for
new events.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Error_log_latest_write">
</a>
<a class="link" href="server-status-variables.html#statvar_Error_log_latest_write">
<code class="literal">
Error_log_latest_write
</code>
</a>
</p>
<a class="indexterm" name="idm46045263207088">
</a>
<a class="indexterm" name="idm46045263206048">
</a>
<p>
The time of the last write to the Performance Schema
<a class="link" href="performance-schema-error-log-table.html" title="29.12.22.2 The error_log Table">
<code class="literal">
error_log
</code>
</a>
table.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Flush_commands">
</a>
<a class="link" href="server-status-variables.html#statvar_Flush_commands">
<code class="literal">
Flush_commands
</code>
</a>
</p>
<a class="indexterm" name="idm46045263200480">
</a>
<a class="indexterm" name="idm46045263199392">
</a>
<p>
The number of times the server flushes tables, whether because
a user executed a
<a class="link" href="flush.html#flush-tables">
<code class="literal">
FLUSH TABLES
</code>
</a>
statement or due to internal server operation. It is also
incremented by receipt of a
<code class="literal">
COM_REFRESH
</code>
packet. This is in contrast to
<a class="link" href="server-status-variables.html#statvar_Com_xxx">
<code class="literal">
Com_flush
</code>
</a>
,
which indicates how many
<code class="literal">
FLUSH
</code>
statements
have been executed, whether
<a class="link" href="flush.html#flush-tables">
<code class="literal">
FLUSH
TABLES
</code>
</a>
,
<a class="link" href="flush.html#flush-logs">
<code class="literal">
FLUSH LOGS
</code>
</a>
,
and so forth.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Global_connection_memory">
</a>
<a class="link" href="server-status-variables.html#statvar_Global_connection_memory">
<code class="literal">
Global_connection_memory
</code>
</a>
</p>
<a class="indexterm" name="idm46045263188464">
</a>
<a class="indexterm" name="idm46045263187360">
</a>
<p>
The memory used by all user connections to the server. Memory
used by system threads or by the MySQL root account is
included in the total, but such threads or users are not
subject to disconnection due to memory usage. This memory is
not calculated unless
<a class="link" href="server-system-variables.html#sysvar_global_connection_memory_tracking">
<code class="literal">
global_connection_memory_tracking
</code>
</a>
is enabled (disabled by default). The Performance Schema must
also be enabled.
</p>
<p>
You can control (indirectly) the frequency with which this
variable is updated by setting
<a class="link" href="server-system-variables.html#sysvar_connection_memory_chunk_size">
<code class="literal">
connection_memory_chunk_size
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_commit">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_commit">
<code class="literal">
Handler_commit
</code>
</a>
</p>
<a class="indexterm" name="idm46045263179520">
</a>
<a class="indexterm" name="idm46045263178432">
</a>
<p>
The number of internal
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
COMMIT
</code>
</a>
statements.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_delete">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_delete">
<code class="literal">
Handler_delete
</code>
</a>
</p>
<a class="indexterm" name="idm46045263172864">
</a>
<a class="indexterm" name="idm46045263171776">
</a>
<p>
The number of times that rows have been deleted from tables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_external_lock">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_external_lock">
<code class="literal">
Handler_external_lock
</code>
</a>
</p>
<a class="indexterm" name="idm46045263167360">
</a>
<a class="indexterm" name="idm46045263166320">
</a>
<a class="indexterm" name="idm46045263164832">
</a>
<p>
The server increments this variable for each call to its
<code class="literal">
external_lock()
</code>
function, which generally
occurs at the beginning and end of access to a table instance.
There might be differences among storage engines. This
variable can be used, for example, to discover for a statement
that accesses a partitioned table how many partitions were
pruned before locking occurred: Check how much the counter
increased for the statement, subtract 2 (2 calls for the table
itself), then divide by 2 to get the number of partitions
locked.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_mrr_init">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_mrr_init">
<code class="literal">
Handler_mrr_init
</code>
</a>
</p>
<a class="indexterm" name="idm46045263159520">
</a>
<a class="indexterm" name="idm46045263158480">
</a>
<p>
The number of times the server uses a storage engine's own
Multi-Range Read implementation for table access.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_prepare">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_prepare">
<code class="literal">
Handler_prepare
</code>
</a>
</p>
<a class="indexterm" name="idm46045263154048">
</a>
<a class="indexterm" name="idm46045263152960">
</a>
<a class="indexterm" name="idm46045263151472">
</a>
<p>
A counter for the prepare phase of two-phase commit
operations.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_read_first">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_read_first">
<code class="literal">
Handler_read_first
</code>
</a>
</p>
<a class="indexterm" name="idm46045263147456">
</a>
<a class="indexterm" name="idm46045263146416">
</a>
<p>
The number of times the first entry in an index was read. If
this value is high, it suggests that the server is doing a lot
of full index scans (for example,
<code class="literal">
SELECT col1 FROM
foo
</code>
, assuming that
<code class="literal">
col1
</code>
is
indexed).
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_read_key">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_read_key">
<code class="literal">
Handler_read_key
</code>
</a>
</p>
<a class="indexterm" name="idm46045263140416">
</a>
<a class="indexterm" name="idm46045263139376">
</a>
<p>
The number of requests to read a row based on a key. If this
value is high, it is a good indication that your tables are
properly indexed for your queries.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_read_last">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_read_last">
<code class="literal">
Handler_read_last
</code>
</a>
</p>
<a class="indexterm" name="idm46045263134848">
</a>
<a class="indexterm" name="idm46045263133808">
</a>
<p>
The number of requests to read the last key in an index. With
<code class="literal">
ORDER BY
</code>
, the server issues a first-key
request followed by several next-key requests, whereas with
<code class="literal">
ORDER BY DESC
</code>
, the server issues a last-key
request followed by several previous-key requests.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_read_next">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_read_next">
<code class="literal">
Handler_read_next
</code>
</a>
</p>
<a class="indexterm" name="idm46045263127776">
</a>
<a class="indexterm" name="idm46045263126736">
</a>
<p>
The number of requests to read the next row in key order. This
value is incremented if you are querying an index column with
a range constraint or if you are doing an index scan.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_read_prev">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_read_prev">
<code class="literal">
Handler_read_prev
</code>
</a>
</p>
<a class="indexterm" name="idm46045263122112">
</a>
<a class="indexterm" name="idm46045263121072">
</a>
<p>
The number of requests to read the previous row in key order.
This read method is mainly used to optimize
<code class="literal">
ORDER BY
... DESC
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_read_rnd">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_read_rnd">
<code class="literal">
Handler_read_rnd
</code>
</a>
</p>
<a class="indexterm" name="idm46045263115808">
</a>
<a class="indexterm" name="idm46045263114768">
</a>
<p>
The number of requests to read a row based on a fixed
position. This value is high if you are doing a lot of queries
that require sorting of the result. You probably have a lot of
queries that require MySQL to scan entire tables or you have
joins that do not use keys properly.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_read_rnd_next">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_read_rnd_next">
<code class="literal">
Handler_read_rnd_next
</code>
</a>
</p>
<a class="indexterm" name="idm46045263110032">
</a>
<a class="indexterm" name="idm46045263108992">
</a>
<p>
The number of requests to read the next row in the data file.
This value is high if you are doing a lot of table scans.
Generally this suggests that your tables are not properly
indexed or that your queries are not written to take advantage
of the indexes you have.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_rollback">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_rollback">
<code class="literal">
Handler_rollback
</code>
</a>
</p>
<a class="indexterm" name="idm46045263104272">
</a>
<a class="indexterm" name="idm46045263103232">
</a>
<p>
The number of requests for a storage engine to perform a
rollback operation.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_savepoint">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_savepoint">
<code class="literal">
Handler_savepoint
</code>
</a>
</p>
<a class="indexterm" name="idm46045263098720">
</a>
<a class="indexterm" name="idm46045263097680">
</a>
<p>
The number of requests for a storage engine to place a
savepoint.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_savepoint_rollback">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_savepoint_rollback">
<code class="literal">
Handler_savepoint_rollback
</code>
</a>
</p>
<a class="indexterm" name="idm46045263093280">
</a>
<a class="indexterm" name="idm46045263092176">
</a>
<p>
The number of requests for a storage engine to roll back to a
savepoint.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_update">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_update">
<code class="literal">
Handler_update
</code>
</a>
</p>
<a class="indexterm" name="idm46045263087776">
</a>
<a class="indexterm" name="idm46045263086688">
</a>
<p>
The number of requests to update a row in a table.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Handler_write">
</a>
<a class="link" href="server-status-variables.html#statvar_Handler_write">
<code class="literal">
Handler_write
</code>
</a>
</p>
<a class="indexterm" name="idm46045263082400">
</a>
<a class="indexterm" name="idm46045263081312">
</a>
<p>
The number of requests to insert a row in a table.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_dump_status">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_dump_status">
<code class="literal">
Innodb_buffer_pool_dump_status
</code>
</a>
</p>
<a class="indexterm" name="idm46045263076880">
</a>
<a class="indexterm" name="idm46045263075776">
</a>
<p>
The progress of an operation to record the
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
held in the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
, triggered
by the setting of
<code class="literal">
innodb_buffer_pool_dump_at_shutdown
</code>
or
<code class="literal">
innodb_buffer_pool_dump_now
</code>
.
</p>
<p>
For related information and examples, see
<a class="xref" href="innodb-preload-buffer-pool.html" title="17.8.3.6 Saving and Restoring the Buffer Pool State">
Section 17.8.3.6, “Saving and Restoring the Buffer Pool State”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_load_status">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_load_status">
<code class="literal">
Innodb_buffer_pool_load_status
</code>
</a>
</p>
<a class="indexterm" name="idm46045263065840">
</a>
<a class="indexterm" name="idm46045263064736">
</a>
<p>
The progress of an operation to
<a class="link" href="glossary.html#glos_warm_up" title="warm up">
warm up
</a>
the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
by reading
in a set of
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
corresponding to an earlier point in time, triggered by the
setting of
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_load_at_startup">
<code class="literal">
innodb_buffer_pool_load_at_startup
</code>
</a>
or
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_load_now">
<code class="literal">
innodb_buffer_pool_load_now
</code>
</a>
.
If the operation introduces too much overhead, you can cancel
it by setting
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_load_abort">
<code class="literal">
innodb_buffer_pool_load_abort
</code>
</a>
.
</p>
<p>
For related information and examples, see
<a class="xref" href="innodb-preload-buffer-pool.html" title="17.8.3.6 Saving and Restoring the Buffer Pool State">
Section 17.8.3.6, “Saving and Restoring the Buffer Pool State”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_bytes_data">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_bytes_data">
<code class="literal">
Innodb_buffer_pool_bytes_data
</code>
</a>
</p>
<a class="indexterm" name="idm46045263051760">
</a>
<a class="indexterm" name="idm46045263050656">
</a>
<p>
The total number of bytes in the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
containing
data. The number includes both
<a class="link" href="glossary.html#glos_dirty_page" title="dirty page">
dirty
</a>
and clean pages.
For more accurate memory usage calculations than with
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_data">
<code class="literal">
Innodb_buffer_pool_pages_data
</code>
</a>
,
when
<a class="link" href="glossary.html#glos_compression" title="compression">
compressed
</a>
tables
cause the buffer pool to hold pages of different sizes.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_pages_data">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_data">
<code class="literal">
Innodb_buffer_pool_pages_data
</code>
</a>
</p>
<a class="indexterm" name="idm46045263041312">
</a>
<a class="indexterm" name="idm46045263040208">
</a>
<p>
The number of
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
in the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
containing
data. The number includes both
<a class="link" href="glossary.html#glos_dirty_page" title="dirty page">
dirty
</a>
and clean pages.
When using
<a class="link" href="glossary.html#glos_compressed_table" title="compressed table">
compressed
tables
</a>
, the reported
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_data">
<code class="literal">
Innodb_buffer_pool_pages_data
</code>
</a>
value may be larger than
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_total">
<code class="literal">
Innodb_buffer_pool_pages_total
</code>
</a>
(Bug #59550).
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_bytes_dirty">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_bytes_dirty">
<code class="literal">
Innodb_buffer_pool_bytes_dirty
</code>
</a>
</p>
<a class="indexterm" name="idm46045263028896">
</a>
<a class="indexterm" name="idm46045263027792">
</a>
<p>
The total current number of bytes held in
<a class="link" href="glossary.html#glos_dirty_page" title="dirty page">
dirty pages
</a>
in the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
. For more
accurate memory usage calculations than with
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_dirty">
<code class="literal">
Innodb_buffer_pool_pages_dirty
</code>
</a>
,
when
<a class="link" href="glossary.html#glos_compression" title="compression">
compressed
</a>
tables
cause the buffer pool to hold pages of different sizes.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_pages_dirty">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_dirty">
<code class="literal">
Innodb_buffer_pool_pages_dirty
</code>
</a>
</p>
<a class="indexterm" name="idm46045263018752">
</a>
<a class="indexterm" name="idm46045263017648">
</a>
<p>
The current number of
<a class="link" href="glossary.html#glos_dirty_page" title="dirty page">
dirty
pages
</a>
in the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_pages_flushed">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_flushed">
<code class="literal">
Innodb_buffer_pool_pages_flushed
</code>
</a>
</p>
<a class="indexterm" name="idm46045263010752">
</a>
<a class="indexterm" name="idm46045263009712">
</a>
<p>
The number of requests to
<a class="link" href="glossary.html#glos_flush" title="flush">
flush
</a>
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
from the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_pages_free">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_free">
<code class="literal">
Innodb_buffer_pool_pages_free
</code>
</a>
</p>
<a class="indexterm" name="idm46045263001952">
</a>
<a class="indexterm" name="idm46045263000848">
</a>
<p>
The number of free
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
in
the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_pages_latched">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_latched">
<code class="literal">
Innodb_buffer_pool_pages_latched
</code>
</a>
</p>
<a class="indexterm" name="idm46045262993952">
</a>
<a class="indexterm" name="idm46045262992912">
</a>
<p>
The number of latched
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
in the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
. These are
pages currently being read or written, or that cannot be
<a class="link" href="glossary.html#glos_flush" title="flush">
flushed
</a>
or removed for some
other reason. Calculation of this variable is expensive, so it
is available only when the
<code class="literal">
UNIV_DEBUG
</code>
system is defined at server build time.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_pages_misc">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_misc">
<code class="literal">
Innodb_buffer_pool_pages_misc
</code>
</a>
</p>
<a class="indexterm" name="idm46045262984352">
</a>
<a class="indexterm" name="idm46045262983248">
</a>
<p>
The number of
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
in the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
that are
busy because they have been allocated for administrative
overhead, such as
<a class="link" href="glossary.html#glos_row_lock" title="row lock">
row
locks
</a>
or the
<a class="link" href="glossary.html#glos_adaptive_hash_index" title="adaptive hash index">
adaptive hash
index
</a>
. This value can also be calculated as
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_total">
<code class="literal">
Innodb_buffer_pool_pages_total
</code>
</a>
−
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_free">
<code class="literal">
Innodb_buffer_pool_pages_free
</code>
</a>
−
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_data">
<code class="literal">
Innodb_buffer_pool_pages_data
</code>
</a>
.
When using
<a class="link" href="glossary.html#glos_compressed_table" title="compressed table">
compressed
tables
</a>
,
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_misc">
<code class="literal">
Innodb_buffer_pool_pages_misc
</code>
</a>
may report an out-of-bounds value (Bug #59550).
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_pages_total">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_total">
<code class="literal">
Innodb_buffer_pool_pages_total
</code>
</a>
</p>
<a class="indexterm" name="idm46045262968256">
</a>
<a class="indexterm" name="idm46045262967152">
</a>
<p>
The total size of the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
, in
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
. When using
<a class="link" href="glossary.html#glos_compressed_table" title="compressed table">
compressed
tables
</a>
, the reported
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_data">
<code class="literal">
Innodb_buffer_pool_pages_data
</code>
</a>
value may be larger than
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_pages_total">
<code class="literal">
Innodb_buffer_pool_pages_total
</code>
</a>
(Bug #59550)
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_read_ahead">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_read_ahead">
<code class="literal">
Innodb_buffer_pool_read_ahead
</code>
</a>
</p>
<a class="indexterm" name="idm46045262956912">
</a>
<a class="indexterm" name="idm46045262955808">
</a>
<p>
The number of
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
read into
the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
by the
<a class="link" href="glossary.html#glos_read_ahead" title="read-ahead">
read-ahead
</a>
background
thread.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_read_ahead_evicted">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_read_ahead_evicted">
<code class="literal">
Innodb_buffer_pool_read_ahead_evicted
</code>
</a>
</p>
<a class="indexterm" name="idm46045262947936">
</a>
<a class="indexterm" name="idm46045262946896">
</a>
<p>
The number of
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
read into
the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
by the
<a class="link" href="glossary.html#glos_read_ahead" title="read-ahead">
read-ahead
</a>
background
thread that were subsequently
<a class="link" href="glossary.html#glos_eviction" title="eviction">
evicted
</a>
without having
been accessed by queries.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_read_ahead_rnd">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_read_ahead_rnd">
<code class="literal">
Innodb_buffer_pool_read_ahead_rnd
</code>
</a>
</p>
<a class="indexterm" name="idm46045262938096">
</a>
<a class="indexterm" name="idm46045262937056">
</a>
<p>
The number of
<span class="quote">
“
<span class="quote">
random
</span>
”
</span>
read-aheads initiated by
<code class="literal">
InnoDB
</code>
. This happens when a query scans a
large portion of a table but in random order.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_read_requests">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_read_requests">
<code class="literal">
Innodb_buffer_pool_read_requests
</code>
</a>
</p>
<a class="indexterm" name="idm46045262931312">
</a>
<a class="indexterm" name="idm46045262930272">
</a>
<p>
The number of logical read requests.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_reads">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_reads">
<code class="literal">
Innodb_buffer_pool_reads
</code>
</a>
</p>
<a class="indexterm" name="idm46045262925888">
</a>
<a class="indexterm" name="idm46045262924784">
</a>
<p>
The number of logical reads that
<code class="literal">
InnoDB
</code>
could not satisfy from the
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
, and had
to read directly from disk.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_resize_status">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_resize_status">
<code class="literal">
Innodb_buffer_pool_resize_status
</code>
</a>
</p>
<a class="indexterm" name="idm46045262918592">
</a>
<a class="indexterm" name="idm46045262917552">
</a>
<p>
The status of an operation to resize the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
dynamically, triggered by setting the
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_size">
<code class="literal">
innodb_buffer_pool_size
</code>
</a>
parameter dynamically. The
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_size">
<code class="literal">
innodb_buffer_pool_size
</code>
</a>
parameter is dynamic, which allows you to resize the buffer
pool without restarting the server. See
<a class="xref" href="innodb-buffer-pool-resize.html#innodb-buffer-pool-online-resize" title="Configuring InnoDB Buffer Pool Size Online">
Configuring InnoDB Buffer Pool Size Online
</a>
for related
information.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_resize_status_code">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_resize_status_code">
<code class="literal">
Innodb_buffer_pool_resize_status_code
</code>
</a>
</p>
<a class="indexterm" name="idm46045262907824">
</a>
<a class="indexterm" name="idm46045262906784">
</a>
<p>
Reports status codes for tracking online buffer pool resizing
operations. Each status code represents a stage in a resizing
operation. Status codes include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
0: No Resize operation in progress
</p>
</li>
<li class="listitem">
<p>
1: Starting Resize
</p>
</li>
<li class="listitem">
<p>
2: Disabling AHI (Adaptive Hash Index)
</p>
</li>
<li class="listitem">
<p>
3: Withdrawing Blocks
</p>
</li>
<li class="listitem">
<p>
4: Acquiring Global Lock
</p>
</li>
<li class="listitem">
<p>
5: Resizing Pool
</p>
</li>
<li class="listitem">
<p>
6: Resizing Hash
</p>
</li>
<li class="listitem">
<p>
7: Resizing Failed
</p>
</li>
</ul>
</div>
<p>
You can use this status variable in conjunction with
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_resize_status_progress">
<code class="literal">
Innodb_buffer_pool_resize_status_progress
</code>
</a>
to track the progress of each stage of a resizing operation.
The
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_resize_status_progress">
<code class="literal">
Innodb_buffer_pool_resize_status_progress
</code>
</a>
variable reports a percentage value indicating the progress of
the current stage.
</p>
<p>
For more information, see
<a class="xref" href="innodb-buffer-pool-resize.html#innodb-buffer-pool-online-resize-monitoring" title="Monitoring Online Buffer Pool Resizing Progress">
Monitoring Online Buffer Pool Resizing Progress
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_resize_status_progress">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_resize_status_progress">
<code class="literal">
Innodb_buffer_pool_resize_status_progress
</code>
</a>
</p>
<a class="indexterm" name="idm46045262890448">
</a>
<a class="indexterm" name="idm46045262889344">
</a>
<p>
Reports a percentage value indicating the progress of the
current stage of an online buffer pool resizing operation.
This variable is used in conjunction with
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_resize_status_code">
<code class="literal">
Innodb_buffer_pool_resize_status_code
</code>
</a>
,
which reports a status code indicating the current stage of an
online buffer pool resizing operation.
</p>
<p>
The percentage value is updated after each buffer pool
instance is processed. As the status code (reported by
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_resize_status_code">
<code class="literal">
Innodb_buffer_pool_resize_status_code
</code>
</a>
)
changes from one status to another, the percentage value is
reset to 0.
</p>
<p>
For related information, see
<a class="xref" href="innodb-buffer-pool-resize.html#innodb-buffer-pool-online-resize-monitoring" title="Monitoring Online Buffer Pool Resizing Progress">
Monitoring Online Buffer Pool Resizing Progress
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_wait_free">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_wait_free">
<code class="literal">
Innodb_buffer_pool_wait_free
</code>
</a>
</p>
<a class="indexterm" name="idm46045262880256">
</a>
<a class="indexterm" name="idm46045262879152">
</a>
<p>
Normally, writes to the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
happen in
the background. When
<code class="literal">
InnoDB
</code>
needs to read
or create a
<a class="link" href="glossary.html#glos_page" title="page">
page
</a>
and no clean
pages are available,
<code class="literal">
InnoDB
</code>
flushes some
<a class="link" href="glossary.html#glos_dirty_page" title="dirty page">
dirty pages
</a>
first and
waits for that operation to finish. This counter counts
instances of these waits. If
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_size">
<code class="literal">
innodb_buffer_pool_size
</code>
</a>
has
been set properly, this value should be small.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_buffer_pool_write_requests">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_buffer_pool_write_requests">
<code class="literal">
Innodb_buffer_pool_write_requests
</code>
</a>
</p>
<a class="indexterm" name="idm46045262868464">
</a>
<a class="indexterm" name="idm46045262867424">
</a>
<p>
The number of writes done to the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer pool
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_data_fsyncs">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_data_fsyncs">
<code class="literal">
Innodb_data_fsyncs
</code>
</a>
</p>
<a class="indexterm" name="idm46045262861504">
</a>
<a class="indexterm" name="idm46045262860464">
</a>
<p>
The number of
<code class="literal">
fsync()
</code>
operations so far.
The frequency of
<code class="literal">
fsync()
</code>
calls is
influenced by the setting of the
<a class="link" href="innodb-parameters.html#sysvar_innodb_flush_method">
<code class="literal">
innodb_flush_method
</code>
</a>
configuration option.
</p>
<p>
Counts the number of
<code class="literal">
fdatasync()
</code>
operations
if
<a class="link" href="innodb-parameters.html#sysvar_innodb_use_fdatasync">
<code class="literal">
innodb_use_fdatasync
</code>
</a>
is
enabled.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_data_pending_fsyncs">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_data_pending_fsyncs">
<code class="literal">
Innodb_data_pending_fsyncs
</code>
</a>
</p>
<a class="indexterm" name="idm46045262850800">
</a>
<a class="indexterm" name="idm46045262849696">
</a>
<p>
The current number of pending
<code class="literal">
fsync()
</code>
operations. The frequency of
<code class="literal">
fsync()
</code>
calls
is influenced by the setting of the
<a class="link" href="innodb-parameters.html#sysvar_innodb_flush_method">
<code class="literal">
innodb_flush_method
</code>
</a>
configuration option.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_data_pending_reads">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_data_pending_reads">
<code class="literal">
Innodb_data_pending_reads
</code>
</a>
</p>
<a class="indexterm" name="idm46045262842448">
</a>
<a class="indexterm" name="idm46045262841344">
</a>
<p>
The current number of pending reads.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_data_pending_writes">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_data_pending_writes">
<code class="literal">
Innodb_data_pending_writes
</code>
</a>
</p>
<a class="indexterm" name="idm46045262836896">
</a>
<a class="indexterm" name="idm46045262835792">
</a>
<p>
The current number of pending writes.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_data_read">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_data_read">
<code class="literal">
Innodb_data_read
</code>
</a>
</p>
<a class="indexterm" name="idm46045262831312">
</a>
<a class="indexterm" name="idm46045262830272">
</a>
<p>
The amount of data read since the server was started (in
bytes).
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_data_reads">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_data_reads">
<code class="literal">
Innodb_data_reads
</code>
</a>
</p>
<a class="indexterm" name="idm46045262825776">
</a>
<a class="indexterm" name="idm46045262824736">
</a>
<p>
The total number of data reads (OS file reads).
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_data_writes">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_data_writes">
<code class="literal">
Innodb_data_writes
</code>
</a>
</p>
<a class="indexterm" name="idm46045262820336">
</a>
<a class="indexterm" name="idm46045262819296">
</a>
<p>
The total number of data writes.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_data_written">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_data_written">
<code class="literal">
Innodb_data_written
</code>
</a>
</p>
<a class="indexterm" name="idm46045262814912">
</a>
<a class="indexterm" name="idm46045262813872">
</a>
<p>
The amount of data written so far, in bytes.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_dblwr_pages_written">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_dblwr_pages_written">
<code class="literal">
Innodb_dblwr_pages_written
</code>
</a>
</p>
<a class="indexterm" name="idm46045262809440">
</a>
<a class="indexterm" name="idm46045262808336">
</a>
<a class="indexterm" name="idm46045262806832">
</a>
<p>
The number of
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
that have
been written to the
<a class="link" href="glossary.html#glos_doublewrite_buffer" title="doublewrite buffer">
doublewrite
buffer
</a>
. See
<a class="xref" href="innodb-disk-io.html" title="17.11.1 InnoDB Disk I/O">
Section 17.11.1, “InnoDB Disk I/O”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_dblwr_writes">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_dblwr_writes">
<code class="literal">
Innodb_dblwr_writes
</code>
</a>
</p>
<a class="indexterm" name="idm46045262800080">
</a>
<a class="indexterm" name="idm46045262799040">
</a>
<p>
The number of doublewrite operations that have been performed.
See
<a class="xref" href="innodb-disk-io.html" title="17.11.1 InnoDB Disk I/O">
Section 17.11.1, “InnoDB Disk I/O”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_have_atomic_builtins">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_have_atomic_builtins">
<code class="literal">
Innodb_have_atomic_builtins
</code>
</a>
</p>
<a class="indexterm" name="idm46045262793904">
</a>
<a class="indexterm" name="idm46045262792800">
</a>
<p>
Indicates whether the server was built with
<a class="link" href="glossary.html#glos_atomic_instruction" title="atomic instruction">
atomic
instructions
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_log_waits">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_log_waits">
<code class="literal">
Innodb_log_waits
</code>
</a>
</p>
<a class="indexterm" name="idm46045262787296">
</a>
<a class="indexterm" name="idm46045262786256">
</a>
<p>
The number of times that the
<a class="link" href="glossary.html#glos_log_buffer" title="log buffer">
log buffer
</a>
was too
small and a
<a class="link" href="glossary.html#glos_wait" title="wait">
wait
</a>
was required
for it to be
<a class="link" href="glossary.html#glos_flush" title="flush">
flushed
</a>
before
continuing.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_log_write_requests">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_log_write_requests">
<code class="literal">
Innodb_log_write_requests
</code>
</a>
</p>
<a class="indexterm" name="idm46045262778944">
</a>
<a class="indexterm" name="idm46045262777840">
</a>
<p>
The number of write requests for the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_redo_log" title="redo log">
redo log
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_log_writes">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_log_writes">
<code class="literal">
Innodb_log_writes
</code>
</a>
</p>
<a class="indexterm" name="idm46045262771680">
</a>
<a class="indexterm" name="idm46045262770640">
</a>
<p>
The number of physical writes to the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_redo_log" title="redo log">
redo log
</a>
file.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_num_open_files">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_num_open_files">
<code class="literal">
Innodb_num_open_files
</code>
</a>
</p>
<a class="indexterm" name="idm46045262764672">
</a>
<a class="indexterm" name="idm46045262763632">
</a>
<p>
The number of files
<code class="literal">
InnoDB
</code>
currently holds
open.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_os_log_fsyncs">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_os_log_fsyncs">
<code class="literal">
Innodb_os_log_fsyncs
</code>
</a>
</p>
<a class="indexterm" name="idm46045262758448">
</a>
<a class="indexterm" name="idm46045262757408">
</a>
<p>
The number of
<code class="literal">
fsync()
</code>
writes done to the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_redo_log" title="redo log">
redo
log
</a>
files.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_os_log_pending_fsyncs">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_os_log_pending_fsyncs">
<code class="literal">
Innodb_os_log_pending_fsyncs
</code>
</a>
</p>
<a class="indexterm" name="idm46045262750816">
</a>
<a class="indexterm" name="idm46045262749712">
</a>
<p>
The number of pending
<code class="literal">
fsync()
</code>
operations
for the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_redo_log" title="redo log">
redo log
</a>
files.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_os_log_pending_writes">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_os_log_pending_writes">
<code class="literal">
Innodb_os_log_pending_writes
</code>
</a>
</p>
<a class="indexterm" name="idm46045262743040">
</a>
<a class="indexterm" name="idm46045262741936">
</a>
<p>
The number of pending writes to the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_redo_log" title="redo log">
redo log
</a>
files.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_os_log_written">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_os_log_written">
<code class="literal">
Innodb_os_log_written
</code>
</a>
</p>
<a class="indexterm" name="idm46045262735952">
</a>
<a class="indexterm" name="idm46045262734912">
</a>
<p>
The number of bytes written to the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_redo_log" title="redo log">
redo log
</a>
files.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_page_size">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_page_size">
<code class="literal">
Innodb_page_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045262728944">
</a>
<a class="indexterm" name="idm46045262727904">
</a>
<p>
<code class="literal">
InnoDB
</code>
page size (default 16KB). Many
values are counted in pages; the page size enables them to be
easily converted to bytes.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_pages_created">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_pages_created">
<code class="literal">
Innodb_pages_created
</code>
</a>
</p>
<a class="indexterm" name="idm46045262722672">
</a>
<a class="indexterm" name="idm46045262721632">
</a>
<p>
The number of pages created by operations on
<code class="literal">
InnoDB
</code>
tables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_pages_read">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_pages_read">
<code class="literal">
Innodb_pages_read
</code>
</a>
</p>
<a class="indexterm" name="idm46045262716448">
</a>
<a class="indexterm" name="idm46045262715408">
</a>
<p>
The number of pages read from the
<code class="literal">
InnoDB
</code>
buffer pool by operations on
<code class="literal">
InnoDB
</code>
tables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_pages_written">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_pages_written">
<code class="literal">
Innodb_pages_written
</code>
</a>
</p>
<a class="indexterm" name="idm46045262709488">
</a>
<a class="indexterm" name="idm46045262708448">
</a>
<p>
The number of pages written by operations on
<code class="literal">
InnoDB
</code>
tables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_redo_log_enabled">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_enabled">
<code class="literal">
Innodb_redo_log_enabled
</code>
</a>
</p>
<a class="indexterm" name="idm46045262703264">
</a>
<a class="indexterm" name="idm46045262702224">
</a>
<p>
Whether redo logging is enabled or disabled. See
<a class="xref" href="innodb-redo-log.html#innodb-disable-redo-logging" title="Disabling Redo Logging">
Disabling Redo Logging
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_redo_log_capacity_resized">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_capacity_resized">
<code class="literal">
Innodb_redo_log_capacity_resized
</code>
</a>
</p>
<a class="indexterm" name="idm46045262696848">
</a>
<a class="indexterm" name="idm46045262695808">
</a>
<p>
The total redo log capacity for all redo log files, in bytes,
after the last completed capacity resize operation. The value
includes ordinary and spare redo log files.
</p>
<p>
If there is no pending resize down operation,
<a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_capacity_resized">
<code class="literal">
Innodb_redo_log_capacity_resized
</code>
</a>
should be equal to the
<a class="link" href="innodb-parameters.html#sysvar_innodb_redo_log_capacity">
<code class="literal">
innodb_redo_log_capacity
</code>
</a>
setting if it's used, or it's
(
<span class="emphasis">
<em>
(innodb_log_files_in_group *
innodb_log_file_size)
</em>
</span>
) if those are used instead.
See the
<a class="link" href="innodb-parameters.html#sysvar_innodb_redo_log_capacity">
<code class="literal">
innodb_redo_log_capacity
</code>
</a>
documentation for further clarification. Resize up operations
are instantaneous.
</p>
<p>
For related information, see
<a class="xref" href="innodb-redo-log.html" title="17.6.5 Redo Log">
Section 17.6.5, “Redo Log”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_redo_log_checkpoint_lsn">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_checkpoint_lsn">
<code class="literal">
Innodb_redo_log_checkpoint_lsn
</code>
</a>
</p>
<a class="indexterm" name="idm46045262684880">
</a>
<a class="indexterm" name="idm46045262683776">
</a>
<p>
The redo log checkpoint LSN. For related information, see
<a class="xref" href="innodb-redo-log.html" title="17.6.5 Redo Log">
Section 17.6.5, “Redo Log”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_redo_log_current_lsn">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_current_lsn">
<code class="literal">
Innodb_redo_log_current_lsn
</code>
</a>
</p>
<a class="indexterm" name="idm46045262678704">
</a>
<a class="indexterm" name="idm46045262677600">
</a>
<p>
The current LSN represents the last written position in the
redo log buffer.
<code class="literal">
InnoDB
</code>
writes data to the
redo log buffer inside the MySQL process before requesting
that the operating system write the data to the current redo
log file. For related information, see
<a class="xref" href="innodb-redo-log.html" title="17.6.5 Redo Log">
Section 17.6.5, “Redo Log”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_redo_log_flushed_to_disk_lsn">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_flushed_to_disk_lsn">
<code class="literal">
Innodb_redo_log_flushed_to_disk_lsn
</code>
</a>
</p>
<a class="indexterm" name="idm46045262671456">
</a>
<a class="indexterm" name="idm46045262670416">
</a>
<p>
The flushed-to-disk LSN.
<code class="literal">
InnoDB
</code>
first
writes data to the redo log and then requests that the
operating system flush the data to disk. The flushed-to-disk
LSN represents the last position in the redo log that
<code class="literal">
InnoDB
</code>
knows has been flushed to disk. For
related information, see
<a class="xref" href="innodb-redo-log.html" title="17.6.5 Redo Log">
Section 17.6.5, “Redo Log”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_redo_log_logical_size">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_logical_size">
<code class="literal">
Innodb_redo_log_logical_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045262663616">
</a>
<a class="indexterm" name="idm46045262662512">
</a>
<p>
A data size value, in bytes, representing the LSN range
containing in-use redo log data, spanning from the oldest
block required by redo log consumers to the latest written
block. For related information, see
<a class="xref" href="innodb-redo-log.html" title="17.6.5 Redo Log">
Section 17.6.5, “Redo Log”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_redo_log_physical_size">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_physical_size">
<code class="literal">
Innodb_redo_log_physical_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045262657200">
</a>
<a class="indexterm" name="idm46045262656096">
</a>
<p>
The amount of disk space in bytes currently consumed by all
redo log files on disk, excluding spare redo log files. For
related information, see
<a class="xref" href="innodb-redo-log.html" title="17.6.5 Redo Log">
Section 17.6.5, “Redo Log”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_redo_log_read_only">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_read_only">
<code class="literal">
Innodb_redo_log_read_only
</code>
</a>
</p>
<a class="indexterm" name="idm46045262650864">
</a>
<a class="indexterm" name="idm46045262649760">
</a>
<p>
Whether the redo log is read-only.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_redo_log_resize_status">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_resize_status">
<code class="literal">
Innodb_redo_log_resize_status
</code>
</a>
</p>
<a class="indexterm" name="idm46045262645328">
</a>
<a class="indexterm" name="idm46045262644224">
</a>
<p>
The redo log resize status indicating the current state of the
redo log capacity resize mechanism. Possible values include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
OK
</code>
: There are no issues and no pending
redo log capacity resize operations.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
Resizing down
</code>
: A resize down operation
is in progress.
</p>
</li>
</ul>
</div>
<p>
A resize up operation is instantaneous and therefore has no
pending status.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_redo_log_uuid">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_redo_log_uuid">
<code class="literal">
Innodb_redo_log_uuid
</code>
</a>
</p>
<a class="indexterm" name="idm46045262635744">
</a>
<a class="indexterm" name="idm46045262634704">
</a>
<p>
The redo log UUID.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_row_lock_current_waits">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_row_lock_current_waits">
<code class="literal">
Innodb_row_lock_current_waits
</code>
</a>
</p>
<a class="indexterm" name="idm46045262630304">
</a>
<a class="indexterm" name="idm46045262629200">
</a>
<p>
The number of
<a class="link" href="glossary.html#glos_row_lock" title="row lock">
row locks
</a>
currently waited for by operations on
<code class="literal">
InnoDB
</code>
tables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_row_lock_time">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_row_lock_time">
<code class="literal">
Innodb_row_lock_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045262623152">
</a>
<a class="indexterm" name="idm46045262622112">
</a>
<p>
The total time spent in acquiring
<a class="link" href="glossary.html#glos_row_lock" title="row lock">
row locks
</a>
for
<code class="literal">
InnoDB
</code>
tables, in milliseconds.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_row_lock_time_avg">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_row_lock_time_avg">
<code class="literal">
Innodb_row_lock_time_avg
</code>
</a>
</p>
<a class="indexterm" name="idm46045262616128">
</a>
<a class="indexterm" name="idm46045262615024">
</a>
<p>
The average time to acquire a
<a class="link" href="glossary.html#glos_row_lock" title="row lock">
row lock
</a>
for
<code class="literal">
InnoDB
</code>
tables, in milliseconds.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_row_lock_time_max">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_row_lock_time_max">
<code class="literal">
Innodb_row_lock_time_max
</code>
</a>
</p>
<a class="indexterm" name="idm46045262609024">
</a>
<a class="indexterm" name="idm46045262607920">
</a>
<p>
The maximum time to acquire a
<a class="link" href="glossary.html#glos_row_lock" title="row lock">
row lock
</a>
for
<code class="literal">
InnoDB
</code>
tables, in milliseconds.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_row_lock_waits">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_row_lock_waits">
<code class="literal">
Innodb_row_lock_waits
</code>
</a>
</p>
<a class="indexterm" name="idm46045262601952">
</a>
<a class="indexterm" name="idm46045262600912">
</a>
<p>
The number of times operations on
<code class="literal">
InnoDB
</code>
tables had to wait for a
<a class="link" href="glossary.html#glos_row_lock" title="row lock">
row
lock
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_rows_deleted">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_rows_deleted">
<code class="literal">
Innodb_rows_deleted
</code>
</a>
</p>
<a class="indexterm" name="idm46045262594896">
</a>
<a class="indexterm" name="idm46045262593856">
</a>
<p>
The number of rows deleted from
<code class="literal">
InnoDB
</code>
tables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_rows_inserted">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_rows_inserted">
<code class="literal">
Innodb_rows_inserted
</code>
</a>
</p>
<a class="indexterm" name="idm46045262588672">
</a>
<a class="indexterm" name="idm46045262587632">
</a>
<p>
The number of rows inserted into
<code class="literal">
InnoDB
</code>
tables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_rows_read">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_rows_read">
<code class="literal">
Innodb_rows_read
</code>
</a>
</p>
<a class="indexterm" name="idm46045262582448">
</a>
<a class="indexterm" name="idm46045262581408">
</a>
<p>
The number of rows read from
<code class="literal">
InnoDB
</code>
tables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_rows_updated">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_rows_updated">
<code class="literal">
Innodb_rows_updated
</code>
</a>
</p>
<a class="indexterm" name="idm46045262576240">
</a>
<a class="indexterm" name="idm46045262575200">
</a>
<p>
The estimated number of rows updated in
<code class="literal">
InnoDB
</code>
tables.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
This value is not meant to be 100% accurate. For an accurate
(but more expensive) result, use
<a class="link" href="information-functions.html#function_row-count">
<code class="literal">
ROW_COUNT()
</code>
</a>
.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_system_rows_deleted">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_system_rows_deleted">
<code class="literal">
Innodb_system_rows_deleted
</code>
</a>
</p>
<a class="indexterm" name="idm46045262567792">
</a>
<a class="indexterm" name="idm46045262566688">
</a>
<p>
The number of rows deleted from
<code class="literal">
InnoDB
</code>
tables belonging to system-created schemas.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_system_rows_inserted">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_system_rows_inserted">
<code class="literal">
Innodb_system_rows_inserted
</code>
</a>
</p>
<a class="indexterm" name="idm46045262561552">
</a>
<a class="indexterm" name="idm46045262560448">
</a>
<p>
The number of rows inserted into
<code class="literal">
InnoDB
</code>
tables belonging to system-created schemas.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_system_rows_updated">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_system_rows_updated">
<code class="literal">
Innodb_system_rows_updated
</code>
</a>
</p>
<a class="indexterm" name="idm46045262555248">
</a>
<a class="indexterm" name="idm46045262554144">
</a>
<p>
The number of rows updated in
<code class="literal">
InnoDB
</code>
tables
belonging to system-created schemas.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_system_rows_read">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_system_rows_read">
<code class="literal">
Innodb_system_rows_read
</code>
</a>
</p>
<a class="indexterm" name="idm46045262548976">
</a>
<a class="indexterm" name="idm46045262547936">
</a>
<p>
The number of rows read from
<code class="literal">
InnoDB
</code>
tables
belonging to system-created schemas.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_truncated_status_writes">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_truncated_status_writes">
<code class="literal">
Innodb_truncated_status_writes
</code>
</a>
</p>
<a class="indexterm" name="idm46045262542752">
</a>
<a class="indexterm" name="idm46045262541648">
</a>
<p>
The number of times output from the
<code class="literal">
SHOW ENGINE
INNODB STATUS
</code>
statement has been truncated.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_undo_tablespaces_active">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_undo_tablespaces_active">
<code class="literal">
Innodb_undo_tablespaces_active
</code>
</a>
</p>
<a class="indexterm" name="idm46045262536464">
</a>
<a class="indexterm" name="idm46045262535360">
</a>
<p>
The number of active undo tablespaces. Includes both implicit
(
<code class="literal">
InnoDB
</code>
-created) and explicit
(user-created) undo tablespaces. For information about undo
tablespaces, see
<a class="xref" href="innodb-undo-tablespaces.html" title="17.6.3.4 Undo Tablespaces">
Section 17.6.3.4, “Undo Tablespaces”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_undo_tablespaces_explicit">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_undo_tablespaces_explicit">
<code class="literal">
Innodb_undo_tablespaces_explicit
</code>
</a>
</p>
<a class="indexterm" name="idm46045262529152">
</a>
<a class="indexterm" name="idm46045262528112">
</a>
<p>
The number of user-created undo tablespaces. For information
about undo tablespaces, see
<a class="xref" href="innodb-undo-tablespaces.html" title="17.6.3.4 Undo Tablespaces">
Section 17.6.3.4, “Undo Tablespaces”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_undo_tablespaces_implicit">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_undo_tablespaces_implicit">
<code class="literal">
Innodb_undo_tablespaces_implicit
</code>
</a>
</p>
<a class="indexterm" name="idm46045262522800">
</a>
<a class="indexterm" name="idm46045262521760">
</a>
<p>
The number of undo tablespaces created by
<code class="literal">
InnoDB
</code>
. Two default undo tablespaces are
created by
<code class="literal">
InnoDB
</code>
when the MySQL instance
is initialized. For information about undo tablespaces, see
<a class="xref" href="innodb-undo-tablespaces.html" title="17.6.3.4 Undo Tablespaces">
Section 17.6.3.4, “Undo Tablespaces”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Innodb_undo_tablespaces_total">
</a>
<a class="link" href="server-status-variables.html#statvar_Innodb_undo_tablespaces_total">
<code class="literal">
Innodb_undo_tablespaces_total
</code>
</a>
</p>
<a class="indexterm" name="idm46045262515120">
</a>
<a class="indexterm" name="idm46045262514016">
</a>
<p>
The total number of undo tablespaces. Includes both implicit
(
<code class="literal">
InnoDB
</code>
-created) and explicit
(user-created) undo tablespaces, active and inactive. For
information about undo tablespaces, see
<a class="xref" href="innodb-undo-tablespaces.html" title="17.6.3.4 Undo Tablespaces">
Section 17.6.3.4, “Undo Tablespaces”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Key_blocks_not_flushed">
</a>
<a class="link" href="server-status-variables.html#statvar_Key_blocks_not_flushed">
<code class="literal">
Key_blocks_not_flushed
</code>
</a>
</p>
<a class="indexterm" name="idm46045262508064">
</a>
<a class="indexterm" name="idm46045262507024">
</a>
<p>
The number of key blocks in the
<code class="literal">
MyISAM
</code>
key
cache that have changed but have not yet been flushed to disk.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Key_blocks_unused">
</a>
<a class="link" href="server-status-variables.html#statvar_Key_blocks_unused">
<code class="literal">
Key_blocks_unused
</code>
</a>
</p>
<a class="indexterm" name="idm46045262501792">
</a>
<a class="indexterm" name="idm46045262500752">
</a>
<p>
The number of unused blocks in the
<code class="literal">
MyISAM
</code>
key cache. You can use this value to determine how much of the
key cache is in use; see the discussion of
<a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
<code class="literal">
key_buffer_size
</code>
</a>
in
<a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
Section 7.1.8, “Server System Variables”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Key_blocks_used">
</a>
<a class="link" href="server-status-variables.html#statvar_Key_blocks_used">
<code class="literal">
Key_blocks_used
</code>
</a>
</p>
<a class="indexterm" name="idm46045262493664">
</a>
<a class="indexterm" name="idm46045262492576">
</a>
<p>
The number of used blocks in the
<code class="literal">
MyISAM
</code>
key
cache. This value is a high-water mark that indicates the
maximum number of blocks that have ever been in use at one
time.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Key_read_requests">
</a>
<a class="link" href="server-status-variables.html#statvar_Key_read_requests">
<code class="literal">
Key_read_requests
</code>
</a>
</p>
<a class="indexterm" name="idm46045262487264">
</a>
<a class="indexterm" name="idm46045262486224">
</a>
<p>
The number of requests to read a key block from the
<code class="literal">
MyISAM
</code>
key cache.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Key_reads">
</a>
<a class="link" href="server-status-variables.html#statvar_Key_reads">
<code class="literal">
Key_reads
</code>
</a>
</p>
<a class="indexterm" name="idm46045262481200">
</a>
<a class="indexterm" name="idm46045262480112">
</a>
<p>
The number of physical reads of a key block from disk into the
<code class="literal">
MyISAM
</code>
key cache. If
<a class="link" href="server-status-variables.html#statvar_Key_reads">
<code class="literal">
Key_reads
</code>
</a>
is large, then
your
<a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
<code class="literal">
key_buffer_size
</code>
</a>
value is
probably too small. The cache miss rate can be calculated as
<a class="link" href="server-status-variables.html#statvar_Key_reads">
<code class="literal">
Key_reads
</code>
</a>
/
<a class="link" href="server-status-variables.html#statvar_Key_read_requests">
<code class="literal">
Key_read_requests
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Key_write_requests">
</a>
<a class="link" href="server-status-variables.html#statvar_Key_write_requests">
<code class="literal">
Key_write_requests
</code>
</a>
</p>
<a class="indexterm" name="idm46045262469936">
</a>
<a class="indexterm" name="idm46045262468896">
</a>
<p>
The number of requests to write a key block to the
<code class="literal">
MyISAM
</code>
key cache.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Key_writes">
</a>
<a class="link" href="server-status-variables.html#statvar_Key_writes">
<code class="literal">
Key_writes
</code>
</a>
</p>
<a class="indexterm" name="idm46045262463808">
</a>
<a class="indexterm" name="idm46045262462720">
</a>
<p>
The number of physical writes of a key block from the
<code class="literal">
MyISAM
</code>
key cache to disk.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Last_query_cost">
</a>
<a class="link" href="server-status-variables.html#statvar_Last_query_cost">
<code class="literal">
Last_query_cost
</code>
</a>
</p>
<a class="indexterm" name="idm46045262457680">
</a>
<a class="indexterm" name="idm46045262456592">
</a>
<p>
The total cost of the last compiled query as computed by the
query optimizer. This is useful for comparing the cost of
different query plans for the same query. The default value of
0 means that no query has been compiled yet. The default value
is 0.
<a class="link" href="server-status-variables.html#statvar_Last_query_cost">
<code class="literal">
Last_query_cost
</code>
</a>
has
session scope.
</p>
<p>
This variable shows the cost of queries that have multiple
query blocks, summing the cost estimates of each query block,
estimating how many times non-cacheable subqueries are
executed, and multiplying the cost of those query blocks by
the number of subquery executions.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Last_query_partial_plans">
</a>
<a class="link" href="server-status-variables.html#statvar_Last_query_partial_plans">
<code class="literal">
Last_query_partial_plans
</code>
</a>
</p>
<a class="indexterm" name="idm46045262450000">
</a>
<a class="indexterm" name="idm46045262448896">
</a>
<p>
The number of iterations the query optimizer made in execution
plan construction for the previous query.
</p>
<p>
<code class="literal">
Last_query_partial_plans
</code>
has session scope.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Locked_connects">
</a>
<a class="link" href="server-status-variables.html#statvar_Locked_connects">
<code class="literal">
Locked_connects
</code>
</a>
</p>
<a class="indexterm" name="idm46045262443328">
</a>
<a class="indexterm" name="idm46045262442240">
</a>
<a class="indexterm" name="idm46045262440752">
</a>
<p>
The number of attempts to connect to locked user accounts. For
information about account locking and unlocking, see
<a class="xref" href="account-locking.html" title="8.2.20 Account Locking">
Section 8.2.20, “Account Locking”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Max_execution_time_exceeded">
</a>
<a class="link" href="server-status-variables.html#statvar_Max_execution_time_exceeded">
<code class="literal">
Max_execution_time_exceeded
</code>
</a>
</p>
<a class="indexterm" name="idm46045262435376">
</a>
<a class="indexterm" name="idm46045262434272">
</a>
<p>
The number of
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements
for which the execution timeout was exceeded.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Max_execution_time_set">
</a>
<a class="link" href="server-status-variables.html#statvar_Max_execution_time_set">
<code class="literal">
Max_execution_time_set
</code>
</a>
</p>
<a class="indexterm" name="idm46045262428528">
</a>
<a class="indexterm" name="idm46045262427488">
</a>
<p>
The number of
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements
for which a nonzero execution timeout was set. This includes
statements that include a nonzero
<a class="link" href="optimizer-hints.html#optimizer-hints-execution-time" title="Statement Execution Time Optimizer Hints">
<code class="literal">
MAX_EXECUTION_TIME
</code>
</a>
optimizer
hint, and statements that include no such hint but execute
while the timeout indicated by the
<a class="link" href="server-system-variables.html#sysvar_max_execution_time">
<code class="literal">
max_execution_time
</code>
</a>
system
variable is nonzero.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Max_execution_time_set_failed">
</a>
<a class="link" href="server-status-variables.html#statvar_Max_execution_time_set_failed">
<code class="literal">
Max_execution_time_set_failed
</code>
</a>
</p>
<a class="indexterm" name="idm46045262419056">
</a>
<a class="indexterm" name="idm46045262417952">
</a>
<p>
The number of
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements
for which the attempt to set an execution timeout failed.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Max_used_connections">
</a>
<a class="link" href="server-status-variables.html#statvar_Max_used_connections">
<code class="literal">
Max_used_connections
</code>
</a>
</p>
<a class="indexterm" name="idm46045262412192">
</a>
<a class="indexterm" name="idm46045262411152">
</a>
<p>
The maximum number of connections that have been in use
simultaneously since the server started.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Max_used_connections_time">
</a>
<a class="link" href="server-status-variables.html#statvar_Max_used_connections_time">
<code class="literal">
Max_used_connections_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045262406720">
</a>
<a class="indexterm" name="idm46045262405616">
</a>
<p>
The time at which
<a class="link" href="server-status-variables.html#statvar_Max_used_connections">
<code class="literal">
Max_used_connections
</code>
</a>
reached
its current value.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Not_flushed_delayed_rows">
</a>
<a class="link" href="server-status-variables.html#statvar_Not_flushed_delayed_rows">
<code class="literal">
Not_flushed_delayed_rows
</code>
</a>
</p>
<a class="indexterm" name="idm46045262399904">
</a>
<a class="indexterm" name="idm46045262398800">
</a>
<p>
This status variable is deprecated (because
<code class="literal">
DELAYED
</code>
inserts are not supported); expect
it to be removed in a future release.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_mecab_charset">
</a>
<a class="link" href="server-status-variables.html#statvar_mecab_charset">
<code class="literal">
mecab_charset
</code>
</a>
</p>
<a class="indexterm" name="idm46045262393632">
</a>
<a class="indexterm" name="idm46045262392544">
</a>
<p>
The character set currently used by the MeCab full-text parser
plugin. For related information, see
<a class="xref" href="fulltext-search-mecab.html" title="14.9.9 MeCab Full-Text Parser Plugin">
Section 14.9.9, “MeCab Full-Text Parser Plugin”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ongoing_anonymous_transaction_count">
</a>
<a class="link" href="server-status-variables.html#statvar_Ongoing_anonymous_transaction_count">
<code class="literal">
Ongoing_anonymous_transaction_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045262387312">
</a>
<a class="indexterm" name="idm46045262386272">
</a>
<p>
Shows the number of ongoing transactions which have been
marked as anonymous. This can be used to ensure that no
further transactions are waiting to be processed.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ongoing_anonymous_gtid_violating_transaction_count">
</a>
<a class="link" href="server-status-variables.html#statvar_Ongoing_anonymous_gtid_violating_transaction_count">
<code class="literal">
Ongoing_anonymous_gtid_violating_transaction_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045262381520">
</a>
<a class="indexterm" name="idm46045262380480">
</a>
<p>
This status variable is only available in debug builds. Shows
the number of ongoing transactions which use
<a class="link" href="replication-options-gtids.html#sysvar_gtid_next">
<code class="literal">
gtid_next=ANONYMOUS
</code>
</a>
and that
violate GTID consistency.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ongoing_automatic_gtid_violating_transaction_count">
</a>
<a class="link" href="server-status-variables.html#statvar_Ongoing_automatic_gtid_violating_transaction_count">
<code class="literal">
Ongoing_automatic_gtid_violating_transaction_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045262374512">
</a>
<a class="indexterm" name="idm46045262373472">
</a>
<p>
This status variable is only available in debug builds. Shows
the number of ongoing transactions which use
<a class="link" href="replication-options-gtids.html#sysvar_gtid_next">
<code class="literal">
gtid_next=AUTOMATIC
</code>
</a>
and that
violate GTID consistency.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Open_files">
</a>
<a class="link" href="server-status-variables.html#statvar_Open_files">
<code class="literal">
Open_files
</code>
</a>
</p>
<a class="indexterm" name="idm46045262367744">
</a>
<a class="indexterm" name="idm46045262366656">
</a>
<p>
The number of files that are open. This count includes regular
files opened by the server. It does not include other types of
files such as sockets or pipes. Also, the count does not
include files that storage engines open using their own
internal functions rather than asking the server level to do
so.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Open_streams">
</a>
<a class="link" href="server-status-variables.html#statvar_Open_streams">
<code class="literal">
Open_streams
</code>
</a>
</p>
<a class="indexterm" name="idm46045262362000">
</a>
<a class="indexterm" name="idm46045262360912">
</a>
<p>
The number of streams that are open (used mainly for logging).
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Open_table_definitions">
</a>
<a class="link" href="server-status-variables.html#statvar_Open_table_definitions">
<code class="literal">
Open_table_definitions
</code>
</a>
</p>
<a class="indexterm" name="idm46045262356432">
</a>
<a class="indexterm" name="idm46045262355392">
</a>
<p>
The number of cached table definitions.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Open_tables">
</a>
<a class="link" href="server-status-variables.html#statvar_Open_tables">
<code class="literal">
Open_tables
</code>
</a>
</p>
<a class="indexterm" name="idm46045262351040">
</a>
<a class="indexterm" name="idm46045262349952">
</a>
<p>
The number of tables that are open.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Opened_files">
</a>
<a class="link" href="server-status-variables.html#statvar_Opened_files">
<code class="literal">
Opened_files
</code>
</a>
</p>
<a class="indexterm" name="idm46045262345616">
</a>
<a class="indexterm" name="idm46045262344528">
</a>
<p>
The number of files that have been opened with
<code class="function">
my_open()
</code>
(a
<code class="literal">
mysys
</code>
library function). Parts of the server that open files without
using this function do not increment the count.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Opened_table_definitions">
</a>
<a class="link" href="server-status-variables.html#statvar_Opened_table_definitions">
<code class="literal">
Opened_table_definitions
</code>
</a>
</p>
<a class="indexterm" name="idm46045262338528">
</a>
<a class="indexterm" name="idm46045262337424">
</a>
<p>
The number of table definitions that have been cached.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Opened_tables">
</a>
<a class="link" href="server-status-variables.html#statvar_Opened_tables">
<code class="literal">
Opened_tables
</code>
</a>
</p>
<a class="indexterm" name="idm46045262333040">
</a>
<a class="indexterm" name="idm46045262331952">
</a>
<p>
The number of tables that have been opened. If
<a class="link" href="server-status-variables.html#statvar_Opened_tables">
<code class="literal">
Opened_tables
</code>
</a>
is big, your
<a class="link" href="server-system-variables.html#sysvar_table_open_cache">
<code class="literal">
table_open_cache
</code>
</a>
value is
probably too small.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
Performance_schema_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
</p>
<p>
Performance Schema status variables are listed in
<a class="xref" href="performance-schema-status-variables.html" title="29.16 Performance Schema Status Variables">
Section 29.16, “Performance Schema Status Variables”
</a>
. These
variables provide information about instrumentation that could
not be loaded or created due to memory constraints.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Prepared_stmt_count">
</a>
<a class="link" href="server-status-variables.html#statvar_Prepared_stmt_count">
<code class="literal">
Prepared_stmt_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045262321968">
</a>
<a class="indexterm" name="idm46045262320928">
</a>
<p>
The current number of prepared statements. (The maximum number
of statements is given by the
<a class="link" href="server-system-variables.html#sysvar_max_prepared_stmt_count">
<code class="literal">
max_prepared_stmt_count
</code>
</a>
system variable.)
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Queries">
</a>
<a class="link" href="server-status-variables.html#statvar_Queries">
<code class="literal">
Queries
</code>
</a>
</p>
<a class="indexterm" name="idm46045262315232">
</a>
<a class="indexterm" name="idm46045262314160">
</a>
<p>
The number of statements executed by the server. This variable
includes statements executed within stored programs, unlike
the
<a class="link" href="server-status-variables.html#statvar_Questions">
<code class="literal">
Questions
</code>
</a>
variable. It
does not count
<code class="literal">
COM_PING
</code>
or
<code class="literal">
COM_STATISTICS
</code>
commands.
</p>
<p>
The discussion at the beginning of this section indicates how
to relate this statement-counting status variable to other
such variables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Questions">
</a>
<a class="link" href="server-status-variables.html#statvar_Questions">
<code class="literal">
Questions
</code>
</a>
</p>
<a class="indexterm" name="idm46045262306448">
</a>
<a class="indexterm" name="idm46045262305360">
</a>
<p>
The number of statements executed by the server. This includes
only statements sent to the server by clients and not
statements executed within stored programs, unlike the
<a class="link" href="server-status-variables.html#statvar_Queries">
<code class="literal">
Queries
</code>
</a>
variable. This
variable does not count
<code class="literal">
COM_PING
</code>
,
<code class="literal">
COM_STATISTICS
</code>
,
<code class="literal">
COM_STMT_PREPARE
</code>
,
<code class="literal">
COM_STMT_CLOSE
</code>
, or
<code class="literal">
COM_STMT_RESET
</code>
commands.
</p>
<p>
The discussion at the beginning of this section indicates how
to relate this statement-counting status variable to other
such variables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Replica_open_temp_tables">
</a>
<a class="link" href="server-status-variables.html#statvar_Replica_open_temp_tables">
<code class="literal">
Replica_open_temp_tables
</code>
</a>
</p>
<a class="indexterm" name="idm46045262295344">
</a>
<a class="indexterm" name="idm46045262294240">
</a>
<p>
<a class="link" href="server-status-variables.html#statvar_Replica_open_temp_tables">
<code class="literal">
Replica_open_temp_tables
</code>
</a>
shows the number of temporary tables that the replication SQL
thread currently has open. If the value is greater than zero,
it is not safe to shut down the replica; see
<a class="xref" href="replication-features-temptables.html" title="19.5.1.31 Replication and Temporary Tables">
Section 19.5.1.31, “Replication and Temporary Tables”
</a>
. This
variable reports the total count of open temporary tables for
<span class="emphasis">
<em>
all
</em>
</span>
replication channels.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Resource_group_supported">
</a>
<a class="link" href="server-status-variables.html#statvar_Resource_group_supported">
<code class="literal">
Resource_group_supported
</code>
</a>
</p>
<a class="indexterm" name="idm46045262287008">
</a>
<a class="indexterm" name="idm46045262285904">
</a>
<p>
Indicates whether the resource group feature is supported.
</p>
<p>
On some platforms or MySQL server configurations, resource
groups are unavailable or have limitations. In particular,
Linux systems might require a manual step for some
installation methods. For details, see
<a class="xref" href="resource-groups.html#resource-group-restrictions" title="Resource Group Restrictions">
Resource Group Restrictions
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_clients">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_clients">
<code class="literal">
Rpl_semi_sync_master_clients
</code>
</a>
</p>
<a class="indexterm" name="idm46045262279968">
</a>
<a class="indexterm" name="idm46045262278864">
</a>
<p>
The number of semisynchronous replicas.
</p>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_clients">
<code class="literal">
Rpl_semi_sync_source_clients
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_net_avg_wait_time">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_net_avg_wait_time">
<code class="literal">
Rpl_semi_sync_master_net_avg_wait_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045262272560">
</a>
<a class="indexterm" name="idm46045262271520">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_net_avg_wait_time">
<code class="literal">
Rpl_semi_sync_source_net_avg_wait_time
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_net_wait_time">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_net_wait_time">
<code class="literal">
Rpl_semi_sync_master_net_wait_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045262265712">
</a>
<a class="indexterm" name="idm46045262264672">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_net_wait_time">
<code class="literal">
Rpl_semi_sync_source_net_wait_time
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_net_waits">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_net_waits">
<code class="literal">
Rpl_semi_sync_master_net_waits
</code>
</a>
</p>
<a class="indexterm" name="idm46045262258928">
</a>
<a class="indexterm" name="idm46045262257824">
</a>
<p>
The total number of times the source waited for replica
replies.
</p>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_net_waits">
<code class="literal">
Rpl_semi_sync_source_net_waits
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_no_times">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_no_times">
<code class="literal">
Rpl_semi_sync_master_no_times
</code>
</a>
</p>
<a class="indexterm" name="idm46045262251616">
</a>
<a class="indexterm" name="idm46045262250512">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_no_times">
<code class="literal">
Rpl_semi_sync_source_no_times
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_no_tx">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_no_tx">
<code class="literal">
Rpl_semi_sync_master_no_tx
</code>
</a>
</p>
<a class="indexterm" name="idm46045262244800">
</a>
<a class="indexterm" name="idm46045262243696">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_no_tx">
<code class="literal">
Rpl_semi_sync_source_no_tx
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_status">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_status">
<code class="literal">
Rpl_semi_sync_master_status
</code>
</a>
</p>
<a class="indexterm" name="idm46045262238048">
</a>
<a class="indexterm" name="idm46045262236944">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_status">
<code class="literal">
Rpl_semi_sync_source_status
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_timefunc_failures">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_timefunc_failures">
<code class="literal">
Rpl_semi_sync_master_timefunc_failures
</code>
</a>
</p>
<a class="indexterm" name="idm46045262231168">
</a>
<a class="indexterm" name="idm46045262230128">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_timefunc_failures">
<code class="literal">
Rpl_semi_sync_source_timefunc_failures
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_tx_avg_wait_time">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_tx_avg_wait_time">
<code class="literal">
Rpl_semi_sync_master_tx_avg_wait_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045262224256">
</a>
<a class="indexterm" name="idm46045262223216">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_tx_avg_wait_time">
<code class="literal">
Rpl_semi_sync_source_tx_avg_wait_time
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_tx_wait_time">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_tx_wait_time">
<code class="literal">
Rpl_semi_sync_master_tx_wait_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045262217408">
</a>
<a class="indexterm" name="idm46045262216368">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_tx_wait_time">
<code class="literal">
Rpl_semi_sync_source_tx_wait_time
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_tx_waits">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_tx_waits">
<code class="literal">
Rpl_semi_sync_master_tx_waits
</code>
</a>
</p>
<a class="indexterm" name="idm46045262210688">
</a>
<a class="indexterm" name="idm46045262209584">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_tx_waits">
<code class="literal">
Rpl_semi_sync_source_tx_waits
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_wait_pos_backtraverse">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_wait_pos_backtraverse">
<code class="literal">
Rpl_semi_sync_master_wait_pos_backtraverse
</code>
</a>
</p>
<a class="indexterm" name="idm46045262203792">
</a>
<a class="indexterm" name="idm46045262202672">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_wait_pos_backtraverse">
<code class="literal">
Rpl_semi_sync_source_wait_pos_backtraverse
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_wait_sessions">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_wait_sessions">
<code class="literal">
Rpl_semi_sync_master_wait_sessions
</code>
</a>
</p>
<a class="indexterm" name="idm46045262196768">
</a>
<a class="indexterm" name="idm46045262195728">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_wait_sessions">
<code class="literal">
Rpl_semi_sync_source_wait_sessions
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_master_yes_tx">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_yes_tx">
<code class="literal">
Rpl_semi_sync_master_yes_tx
</code>
</a>
</p>
<a class="indexterm" name="idm46045262190048">
</a>
<a class="indexterm" name="idm46045262188944">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_yes_tx">
<code class="literal">
Rpl_semi_sync_source_yes_tx
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_clients">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_clients">
<code class="literal">
Rpl_semi_sync_source_clients
</code>
</a>
</p>
<a class="indexterm" name="idm46045262183296">
</a>
<a class="indexterm" name="idm46045262182192">
</a>
<p>
The number of semisynchronous replicas.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_net_avg_wait_time">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_net_avg_wait_time">
<code class="literal">
Rpl_semi_sync_source_net_avg_wait_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045262175696">
</a>
<a class="indexterm" name="idm46045262174656">
</a>
<p>
The average time in microseconds the source waited for a
replica reply. This variable is always
<code class="literal">
0
</code>
,
and is deprecated; expect it to be removed in a future
version.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_net_wait_time">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_net_wait_time">
<code class="literal">
Rpl_semi_sync_source_net_wait_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045262167408">
</a>
<a class="indexterm" name="idm46045262166368">
</a>
<p>
The total time in microseconds the source waited for replica
replies. This variable is always
<code class="literal">
0
</code>
, and is
deprecated; expect it to be removed in a future version.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_net_waits">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_net_waits">
<code class="literal">
Rpl_semi_sync_source_net_waits
</code>
</a>
</p>
<a class="indexterm" name="idm46045262159200">
</a>
<a class="indexterm" name="idm46045262158096">
</a>
<p>
The total number of times the source waited for replica
replies.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_no_times">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_no_times">
<code class="literal">
Rpl_semi_sync_source_no_times
</code>
</a>
</p>
<a class="indexterm" name="idm46045262151696">
</a>
<a class="indexterm" name="idm46045262150592">
</a>
<p>
The number of times the source turned off semisynchronous
replication.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_no_tx">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_no_tx">
<code class="literal">
Rpl_semi_sync_source_no_tx
</code>
</a>
</p>
<a class="indexterm" name="idm46045262144192">
</a>
<a class="indexterm" name="idm46045262143088">
</a>
<p>
The number of commits that were not acknowledged successfully
by a replica.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_status">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_status">
<code class="literal">
Rpl_semi_sync_source_status
</code>
</a>
</p>
<a class="indexterm" name="idm46045262136736">
</a>
<a class="indexterm" name="idm46045262135632">
</a>
<p>
Whether semisynchronous replication currently is operational
on the source. The value is
<code class="literal">
ON
</code>
if the
plugin has been enabled and a commit acknowledgment has
occurred. It is
<code class="literal">
OFF
</code>
if the plugin is not
enabled or the source has fallen back to asynchronous
replication due to commit acknowledgment timeout.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_timefunc_failures">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_timefunc_failures">
<code class="literal">
Rpl_semi_sync_source_timefunc_failures
</code>
</a>
</p>
<a class="indexterm" name="idm46045262127488">
</a>
<a class="indexterm" name="idm46045262126448">
</a>
<p>
The number of times the source failed when calling time
functions such as
<code class="literal">
gettimeofday()
</code>
.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_tx_avg_wait_time">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_tx_avg_wait_time">
<code class="literal">
Rpl_semi_sync_source_tx_avg_wait_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045262119200">
</a>
<a class="indexterm" name="idm46045262118160">
</a>
<p>
The average time in microseconds the source waited for each
transaction.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_tx_wait_time">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_tx_wait_time">
<code class="literal">
Rpl_semi_sync_source_tx_wait_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045262111632">
</a>
<a class="indexterm" name="idm46045262110592">
</a>
<p>
The total time in microseconds the source waited for
transactions.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_tx_waits">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_tx_waits">
<code class="literal">
Rpl_semi_sync_source_tx_waits
</code>
</a>
</p>
<a class="indexterm" name="idm46045262104192">
</a>
<a class="indexterm" name="idm46045262103088">
</a>
<p>
The total number of times the source waited for transactions.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_wait_pos_backtraverse">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_wait_pos_backtraverse">
<code class="literal">
Rpl_semi_sync_source_wait_pos_backtraverse
</code>
</a>
</p>
<a class="indexterm" name="idm46045262096624">
</a>
<a class="indexterm" name="idm46045262095504">
</a>
<p>
The total number of times the source waited for an event with
binary coordinates lower than events waited for previously.
This can occur when the order in which transactions start
waiting for a reply is different from the order in which their
binary log events are written.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_wait_sessions">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_wait_sessions">
<code class="literal">
Rpl_semi_sync_source_wait_sessions
</code>
</a>
</p>
<a class="indexterm" name="idm46045262088720">
</a>
<a class="indexterm" name="idm46045262087680">
</a>
<p>
The number of sessions currently waiting for replica replies.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_source_yes_tx">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_yes_tx">
<code class="literal">
Rpl_semi_sync_source_yes_tx
</code>
</a>
</p>
<a class="indexterm" name="idm46045262081360">
</a>
<a class="indexterm" name="idm46045262080256">
</a>
<p>
The number of commits that were acknowledged successfully by a
replica.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_replica_status">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_replica_status">
<code class="literal">
Rpl_semi_sync_replica_status
</code>
</a>
</p>
<a class="indexterm" name="idm46045262073856">
</a>
<a class="indexterm" name="idm46045262072752">
</a>
<p>
Shows whether semisynchronous replication is currently
operational on the replica. This is
<code class="literal">
ON
</code>
if
the plugin has been enabled and the replication I/O (receiver)
thread is running,
<code class="literal">
OFF
</code>
otherwise.
</p>
<p>
Available when the
<code class="literal">
rpl_semi_sync_source
</code>
plugin (
<code class="filename">
semisync_source.so
</code>
library) is
installed on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rpl_semi_sync_slave_status">
</a>
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_slave_status">
<code class="literal">
Rpl_semi_sync_slave_status
</code>
</a>
</p>
<a class="indexterm" name="idm46045262064864">
</a>
<a class="indexterm" name="idm46045262063760">
</a>
<p>
Deprecated synonym for
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_replica_status">
<code class="literal">
Rpl_semi_sync_replica_status
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Rsa_public_key">
</a>
<a class="link" href="server-status-variables.html#statvar_Rsa_public_key">
<code class="literal">
Rsa_public_key
</code>
</a>
</p>
<a class="indexterm" name="idm46045262058128">
</a>
<a class="indexterm" name="idm46045262057040">
</a>
<p>
The value of this variable is the public key used by the
<code class="literal">
sha256_password
</code>
(deprecated) authentication
plugin for RSA key pair-based password exchange. The value is
nonempty only if the server successfully initializes the
private and public keys in the files named by the
<a class="link" href="server-system-variables.html#sysvar_sha256_password_private_key_path">
<code class="literal">
sha256_password_private_key_path
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_sha256_password_public_key_path">
<code class="literal">
sha256_password_public_key_path
</code>
</a>
system variables. The value of
<a class="link" href="server-status-variables.html#statvar_Rsa_public_key">
<code class="literal">
Rsa_public_key
</code>
</a>
comes from
the latter file.
</p>
<p>
For information about
<code class="literal">
sha256_password
</code>
, see
<a class="xref" href="sha256-pluggable-authentication.html" title="8.4.1.3 SHA-256 Pluggable Authentication">
Section 8.4.1.3, “SHA-256 Pluggable Authentication”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Secondary_engine_execution_count">
</a>
<a class="link" href="server-status-variables.html#statvar_Secondary_engine_execution_count">
<code class="literal">
Secondary_engine_execution_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045262045792">
</a>
<a class="indexterm" name="idm46045262044752">
</a>
<p>
The number of queries offloaded to a secondary engine.
</p>
<p>
For use with HeatWave. See
<a class="ulink" href="/doc/heatwave/en/" target="_top">
HeatWave User Guide
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Select_full_join">
</a>
<a class="link" href="server-status-variables.html#statvar_Select_full_join">
<code class="literal">
Select_full_join
</code>
</a>
</p>
<a class="indexterm" name="idm46045262039088">
</a>
<a class="indexterm" name="idm46045262038048">
</a>
<p>
The number of joins that perform table scans because they do
not use indexes. If this value is not 0, you should carefully
check the indexes of your tables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Select_full_range_join">
</a>
<a class="link" href="server-status-variables.html#statvar_Select_full_range_join">
<code class="literal">
Select_full_range_join
</code>
</a>
</p>
<a class="indexterm" name="idm46045262033456">
</a>
<a class="indexterm" name="idm46045262032416">
</a>
<p>
The number of joins that used a range search on a reference
table.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Select_range">
</a>
<a class="link" href="server-status-variables.html#statvar_Select_range">
<code class="literal">
Select_range
</code>
</a>
</p>
<a class="indexterm" name="idm46045262028032">
</a>
<a class="indexterm" name="idm46045262026944">
</a>
<p>
The number of joins that used ranges on the first table. This
is normally not a critical issue even if the value is quite
large.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Select_range_check">
</a>
<a class="link" href="server-status-variables.html#statvar_Select_range_check">
<code class="literal">
Select_range_check
</code>
</a>
</p>
<a class="indexterm" name="idm46045262022368">
</a>
<a class="indexterm" name="idm46045262021328">
</a>
<p>
The number of joins without keys that check for key usage
after each row. If this is not 0, you should carefully check
the indexes of your tables.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Select_scan">
</a>
<a class="link" href="server-status-variables.html#statvar_Select_scan">
<code class="literal">
Select_scan
</code>
</a>
</p>
<a class="indexterm" name="idm46045262016912">
</a>
<a class="indexterm" name="idm46045262015824">
</a>
<p>
The number of joins that did a full scan of the first table.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Slave_open_temp_tables">
</a>
<a class="link" href="server-status-variables.html#statvar_Slave_open_temp_tables">
<code class="literal">
Slave_open_temp_tables
</code>
</a>
</p>
<a class="indexterm" name="idm46045262011408">
</a>
<a class="indexterm" name="idm46045262010368">
</a>
<p>
Deprecated alias for
<a class="link" href="server-status-variables.html#statvar_Replica_open_temp_tables">
<code class="literal">
Replica_open_temp_tables
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Slave_rows_last_search_algorithm_used">
</a>
<a class="link" href="server-status-variables.html#statvar_Slave_rows_last_search_algorithm_used">
<code class="literal">
Slave_rows_last_search_algorithm_used
</code>
</a>
</p>
<a class="indexterm" name="idm46045262004544">
</a>
<a class="indexterm" name="idm46045262003504">
</a>
<p>
Deprecated alias for
<a class="ulink" href="/doc/refman/8.0/en/server-status-variables.html#statvar_Replica_rows_last_search_algorithm_used" target="_top">
<code class="literal">
Replica_rows_last_search_algorithm_used
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Slow_launch_threads">
</a>
<a class="link" href="server-status-variables.html#statvar_Slow_launch_threads">
<code class="literal">
Slow_launch_threads
</code>
</a>
</p>
<a class="indexterm" name="idm46045261997872">
</a>
<a class="indexterm" name="idm46045261996832">
</a>
<p>
The number of threads that have taken more than
<a class="link" href="server-system-variables.html#sysvar_slow_launch_time">
<code class="literal">
slow_launch_time
</code>
</a>
seconds to
create.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Slow_queries">
</a>
<a class="link" href="server-status-variables.html#statvar_Slow_queries">
<code class="literal">
Slow_queries
</code>
</a>
</p>
<a class="indexterm" name="idm46045261991232">
</a>
<a class="indexterm" name="idm46045261990144">
</a>
<p>
The number of queries that have taken more than
<a class="link" href="server-system-variables.html#sysvar_long_query_time">
<code class="literal">
long_query_time
</code>
</a>
seconds. This
counter increments regardless of whether the slow query log is
enabled. For information about that log, see
<a class="xref" href="slow-query-log.html" title="7.4.5 The Slow Query Log">
Section 7.4.5, “The Slow Query Log”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Sort_merge_passes">
</a>
<a class="link" href="server-status-variables.html#statvar_Sort_merge_passes">
<code class="literal">
Sort_merge_passes
</code>
</a>
</p>
<a class="indexterm" name="idm46045261983632">
</a>
<a class="indexterm" name="idm46045261982592">
</a>
<p>
The number of merge passes that the sort algorithm has had to
do. If this value is large, you should consider increasing the
value of the
<a class="link" href="server-system-variables.html#sysvar_sort_buffer_size">
<code class="literal">
sort_buffer_size
</code>
</a>
system variable.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Sort_range">
</a>
<a class="link" href="server-status-variables.html#statvar_Sort_range">
<code class="literal">
Sort_range
</code>
</a>
</p>
<a class="indexterm" name="idm46045261976880">
</a>
<a class="indexterm" name="idm46045261975792">
</a>
<p>
The number of sorts that were done using ranges.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Sort_rows">
</a>
<a class="link" href="server-status-variables.html#statvar_Sort_rows">
<code class="literal">
Sort_rows
</code>
</a>
</p>
<a class="indexterm" name="idm46045261971504">
</a>
<a class="indexterm" name="idm46045261970416">
</a>
<p>
The number of sorted rows.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Sort_scan">
</a>
<a class="link" href="server-status-variables.html#statvar_Sort_scan">
<code class="literal">
Sort_scan
</code>
</a>
</p>
<a class="indexterm" name="idm46045261966080">
</a>
<a class="indexterm" name="idm46045261964992">
</a>
<p>
The number of sorts that were done by scanning the table.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_accept_renegotiates">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_accept_renegotiates">
<code class="literal">
Ssl_accept_renegotiates
</code>
</a>
</p>
<a class="indexterm" name="idm46045261960512">
</a>
<a class="indexterm" name="idm46045261959472">
</a>
<p>
The number of negotiates needed to establish the connection.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_accepts">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_accepts">
<code class="literal">
Ssl_accepts
</code>
</a>
</p>
<a class="indexterm" name="idm46045261955104">
</a>
<a class="indexterm" name="idm46045261954016">
</a>
<p>
The number of accepted SSL connections.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_callback_cache_hits">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_callback_cache_hits">
<code class="literal">
Ssl_callback_cache_hits
</code>
</a>
</p>
<a class="indexterm" name="idm46045261949552">
</a>
<a class="indexterm" name="idm46045261948512">
</a>
<p>
The number of callback cache hits.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_cipher">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_cipher">
<code class="literal">
Ssl_cipher
</code>
</a>
</p>
<a class="indexterm" name="idm46045261944176">
</a>
<a class="indexterm" name="idm46045261943088">
</a>
<p>
The current encryption cipher (empty for unencrypted
connections).
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_cipher_list">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_cipher_list">
<code class="literal">
Ssl_cipher_list
</code>
</a>
</p>
<a class="indexterm" name="idm46045261938704">
</a>
<a class="indexterm" name="idm46045261937616">
</a>
<p>
The list of possible SSL ciphers (empty for non-SSL
connections). If MySQL supports TLSv1.3, the value includes
the possible TLSv1.3 ciphersuites. See
<a class="xref" href="encrypted-connection-protocols-ciphers.html" title="8.3.2 Encrypted Connection TLS Protocols and Ciphers">
Section 8.3.2, “Encrypted Connection TLS Protocols and Ciphers”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_client_connects">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_client_connects">
<code class="literal">
Ssl_client_connects
</code>
</a>
</p>
<a class="indexterm" name="idm46045261932384">
</a>
<a class="indexterm" name="idm46045261931344">
</a>
<p>
The number of SSL connection attempts to an SSL-enabled
replication source server.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_connect_renegotiates">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_connect_renegotiates">
<code class="literal">
Ssl_connect_renegotiates
</code>
</a>
</p>
<a class="indexterm" name="idm46045261926928">
</a>
<a class="indexterm" name="idm46045261925824">
</a>
<p>
The number of negotiates needed to establish the connection to
an SSL-enabled replication source server.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_ctx_verify_depth">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_ctx_verify_depth">
<code class="literal">
Ssl_ctx_verify_depth
</code>
</a>
</p>
<a class="indexterm" name="idm46045261921280">
</a>
<a class="indexterm" name="idm46045261920240">
</a>
<p>
The SSL context verification depth (how many certificates in
the chain are tested).
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_ctx_verify_mode">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_ctx_verify_mode">
<code class="literal">
Ssl_ctx_verify_mode
</code>
</a>
</p>
<a class="indexterm" name="idm46045261915792">
</a>
<a class="indexterm" name="idm46045261914752">
</a>
<p>
The SSL context verification mode.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_default_timeout">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_default_timeout">
<code class="literal">
Ssl_default_timeout
</code>
</a>
</p>
<a class="indexterm" name="idm46045261910368">
</a>
<a class="indexterm" name="idm46045261909328">
</a>
<p>
The default SSL timeout.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_finished_accepts">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_finished_accepts">
<code class="literal">
Ssl_finished_accepts
</code>
</a>
</p>
<a class="indexterm" name="idm46045261904944">
</a>
<a class="indexterm" name="idm46045261903904">
</a>
<p>
The number of successful SSL connections to the server.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_finished_connects">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_finished_connects">
<code class="literal">
Ssl_finished_connects
</code>
</a>
</p>
<a class="indexterm" name="idm46045261899424">
</a>
<a class="indexterm" name="idm46045261898384">
</a>
<p>
The number of successful replica connections to an SSL-enabled
replication source server.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_server_not_after">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_server_not_after">
<code class="literal">
Ssl_server_not_after
</code>
</a>
</p>
<a class="indexterm" name="idm46045261893936">
</a>
<a class="indexterm" name="idm46045261892896">
</a>
<p>
The last date for which the SSL certificate is valid. To check
SSL certificate expiration information, use this statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa32150553"><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></span> <span class="token keyword">SHOW</span> <span class="token keyword">STATUS</span> <span class="token operator">LIKE</span> <span class="token string">'Ssl_server_not%'</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>
<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>
<span class="token output"><span class="token punctuation">|</span> Ssl_server_not_after <span class="token punctuation">|</span> Apr 28 14:16:39 2025 GMT <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Ssl_server_not_before <span class="token punctuation">|</span> May 1 14:16:39 2015 GMT <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_server_not_before">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_server_not_before">
<code class="literal">
Ssl_server_not_before
</code>
</a>
</p>
<a class="indexterm" name="idm46045261886368">
</a>
<a class="indexterm" name="idm46045261885328">
</a>
<p>
The first date for which the SSL certificate is valid.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_session_cache_hits">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_session_cache_hits">
<code class="literal">
Ssl_session_cache_hits
</code>
</a>
</p>
<a class="indexterm" name="idm46045261880848">
</a>
<a class="indexterm" name="idm46045261879808">
</a>
<p>
The number of SSL session cache hits.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_session_cache_misses">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_session_cache_misses">
<code class="literal">
Ssl_session_cache_misses
</code>
</a>
</p>
<a class="indexterm" name="idm46045261875376">
</a>
<a class="indexterm" name="idm46045261874272">
</a>
<p>
The number of SSL session cache misses.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_session_cache_mode">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_session_cache_mode">
<code class="literal">
Ssl_session_cache_mode
</code>
</a>
</p>
<a class="indexterm" name="idm46045261869792">
</a>
<a class="indexterm" name="idm46045261868752">
</a>
<p>
The SSL session cache mode. When the value of the
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_mode">
<code class="literal">
ssl_session_cache_mode
</code>
</a>
server
variable is
<code class="literal">
ON
</code>
, the value of the
<a class="link" href="server-status-variables.html#statvar_Ssl_session_cache_mode">
<code class="literal">
Ssl_session_cache_mode
</code>
</a>
status variable is
<code class="literal">
SERVER
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_session_cache_overflows">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_session_cache_overflows">
<code class="literal">
Ssl_session_cache_overflows
</code>
</a>
</p>
<a class="indexterm" name="idm46045261860336">
</a>
<a class="indexterm" name="idm46045261859232">
</a>
<p>
The number of SSL session cache overflows.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_session_cache_size">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_session_cache_size">
<code class="literal">
Ssl_session_cache_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045261854816">
</a>
<a class="indexterm" name="idm46045261853776">
</a>
<p>
The SSL session cache size.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_session_cache_timeout">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_session_cache_timeout">
<code class="literal">
Ssl_session_cache_timeout
</code>
</a>
</p>
<a class="indexterm" name="idm46045261849360">
</a>
<a class="indexterm" name="idm46045261848256">
</a>
<p>
The timeout value in seconds of SSL sessions in the cache.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_session_cache_timeouts">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_session_cache_timeouts">
<code class="literal">
Ssl_session_cache_timeouts
</code>
</a>
</p>
<a class="indexterm" name="idm46045261843792">
</a>
<a class="indexterm" name="idm46045261842688">
</a>
<p>
The number of SSL session cache timeouts.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_sessions_reused">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_sessions_reused">
<code class="literal">
Ssl_sessions_reused
</code>
</a>
</p>
<a class="indexterm" name="idm46045261838208">
</a>
<a class="indexterm" name="idm46045261837168">
</a>
<p>
This is equal to 0 if TLS was not used in the current MySQL
session, or if a TLS session has not been reused; otherwise it
is equal to 1.
</p>
<p>
<code class="literal">
Ssl_sessions_reused
</code>
has session scope.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_used_session_cache_entries">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_used_session_cache_entries">
<code class="literal">
Ssl_used_session_cache_entries
</code>
</a>
</p>
<a class="indexterm" name="idm46045261831504">
</a>
<a class="indexterm" name="idm46045261830400">
</a>
<p>
How many SSL session cache entries were used.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_verify_depth">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_verify_depth">
<code class="literal">
Ssl_verify_depth
</code>
</a>
</p>
<a class="indexterm" name="idm46045261825984">
</a>
<a class="indexterm" name="idm46045261824944">
</a>
<p>
The verification depth for replication SSL connections.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_verify_mode">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_verify_mode">
<code class="literal">
Ssl_verify_mode
</code>
</a>
</p>
<a class="indexterm" name="idm46045261820640">
</a>
<a class="indexterm" name="idm46045261819552">
</a>
<p>
The verification mode used by the server for a connection that
uses SSL. The value is a bitmask; bits are defined in the
<code class="filename">
openssl/ssl.h
</code>
header file:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-c"><div class="docs-select-all right" id="sa62349100"><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-c"><span class="token macro property"># <span class="token directive keyword">define</span> SSL_VERIFY_NONE 0x00</span>
<span class="token macro property"># <span class="token directive keyword">define</span> SSL_VERIFY_PEER 0x01</span>
<span class="token macro property"># <span class="token directive keyword">define</span> SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02</span>
<span class="token macro property"># <span class="token directive keyword">define</span> SSL_VERIFY_CLIENT_ONCE 0x04</span></code></pre>
</div>
<p>
<code class="literal">
SSL_VERIFY_PEER
</code>
indicates that the server
asks for a client certificate. If the client supplies one, the
server performs verification and proceeds only if verification
is successful.
<code class="literal">
SSL_VERIFY_CLIENT_ONCE
</code>
indicates that a request for the client certificate is
performed only in the initial handshake.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Ssl_version">
</a>
<a class="link" href="server-status-variables.html#statvar_Ssl_version">
<code class="literal">
Ssl_version
</code>
</a>
</p>
<a class="indexterm" name="idm46045261811168">
</a>
<a class="indexterm" name="idm46045261810080">
</a>
<p>
The SSL protocol version of the connection (for example,
TLSv1.2). If the connection is not encrypted, the value is
empty.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Table_locks_immediate">
</a>
<a class="link" href="server-status-variables.html#statvar_Table_locks_immediate">
<code class="literal">
Table_locks_immediate
</code>
</a>
</p>
<a class="indexterm" name="idm46045261805584">
</a>
<a class="indexterm" name="idm46045261804544">
</a>
<p>
The number of times that a request for a table lock could be
granted immediately.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Table_locks_waited">
</a>
<a class="link" href="server-status-variables.html#statvar_Table_locks_waited">
<code class="literal">
Table_locks_waited
</code>
</a>
</p>
<a class="indexterm" name="idm46045261800032">
</a>
<a class="indexterm" name="idm46045261798992">
</a>
<p>
The number of times that a request for a table lock could not
be granted immediately and a wait was needed. If this is high
and you have performance problems, you should first optimize
your queries, and then either split your table or tables or
use replication.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Table_open_cache_hits">
</a>
<a class="link" href="server-status-variables.html#statvar_Table_open_cache_hits">
<code class="literal">
Table_open_cache_hits
</code>
</a>
</p>
<a class="indexterm" name="idm46045261794272">
</a>
<a class="indexterm" name="idm46045261793232">
</a>
<p>
The number of hits for open tables cache lookups.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Table_open_cache_misses">
</a>
<a class="link" href="server-status-variables.html#statvar_Table_open_cache_misses">
<code class="literal">
Table_open_cache_misses
</code>
</a>
</p>
<a class="indexterm" name="idm46045261788768">
</a>
<a class="indexterm" name="idm46045261787728">
</a>
<p>
The number of misses for open tables cache lookups.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Table_open_cache_overflows">
</a>
<a class="link" href="server-status-variables.html#statvar_Table_open_cache_overflows">
<code class="literal">
Table_open_cache_overflows
</code>
</a>
</p>
<a class="indexterm" name="idm46045261783296">
</a>
<a class="indexterm" name="idm46045261782192">
</a>
<p>
The number of overflows for the open tables cache. This is the
number of times, after a table is opened or closed, a cache
instance has an unused entry and the size of the instance is
larger than
<a class="link" href="server-system-variables.html#sysvar_table_open_cache">
<code class="literal">
table_open_cache
</code>
</a>
/
<a class="link" href="server-system-variables.html#sysvar_table_open_cache_instances">
<code class="literal">
table_open_cache_instances
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Tc_log_max_pages_used">
</a>
<a class="link" href="server-status-variables.html#statvar_Tc_log_max_pages_used">
<code class="literal">
Tc_log_max_pages_used
</code>
</a>
</p>
<a class="indexterm" name="idm46045261775024">
</a>
<a class="indexterm" name="idm46045261773984">
</a>
<p>
For the memory-mapped implementation of the log that is used
by
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
when it acts as the transaction
coordinator for recovery of internal XA transactions, this
variable indicates the largest number of pages used for the
log since the server started. If the product of
<a class="link" href="server-status-variables.html#statvar_Tc_log_max_pages_used">
<code class="literal">
Tc_log_max_pages_used
</code>
</a>
and
<a class="link" href="server-status-variables.html#statvar_Tc_log_page_size">
<code class="literal">
Tc_log_page_size
</code>
</a>
is always
significantly less than the log size, the size is larger than
necessary and can be reduced. (The size is set by the
<a class="link" href="server-options.html#option_mysqld_log-tc-size">
<code class="option">
--log-tc-size
</code>
</a>
option. This
variable is unused: It is unneeded for binary log-based
recovery, and the memory-mapped recovery log method is not
used unless the number of storage engines that are capable of
two-phase commit and that support XA transactions is greater
than one. (
<code class="literal">
InnoDB
</code>
is the only applicable
engine.)
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Tc_log_page_size">
</a>
<a class="link" href="server-status-variables.html#statvar_Tc_log_page_size">
<code class="literal">
Tc_log_page_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045261763328">
</a>
<a class="indexterm" name="idm46045261762288">
</a>
<p>
The page size used for the memory-mapped implementation of the
XA recovery log. The default value is determined using
<code class="literal">
getpagesize()
</code>
. This variable is unused for
the same reasons as described for
<a class="link" href="server-status-variables.html#statvar_Tc_log_max_pages_used">
<code class="literal">
Tc_log_max_pages_used
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Tc_log_page_waits">
</a>
<a class="link" href="server-status-variables.html#statvar_Tc_log_page_waits">
<code class="literal">
Tc_log_page_waits
</code>
</a>
</p>
<a class="indexterm" name="idm46045261755696">
</a>
<a class="indexterm" name="idm46045261754656">
</a>
<p>
For the memory-mapped implementation of the recovery log, this
variable increments each time the server was not able to
commit a transaction and had to wait for a free page in the
log. If this value is large, you might want to increase the
log size (with the
<a class="link" href="server-options.html#option_mysqld_log-tc-size">
<code class="option">
--log-tc-size
</code>
</a>
option). For
binary log-based recovery, this variable increments each time
the binary log cannot be closed because there are two-phase
commits in progress. (The close operation waits until all such
transactions are finished.)
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Telemetry_metrics_supported">
</a>
<a class="link" href="server-status-variables.html#statvar_Telemetry_metrics_supported">
<code class="literal">
Telemetry_metrics_supported
</code>
</a>
</p>
<a class="indexterm" name="idm46045261748720">
</a>
<a class="indexterm" name="idm46045261747616">
</a>
<p>
Whether server telemetry metrics is supported.
</p>
<p>
For more information, see the
<span class="emphasis">
<em>
Server telemetry
metrics service
</em>
</span>
section in the MySQL Source Code
documentation.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_telemetry.live_sessions">
</a>
<a class="link" href="server-status-variables.html#statvar_telemetry.live_sessions">
<code class="literal">
telemetry.live_sessions
</code>
</a>
</p>
<a class="indexterm" name="idm46045261742160">
</a>
<a class="indexterm" name="idm46045261741120">
</a>
<p>
Displays the current number of sessions instrumented with
telemetry. This can be useful when unloading the Telemetry
component, to monitor how many sessions are blocking the
unload operation.
</p>
<p>
For more information, see the
<span class="emphasis">
<em>
Server telemetry
traces service
</em>
</span>
section in the MySQL Source Code
documentation and
<a class="xref" href="telemetry.html" title="Chapter 35 Telemetry">
Chapter 35,
<i>
Telemetry
</i>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Telemetry_traces_supported">
</a>
<a class="link" href="server-status-variables.html#statvar_Telemetry_traces_supported">
<code class="literal">
Telemetry_traces_supported
</code>
</a>
</p>
<a class="indexterm" name="idm46045261734928">
</a>
<a class="indexterm" name="idm46045261733824">
</a>
<p>
Whether server telemetry traces is supported.
</p>
<p>
For more information, see the
<span class="emphasis">
<em>
Server telemetry
traces service
</em>
</span>
section in the MySQL Source Code
documentation.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Threads_cached">
</a>
<a class="link" href="server-status-variables.html#statvar_Threads_cached">
<code class="literal">
Threads_cached
</code>
</a>
</p>
<a class="indexterm" name="idm46045261728480">
</a>
<a class="indexterm" name="idm46045261727392">
</a>
<p>
The number of threads in the thread cache.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Threads_connected">
</a>
<a class="link" href="server-status-variables.html#statvar_Threads_connected">
<code class="literal">
Threads_connected
</code>
</a>
</p>
<a class="indexterm" name="idm46045261722992">
</a>
<a class="indexterm" name="idm46045261721952">
</a>
<p>
The number of currently open connections.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Threads_created">
</a>
<a class="link" href="server-status-variables.html#statvar_Threads_created">
<code class="literal">
Threads_created
</code>
</a>
</p>
<a class="indexterm" name="idm46045261717600">
</a>
<a class="indexterm" name="idm46045261716512">
</a>
<p>
The number of threads created to handle connections. If
<a class="link" href="server-status-variables.html#statvar_Threads_created">
<code class="literal">
Threads_created
</code>
</a>
is big, you
may want to increase the
<a class="link" href="server-system-variables.html#sysvar_thread_cache_size">
<code class="literal">
thread_cache_size
</code>
</a>
value. The
cache miss rate can be calculated as
<a class="link" href="server-status-variables.html#statvar_Threads_created">
<code class="literal">
Threads_created
</code>
</a>
/
<a class="link" href="server-status-variables.html#statvar_Connections">
<code class="literal">
Connections
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Threads_running">
</a>
<a class="link" href="server-status-variables.html#statvar_Threads_running">
<code class="literal">
Threads_running
</code>
</a>
</p>
<a class="indexterm" name="idm46045261707184">
</a>
<a class="indexterm" name="idm46045261706096">
</a>
<p>
The number of threads that are not sleeping.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Tls_library_version">
</a>
<a class="link" href="server-status-variables.html#statvar_Tls_library_version">
<code class="literal">
Tls_library_version
</code>
</a>
</p>
<a class="indexterm" name="idm46045261701632">
</a>
<a class="indexterm" name="idm46045261700592">
</a>
<p>
The runtime version of the OpenSSL library that is in use for
this MySQL instance.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Tls_sni_server_name">
</a>
<a class="link" href="server-status-variables.html#statvar_Tls_sni_server_name">
<code class="literal">
Tls_sni_server_name
</code>
</a>
</p>
<a class="indexterm" name="idm46045261696080">
</a>
<a class="indexterm" name="idm46045261695040">
</a>
<p>
The Server Name Indication (SNI) that is in use for this
session, if specified by the client; otherwise, empty. SNI is
an extension to the TLS protocol (OpenSSL must be compiled
using TLS extensions for this status variable to function).
The MySQL implementation of SNI represents the client-side
only.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Uptime">
</a>
<a class="link" href="server-status-variables.html#statvar_Uptime">
<code class="literal">
Uptime
</code>
</a>
</p>
<a class="indexterm" name="idm46045261690384">
</a>
<a class="indexterm" name="idm46045261689312">
</a>
<p>
The number of seconds that the server has been up.
</p>
</li>
<li class="listitem">
<p>
<a name="statvar_Uptime_since_flush_status">
</a>
<a class="link" href="server-status-variables.html#statvar_Uptime_since_flush_status">
<code class="literal">
Uptime_since_flush_status
</code>
</a>
</p>
<a class="indexterm" name="idm46045261684880">
</a>
<a class="indexterm" name="idm46045261683776">
</a>
<p>
The number of seconds since the most recent
<code class="literal">
FLUSH
STATUS
</code>
statement.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/replication-features-triggers.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="replication-features-triggers">
</a>
19.5.1.36 Replication and Triggers
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045134898768">
</a>
<a class="indexterm" name="idm46045134897280">
</a>
<p>
With statement-based replication, triggers executed on the
source also execute on the replica. With row-based replication,
triggers executed on the source do not execute on the replica.
Instead, the row changes on the source resulting from trigger
execution are replicated and applied on the replica.
</p>
<p>
This behavior is by design. If under row-based replication the
replica applied the triggers as well as the row changes caused
by them, the changes would in effect be applied twice on the
replica, leading to different data on the source and the
replica.
</p>
<p>
If you want triggers to execute on both the source and the
replica, perhaps because you have different triggers on the
source and replica, you must use statement-based replication.
However, to enable replica-side triggers, it is not necessary to
use statement-based replication exclusively. It is sufficient to
switch to statement-based replication only for those statements
where you want this effect, and to use row-based replication the
rest of the time.
</p>
<p>
A statement invoking a trigger (or function) that causes an
update to an
<code class="literal">
AUTO_INCREMENT
</code>
column is not
replicated correctly using statement-based replication. MySQL
8.4 marks such statements as unsafe. (Bug #45677)
</p>
<p>
A trigger can have triggers for different combinations of
trigger event (
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
,
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
,
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
) and action time
(
<code class="literal">
BEFORE
</code>
,
<code class="literal">
AFTER
</code>
), and
multiple triggers are permitted.
</p>
<p>
For brevity,
<span class="quote">
“
<span class="quote">
multiple triggers
</span>
”
</span>
here is shorthand
for
<span class="quote">
“
<span class="quote">
multiple triggers that have the same trigger event
and action time.
</span>
”
</span>
</p>
<p>
<span class="bold">
<strong>
Upgrades.
</strong>
</span>
Multiple triggers are
not supported in versions earlier than MySQL 5.7. If you upgrade
servers in a replication topology that use a version earlier
than MySQL 5.7, upgrade the replicas first and then upgrade the
source. If an upgraded replication source server still has old
replicas using MySQL versions that do not support multiple
triggers, an error occurs on those replicas if a trigger is
created on the source for a table that already has a trigger
with the same trigger event and action time.
</p>
<p>
<span class="bold">
<strong>
Downgrades.
</strong>
</span>
If you downgrade a
server that supports multiple triggers to an older version that
does not, the downgrade has these effects:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
For each table that has triggers, all trigger definitions
are in the
<code class="filename">
.TRG
</code>
file for the table.
However, if there are multiple triggers with the same
trigger event and action time, the server executes only one
of them when the trigger event occurs. For information about
<code class="literal">
.TRG
</code>
files, see the Table Trigger Storage
section of the MySQL Server Doxygen documentation, available
at
<a class="ulink" href="/doc/index-other.html" target="_top">
https://dev.mysql.com/doc/index-other.html
</a>
.
</p>
</li>
<li class="listitem">
<p>
If triggers for the table are added or dropped subsequent to
the downgrade, the server rewrites the table's
<code class="filename">
.TRG
</code>
file. The rewritten file retains
only one trigger per combination of trigger event and action
time; the others are lost.
</p>
</li>
</ul>
</div>
<p>
To avoid these problems, modify your triggers before
downgrading. For each table that has multiple triggers per
combination of trigger event and action time, convert each such
set of triggers to a single trigger as follows:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
For each trigger, create a stored routine that contains all
the code in the trigger. Values accessed using
<code class="literal">
NEW
</code>
and
<code class="literal">
OLD
</code>
can be
passed to the routine using parameters. If the trigger needs
a single result value from the code, you can put the code in
a stored function and have the function return the value. If
the trigger needs multiple result values from the code, you
can put the code in a stored procedure and return the values
using
<code class="literal">
OUT
</code>
parameters.
</p>
</li>
<li class="listitem">
<p>
Drop all triggers for the table.
</p>
</li>
<li class="listitem">
<p>
Create one new trigger for the table that invokes the stored
routines just created. The effect for this trigger is thus
the same as the multiple triggers it replaces.
</p>
</li>
</ol>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/information-schema-view-table-usage-table.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="information-schema-view-table-usage-table">
</a>
28.3.49 The INFORMATION_SCHEMA VIEW_TABLE_USAGE Table
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045077931056">
</a>
<p>
The
<a class="link" href="information-schema-view-table-usage-table.html" title="28.3.49 The INFORMATION_SCHEMA VIEW_TABLE_USAGE Table">
<code class="literal">
VIEW_TABLE_USAGE
</code>
</a>
table provides
access to information about tables and views used in view
definitions.
</p>
<p>
You can see information only for views for which you have some
privilege, and only for tables for which you have some privilege.
</p>
<p>
The
<a class="link" href="information-schema-view-table-usage-table.html" title="28.3.49 The INFORMATION_SCHEMA VIEW_TABLE_USAGE Table">
<code class="literal">
VIEW_TABLE_USAGE
</code>
</a>
table has these
columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
VIEW_CATALOG
</code>
</p>
<p>
The name of the catalog to which the view belongs. This value
is always
<code class="literal">
def
</code>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
VIEW_SCHEMA
</code>
</p>
<p>
The name of the schema (database) to which the view belongs.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
VIEW_NAME
</code>
</p>
<p>
The name of the view.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TABLE_CATALOG
</code>
</p>
<p>
The name of the catalog to which the table or view used in the
view definition belongs. This value is always
<code class="literal">
def
</code>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TABLE_SCHEMA
</code>
</p>
<p>
The name of the schema (database) to which the table or view
used in the view definition belongs.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TABLE_NAME
</code>
</p>
<p>
The name of the table or view used in the view definition.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/innodb-read-only-instance.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="innodb-read-only-instance">
</a>
17.8.2 Configuring InnoDB for Read-Only Operation
</h3>
</div>
</div>
</div>
<p>
You can query
<code class="literal">
InnoDB
</code>
tables where the MySQL
data directory is on read-only media by enabling the
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_only">
<code class="literal">
--innodb-read-only
</code>
</a>
configuration
option at server startup.
</p>
<h4>
<a name="idm46045163414080">
</a>
How to Enable
</h4>
<p>
To prepare an instance for read-only operation, make sure all the
necessary information is
<a class="link" href="glossary.html#glos_flush" title="flush">
flushed
</a>
to the data files before storing it on the read-only medium. Run
the server with change buffering disabled
(
<a class="link" href="innodb-parameters.html#sysvar_innodb_change_buffering">
<code class="literal">
innodb_change_buffering=0
</code>
</a>
) and
do a
<a class="link" href="glossary.html#glos_slow_shutdown" title="slow shutdown">
slow shutdown
</a>
.
</p>
<p>
To enable read-only mode for an entire MySQL instance, specify the
following configuration options at server startup:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_only">
<code class="literal">
--innodb-read-only=1
</code>
</a>
</p>
</li>
<li class="listitem">
<p>
If the instance is on read-only media such as a DVD or CD, or
the
<code class="filename">
/var
</code>
directory is not writeable by
all:
<a class="link" href="server-system-variables.html#sysvar_pid_file">
<code class="literal">
--pid-file=
<em class="replaceable">
<code>
path_on_writeable_media
</code>
</em>
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_event_scheduler">
<code class="literal">
--event-scheduler=disabled
</code>
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="innodb-parameters.html#sysvar_innodb_temp_data_file_path">
<code class="literal">
--innodb-temp-data-file-path
</code>
</a>
.
This option specifies the path, file name, and file size for
<code class="literal">
InnoDB
</code>
temporary tablespace data files. The
default setting is
<code class="literal">
ibtmp1:12M:autoextend
</code>
,
which creates the
<code class="filename">
ibtmp1
</code>
temporary
tablespace data file in the data directory. To prepare an
instance for read-only operation, set
<a class="link" href="innodb-parameters.html#sysvar_innodb_temp_data_file_path">
<code class="literal">
innodb_temp_data_file_path
</code>
</a>
to
a location outside of the data directory. The path must be
relative to the data directory. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa87429868"><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 constant">--innodb-temp-data-file-path</span><span class="token attr-value"><span class="token punctuation">=</span>../../../tmp/ibtmp1:12M:autoextend</span></code></pre>
</div>
</li>
</ul>
</div>
<p>
Enabling
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_only">
<code class="literal">
innodb_read_only
</code>
</a>
prevents table creation and drop operations for all storage
engines. These operations modify data dictionary tables in the
<code class="literal">
mysql
</code>
system database, but those tables use the
<code class="literal">
InnoDB
</code>
storage engine and cannot be modified
when
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_only">
<code class="literal">
innodb_read_only
</code>
</a>
is enabled.
The same restriction applies to any operation that modifies data
dictionary tables, such as
<a class="link" href="analyze-table.html" title="15.7.3.1 ANALYZE TABLE Statement">
<code class="literal">
ANALYZE
TABLE
</code>
</a>
and
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
<em class="replaceable">
<code>
tbl_name
</code>
</em>
ENGINE=
<em class="replaceable">
<code>
engine_name
</code>
</em>
</code>
</a>
.
</p>
<p>
In addition, other tables in the
<code class="literal">
mysql
</code>
system
database use the
<code class="literal">
InnoDB
</code>
storage engine in MySQL
8.4. Making those tables read only results in
restrictions on operations that modify them. For example,
<a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
<code class="literal">
CREATE USER
</code>
</a>
,
<a class="link" href="grant.html" title="15.7.1.6 GRANT Statement">
<code class="literal">
GRANT
</code>
</a>
,
<a class="link" href="revoke.html" title="15.7.1.8 REVOKE Statement">
<code class="literal">
REVOKE
</code>
</a>
, and
<a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
<code class="literal">
INSTALL PLUGIN
</code>
</a>
operations are not
permitted in read-only mode.
</p>
<h4>
<a name="idm46045163380864">
</a>
Usage Scenarios
</h4>
<p>
This mode of operation is appropriate in situations such as:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Distributing a MySQL application, or a set of MySQL data, on a
read-only storage medium such as a DVD or CD.
</p>
</li>
<li class="listitem">
<p>
Multiple MySQL instances querying the same data directory
simultaneously, typically in a data warehousing configuration.
You might use this technique to avoid
<a class="link" href="glossary.html#glos_bottleneck" title="bottleneck">
bottlenecks
</a>
that can
occur with a heavily loaded MySQL instance, or you might use
different configuration options for the various instances to
tune each one for particular kinds of queries.
</p>
</li>
<li class="listitem">
<p>
Querying data that has been put into a read-only state for
security or data integrity reasons, such as archived backup
data.
</p>
</li>
</ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
This feature is mainly intended for flexibility in distribution
and deployment, rather than raw performance based on the
read-only aspect. See
<a class="xref" href="innodb-performance-ro-txn.html" title="10.5.3 Optimizing InnoDB Read-Only Transactions">
Section 10.5.3, “Optimizing InnoDB Read-Only Transactions”
</a>
for ways to tune the
performance of read-only queries, which do not require making
the entire server read-only.
</p>
</div>
<h4>
<a name="idm46045163373584">
</a>
How It Works
</h4>
<p>
When the server is run in read-only mode through the
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_only">
<code class="literal">
--innodb-read-only
</code>
</a>
option,
certain
<code class="literal">
InnoDB
</code>
features and components are
reduced or turned off entirely:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
No
<a class="link" href="glossary.html#glos_change_buffering" title="change buffering">
change
buffering
</a>
is done, in particular no merges from the
change buffer. To make sure the change buffer is empty when
you prepare the instance for read-only operation, disable
change buffering
(
<a class="link" href="innodb-parameters.html#sysvar_innodb_change_buffering">
<code class="literal">
innodb_change_buffering=0
</code>
</a>
)
and do a
<a class="link" href="glossary.html#glos_slow_shutdown" title="slow shutdown">
slow
shutdown
</a>
first.
</p>
</li>
<li class="listitem">
<p>
There is no
<a class="link" href="glossary.html#glos_crash_recovery" title="crash recovery">
crash
recovery
</a>
phase at startup. The instance must have
performed a
<a class="link" href="glossary.html#glos_slow_shutdown" title="slow shutdown">
slow
shutdown
</a>
before being put into the read-only state.
</p>
</li>
<li class="listitem">
<p>
Because the
<a class="link" href="glossary.html#glos_redo_log" title="redo log">
redo log
</a>
is
not used in read-only operation, you can set
<a class="link" href="innodb-parameters.html#sysvar_innodb_log_file_size">
<code class="literal">
innodb_log_file_size
</code>
</a>
to the
smallest size possible (1 MB) before making the instance
read-only.
</p>
</li>
<li class="listitem">
<p>
Most background threads are turned off. I/O read threads
remain, as well as I/O write threads and a page flush
coordinator thread for writes to temporary files, which are
permitted in read-only mode. A buffer pool resize thread also
remains active to enable online resizing of the buffer pool.
</p>
</li>
<li class="listitem">
<p>
Information about deadlocks, monitor output, and so on is not
written to temporary files. As a consequence,
<a class="link" href="show-engine.html" title="15.7.7.16 SHOW ENGINE Statement">
<code class="literal">
SHOW ENGINE
INNODB STATUS
</code>
</a>
does not produce any output.
</p>
</li>
<li class="listitem">
<p>
Changes to configuration option settings that would normally
change the behavior of write operations, have no effect when
the server is in read-only mode.
</p>
</li>
<li class="listitem">
<p>
The
<a class="link" href="glossary.html#glos_mvcc" title="MVCC">
MVCC
</a>
processing to
enforce
<a class="link" href="glossary.html#glos_isolation_level" title="isolation level">
isolation
levels
</a>
is turned off. All queries read the latest
version of a record, because update and deletes are not
possible.
</p>
</li>
<li class="listitem">
<p>
The
<a class="link" href="glossary.html#glos_undo_log" title="undo log">
undo log
</a>
is not used.
Disable any settings for the
<a class="link" href="innodb-parameters.html#sysvar_innodb_undo_tablespaces">
<code class="literal">
innodb_undo_tablespaces
</code>
</a>
and
<a class="link" href="innodb-parameters.html#sysvar_innodb_undo_directory">
<code class="literal">
innodb_undo_directory
</code>
</a>
configuration options.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/lock-instance-for-backup.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="lock-instance-for-backup">
</a>
15.3.5 LOCK INSTANCE FOR BACKUP and UNLOCK INSTANCE Statements
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045178594144">
</a>
<a class="indexterm" name="idm46045178593104">
</a>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa54857345"><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">LOCK</span> <span class="token keyword">INSTANCE</span> <span class="token keyword">FOR</span> <span class="token keyword">BACKUP</span>
<span class="token keyword">UNLOCK</span> <span class="token keyword">INSTANCE</span></code></pre>
</div>
<p>
<code class="literal">
LOCK INSTANCE FOR BACKUP
</code>
acquires an
instance-level
<span class="emphasis">
<em>
backup lock
</em>
</span>
that permits DML
during an online backup while preventing operations that could
result in an inconsistent snapshot.
</p>
<p>
Executing the
<code class="literal">
LOCK INSTANCE FOR BACKUP
</code>
statement requires the
<a class="link" href="privileges-provided.html#priv_backup-admin">
<code class="literal">
BACKUP_ADMIN
</code>
</a>
privilege. The
<a class="link" href="privileges-provided.html#priv_backup-admin">
<code class="literal">
BACKUP_ADMIN
</code>
</a>
privilege is automatically granted to users with the
<a class="link" href="privileges-provided.html#priv_reload">
<code class="literal">
RELOAD
</code>
</a>
privilege when performing an
in-place upgrade to MySQL 8.4 from an earlier
version.
</p>
<p>
Multiple sessions can hold a backup lock simultaneously.
</p>
<p>
<code class="literal">
UNLOCK INSTANCE
</code>
releases a backup lock held by
the current session. A backup lock held by a session is also
released if the session is terminated.
</p>
<p>
<code class="literal">
LOCK INSTANCE FOR BACKUP
</code>
prevents files from
being created, renamed, or removed.
<a class="link" href="repair-table.html" title="15.7.3.5 REPAIR TABLE Statement">
<code class="literal">
REPAIR
TABLE
</code>
</a>
<a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
<code class="literal">
TRUNCATE TABLE
</code>
</a>
,
<a class="link" href="optimize-table.html" title="15.7.3.4 OPTIMIZE TABLE Statement">
<code class="literal">
OPTIMIZE TABLE
</code>
</a>
, and account
management statements are blocked. See
<a class="xref" href="account-management-statements.html" title="15.7.1 Account Management Statements">
Section 15.7.1, “Account Management Statements”
</a>
. Operations that
modify
<code class="literal">
InnoDB
</code>
files that are not recorded in
the
<code class="literal">
InnoDB
</code>
redo log are also blocked.
</p>
<p>
<code class="literal">
LOCK INSTANCE FOR BACKUP
</code>
permits DDL operations
that only affect user-created temporary tables. In effect, files
that belong to user-created temporary tables can be created,
renamed, or removed while a backup lock is held. Creation of
binary log files is also permitted.
</p>
<p>
<a class="link" href="purge-binary-logs.html" title="15.4.1.1 PURGE BINARY LOGS Statement">
<code class="literal">
PURGE BINARY LOGS
</code>
</a>
cannot be issued
while a
<a class="link" href="lock-instance-for-backup.html" title="15.3.5 LOCK INSTANCE FOR BACKUP and UNLOCK INSTANCE Statements">
<code class="literal">
LOCK INSTANCE FOR BACKUP
</code>
</a>
statement is in effect for the instance, because it contravenes
the rules of the backup lock by removing files from the server.
</p>
<p>
A backup lock acquired by
<code class="literal">
LOCK INSTANCE FOR
BACKUP
</code>
is independent of transactional locks and locks
taken by
<a class="link" href="flush.html#flush-tables-with-read-lock-with-list">
<code class="literal">
FLUSH
TABLES
<em class="replaceable">
<code>
tbl_name
</code>
</em>
[,
<em class="replaceable">
<code>
tbl_name
</code>
</em>
] ... WITH READ LOCK
</code>
</a>
,
and the following sequences of statements are permitted:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa88799364"><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">LOCK</span> <span class="token keyword">INSTANCE</span> <span class="token keyword">FOR</span> <span class="token keyword">BACKUP</span><span class="token punctuation">;</span>
<span class="token keyword">FLUSH</span> <span class="token keyword">TABLES</span> <em class="replaceable">tbl_name</em> <span class="token punctuation">[</span><span class="token punctuation">,</span> <em class="replaceable">tbl_name</em><span class="token punctuation">]</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token keyword">WITH</span> <span class="token keyword">READ</span> <span class="token keyword">LOCK</span><span class="token punctuation">;</span>
<span class="token keyword">UNLOCK</span> <span class="token keyword">TABLES</span><span class="token punctuation">;</span>
<span class="token keyword">UNLOCK</span> <span class="token keyword">INSTANCE</span><span class="token punctuation">;</span></code></pre>
</div>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa24319236"><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">FLUSH</span> <span class="token keyword">TABLES</span> <em class="replaceable">tbl_name</em> <span class="token punctuation">[</span><span class="token punctuation">,</span> <em class="replaceable">tbl_name</em><span class="token punctuation">]</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token keyword">WITH</span> <span class="token keyword">READ</span> <span class="token keyword">LOCK</span><span class="token punctuation">;</span>
<span class="token keyword">LOCK</span> <span class="token keyword">INSTANCE</span> <span class="token keyword">FOR</span> <span class="token keyword">BACKUP</span><span class="token punctuation">;</span>
<span class="token keyword">UNLOCK</span> <span class="token keyword">INSTANCE</span><span class="token punctuation">;</span>
<span class="token keyword">UNLOCK</span> <span class="token keyword">TABLES</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_lock_wait_timeout">
<code class="literal">
lock_wait_timeout
</code>
</a>
setting
defines the amount of time that a
<code class="literal">
LOCK INSTANCE FOR
BACKUP
</code>
statement waits to acquire a lock before giving
up.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/copying-databases.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="copying-databases">
</a>
3.15 Copying MySQL Databases to Another Machine
</h2>
</div>
</div>
</div>
<a class="indexterm" name="idm46045325794192">
</a>
<a class="indexterm" name="idm46045325792736">
</a>
<a class="indexterm" name="idm46045325791664">
</a>
<p>
In cases where you need to transfer databases between different
architectures, you can use
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
to create
a file containing SQL statements. You can then transfer the file
to the other machine and feed it as input to the
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
client.
</p>
<p>
Use
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump --help
</strong>
</span>
</a>
to see what options are
available.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
If GTIDs are in use on the server where you create the dump
(
<a class="link" href="replication-options-gtids.html#sysvar_gtid_mode">
<code class="literal">
gtid_mode=ON
</code>
</a>
), by default,
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
includes the contents of the
<a class="link" href="replication-options-gtids.html#sysvar_gtid_executed">
<code class="literal">
gtid_executed
</code>
</a>
set in the dump
to transfer these to the new machine. The results of this can
vary depending on the MySQL Server versions involved. Check the
description for the
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
<code class="option">
--set-gtid-purged
</code>
option to find what happens
with the versions you are using, and how to change the behavior
if the outcome of the default behavior is not suitable for your
situation.
</p>
</div>
<p>
The easiest (although not the fastest) way to move a database
between two machines is to run the following commands on the
machine on which the database is located:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa62613781"><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">mysqladmin <span class="token property">-h</span> <span class="token atrule">'<em class="replaceable">other_hostname</em>'</span> create <em class="replaceable">db_name</em>
mysqldump <em class="replaceable">db_name</em> | mysql <span class="token property">-h</span> <span class="token atrule">'<em class="replaceable">other_hostname</em>'</span> <em class="replaceable">db_name</em></code></pre>
</div>
<p>
If you want to copy a database from a remote machine over a slow
network, you can use these commands:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa84968606"><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">mysqladmin create <em class="replaceable">db_name</em>
mysqldump <span class="token property">-h</span> <span class="token atrule">'<em class="replaceable">other_hostname</em>'</span> <span class="token property">--compress</span> <em class="replaceable">db_name</em> | mysql <em class="replaceable">db_name</em></code></pre>
</div>
<p>
You can also store the dump in a file, transfer the file to the
target machine, and then load the file into the database there.
For example, you can dump a database to a compressed file on the
source machine like this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa8773654"><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">mysqldump <span class="token property">--quick</span> <em class="replaceable">db_name</em> | gzip > <em class="replaceable">db_name</em><span class="token punctuation">.</span>gz</code></pre>
</div>
<p>
Transfer the file containing the database contents to the target
machine and run these commands there:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa19568384"><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">mysqladmin create <em class="replaceable">db_name</em>
gunzip < <em class="replaceable">db_name</em><span class="token punctuation">.</span>gz | mysql <em class="replaceable">db_name</em></code></pre>
</div>
<a class="indexterm" name="idm46045325765552">
</a>
<a class="indexterm" name="idm46045325764480">
</a>
<p>
You can also use
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
and
<a class="link" href="mysqlimport.html" title="6.5.5 mysqlimport — A Data Import Program">
<span class="command">
<strong>
mysqlimport
</strong>
</span>
</a>
to transfer the database. For large
tables, this is much faster than simply using
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
. In the following commands,
<em class="replaceable">
<code>
DUMPDIR
</code>
</em>
represents the full path name
of the directory you use to store the output from
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
.
</p>
<p>
First, create the directory for the output files and dump the
database:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa82224584"><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">mkdir <em class="replaceable">DUMPDIR</em>
mysqldump <span class="token constant">--tab</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">DUMPDIR</em></span>
<em class="replaceable">db_name</em></code></pre>
</div>
<p>
Then transfer the files in the
<em class="replaceable">
<code>
DUMPDIR
</code>
</em>
directory to some corresponding directory on the target machine
and load the files into MySQL there:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa51643401"><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">mysqladmin create <em class="replaceable">db_name</em> <span class="token comment" spellcheck="true"># create database</span>
cat <em class="replaceable">DUMPDIR</em>/*<span class="token punctuation">.</span>sql | mysql <em class="replaceable">db_name</em> <span class="token comment" spellcheck="true"># create tables in database</span>
mysqlimport <em class="replaceable">db_name</em>
<em class="replaceable">DUMPDIR</em>/*<span class="token punctuation">.</span>txt <span class="token comment" spellcheck="true"># load data into tables</span></code></pre>
</div>
<p>
Do not forget to copy the
<code class="literal">
mysql
</code>
database
because that is where the grant tables are stored. You might have
to run commands as the MySQL
<code class="literal">
root
</code>
user on the
new machine until you have the
<code class="literal">
mysql
</code>
database
in place.
</p>
<p>
After you import the
<code class="literal">
mysql
</code>
database on the new
machine, execute
<a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
<span class="command">
<strong>
mysqladmin flush-privileges
</strong>
</span>
</a>
so
that the server reloads the grant table information.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/perror.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="perror">
</a>
6.8.1 perror — Display MySQL Error Message Information
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045302872992">
</a>
<a class="indexterm" name="idm46045302872080">
</a>
<a class="indexterm" name="idm46045302870720">
</a>
<a class="indexterm" name="idm46045302869776">
</a>
<p>
<a class="link" href="perror.html" title="6.8.1 perror — Display MySQL Error Message Information">
<span class="command">
<strong>
perror
</strong>
</span>
</a>
displays the error message for MySQL
or operating system error codes. Invoke
<a class="link" href="perror.html" title="6.8.1 perror — Display MySQL Error Message Information">
<span class="command">
<strong>
perror
</strong>
</span>
</a>
like this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa9371941"><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">perror <span class="token punctuation">[</span><em class="replaceable">options</em><span class="token punctuation">]</span> <em class="replaceable">errorcode</em> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span></code></pre>
</div>
<p>
<a class="link" href="perror.html" title="6.8.1 perror — Display MySQL Error Message Information">
<span class="command">
<strong>
perror
</strong>
</span>
</a>
attempts to be flexible in
understanding its arguments. For example, for the
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_wrong_value_for_var" target="_top">
<code class="literal">
ER_WRONG_VALUE_FOR_VAR
</code>
</a>
error,
<a class="link" href="perror.html" title="6.8.1 perror — Display MySQL Error Message Information">
<span class="command">
<strong>
perror
</strong>
</span>
</a>
understands any of these arguments:
<code class="option">
1231
</code>
,
<code class="literal">
001231
</code>
,
<code class="literal">
MY-1231
</code>
, or
<code class="literal">
MY-001231
</code>
, or
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_wrong_value_for_var" target="_top">
<code class="literal">
ER_WRONG_VALUE_FOR_VAR
</code>
</a>
.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa49901359"><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">$> </span><span class="token command">perror</span> 1231
MySQL error code MY-001231 <span class="token punctuation">(</span>ER_WRONG_VALUE_FOR_VAR<span class="token punctuation">)</span><span class="token punctuation">:</span> Variable <span class="token atrule">'%-.64s'</span>
can<span class="token atrule">'t be set to the value of '</span>%-<span class="token punctuation">.</span>200s'</code></pre>
</div>
<p>
If an error number is in the range where MySQL and operating
system errors overlap,
<a class="link" href="perror.html" title="6.8.1 perror — Display MySQL Error Message Information">
<span class="command">
<strong>
perror
</strong>
</span>
</a>
displays both
error messages:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa30093446"><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">$> </span><span class="token command">perror</span> 1 13
OS error code 1<span class="token punctuation">:</span> Operation not permitted
MySQL error code MY-000001<span class="token punctuation">:</span> Can<span class="token atrule">'t create/write to file '</span>%s' <span class="token punctuation">(</span>OS errno %d - %s<span class="token punctuation">)</span>
OS error code 13<span class="token punctuation">:</span> Permission denied
MySQL error code MY-000013<span class="token punctuation">:</span> Can<span class="token atrule">'t get stat of '</span>%s' <span class="token punctuation">(</span>OS errno %d - %s<span class="token punctuation">)</span></code></pre>
</div>
<p>
To obtain the error message for a MySQL Cluster error code, use
the
<a class="link" href="mysql-cluster-programs-ndb-perror.html" title="25.5.16 ndb_perror — Obtain NDB Error Message Information">
<span class="command">
<strong>
ndb_perror
</strong>
</span>
</a>
utility.
</p>
<p>
The meaning of system error messages may be dependent on your
operating system. A given error code may mean different things
on different operating systems.
</p>
<p>
<a class="link" href="perror.html" title="6.8.1 perror — Display MySQL Error Message Information">
<span class="command">
<strong>
perror
</strong>
</span>
</a>
supports the following options.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a name="option_perror_help">
</a>
<a class="link" href="perror.html#option_perror_help">
<code class="option">
--help
</code>
</a>
,
<a class="link" href="perror.html#option_perror_help">
<code class="option">
--info
</code>
</a>
,
<code class="option">
-I
</code>
,
<code class="option">
-?
</code>
</p>
<a class="indexterm" name="idm46045302842304">
</a>
<a class="indexterm" name="idm46045302840816">
</a>
<p>
Display a help message and exit.
</p>
</li>
<li class="listitem">
<p>
<a name="option_perror_silent">
</a>
<a class="link" href="perror.html#option_perror_silent">
<code class="option">
--silent
</code>
</a>
,
<code class="option">
-s
</code>
</p>
<a class="indexterm" name="idm46045302836240">
</a>
<a class="indexterm" name="idm46045302834752">
</a>
<p>
Silent mode. Print only the error message.
</p>
</li>
<li class="listitem">
<p>
<a name="option_perror_verbose">
</a>
<a class="link" href="perror.html#option_perror_verbose">
<code class="option">
--verbose
</code>
</a>
,
<code class="option">
-v
</code>
</p>
<a class="indexterm" name="idm46045302830128">
</a>
<a class="indexterm" name="idm46045302828640">
</a>
<p>
Verbose mode. Print error code and message. This is the
default behavior.
</p>
</li>
<li class="listitem">
<p>
<a name="option_perror_version">
</a>
<a class="link" href="perror.html#option_perror_version">
<code class="option">
--version
</code>
</a>
,
<code class="option">
-V
</code>
</p>
<a class="indexterm" name="idm46045302823920">
</a>
<a class="indexterm" name="idm46045302822432">
</a>
<p>
Display version information and exit.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/replica-io-thread-states.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="replica-io-thread-states">
</a>
10.14.5 Replication I/O (Receiver) Thread States
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045221264016">
</a>
<a class="indexterm" name="idm46045221262528">
</a>
<p>
The following list shows the most common states you see in the
<code class="literal">
State
</code>
column for a replication I/O (receiver)
thread on a replica server. This state also appears in the
<code class="literal">
Replica_IO_State
</code>
column displayed by
<a class="link" href="show-replica-status.html" title="15.7.7.35 SHOW REPLICA STATUS Statement">
<code class="literal">
SHOW
REPLICA STATUS
</code>
</a>
, so you can get a good view of what is
happening by using that statement.
</p>
<p>
In MySQL 8.0, incompatible changes were made to instrumentation
names. Monitoring tools that work with these instrumentation
names might be impacted. If the incompatible changes have an
impact for you, set the
<a class="link" href="replication-options-replica.html#sysvar_terminology_use_previous">
<code class="literal">
terminology_use_previous
</code>
</a>
system
variable to
<code class="literal">
BEFORE_8_0_26
</code>
to make MySQL
Server use the old versions of the names for the objects
specified in the previous list. This enables monitoring tools
that rely on the old names to continue working until they can be
updated to use the new names.
</p>
<p>
Set the
<a class="link" href="replication-options-replica.html#sysvar_terminology_use_previous">
<code class="literal">
terminology_use_previous
</code>
</a>
system
variable with session scope to support individual functions, or
global scope to be a default for all new sessions. When global
scope is used, the slow query log contains the old versions of
the names.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221251376">
</a>
<a class="indexterm" name="idm46045221249888">
</a>
<code class="literal">
Checking master version
</code>
</p>
<p>
<a class="indexterm" name="idm46045221247328">
</a>
<a class="indexterm" name="idm46045221245840">
</a>
<code class="literal">
Checking source version
</code>
</p>
<p>
A state that occurs very briefly, after the connection to
the source is established.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221242368">
</a>
<a class="indexterm" name="idm46045221240880">
</a>
<code class="literal">
Connecting to master
</code>
</p>
<p>
<a class="indexterm" name="idm46045221238320">
</a>
<a class="indexterm" name="idm46045221236832">
</a>
<code class="literal">
Connecting to source
</code>
</p>
<p>
The thread is attempting to connect to the source.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221233408">
</a>
<a class="indexterm" name="idm46045221231904">
</a>
<code class="literal">
Queueing master event to the relay log
</code>
</p>
<p>
<a class="indexterm" name="idm46045221229312">
</a>
<a class="indexterm" name="idm46045221227808">
</a>
<code class="literal">
Queueing source event to the relay log
</code>
</p>
<p>
The thread has read an event and is copying it to the relay
log so that the SQL thread can process it.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221224288">
</a>
<a class="indexterm" name="idm46045221222768">
</a>
<code class="literal">
Reconnecting after a failed binlog dump
request
</code>
</p>
<p>
The thread is trying to reconnect to the source.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221219264">
</a>
<a class="indexterm" name="idm46045221217744">
</a>
<code class="literal">
Reconnecting after a failed master event
read
</code>
</p>
<p>
<a class="indexterm" name="idm46045221215104">
</a>
<a class="indexterm" name="idm46045221213584">
</a>
<code class="literal">
Reconnecting after a failed source event
read
</code>
</p>
<p>
The thread is trying to reconnect to the source. When
connection is established again, the state becomes
<code class="literal">
Waiting for master to send event
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221209280">
</a>
<a class="indexterm" name="idm46045221207776">
</a>
<code class="literal">
Registering slave on master
</code>
</p>
<p>
<a class="indexterm" name="idm46045221205184">
</a>
<a class="indexterm" name="idm46045221203680">
</a>
<code class="literal">
Registering replica on source
</code>
</p>
<p>
A state that occurs very briefly after the connection to the
source is established.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221200192">
</a>
<a class="indexterm" name="idm46045221198704">
</a>
<code class="literal">
Requesting binlog dump
</code>
</p>
<p>
A state that occurs very briefly, after the connection to
the source is established. The thread sends to the source a
request for the contents of its binary logs, starting from
the requested binary log file name and position.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221195072">
</a>
<a class="indexterm" name="idm46045221193568">
</a>
<code class="literal">
Waiting for its turn to commit
</code>
</p>
<p>
A state that occurs when the replica thread is waiting for
older worker threads to commit if
<a class="link" href="replication-options-replica.html#sysvar_replica_preserve_commit_order">
<code class="literal">
replica_preserve_commit_order
</code>
</a>
is enabled.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221188768">
</a>
<a class="indexterm" name="idm46045221187264">
</a>
<code class="literal">
Waiting for master to send event
</code>
</p>
<p>
<a class="indexterm" name="idm46045221184672">
</a>
<a class="indexterm" name="idm46045221183168">
</a>
<code class="literal">
Waiting for source to send event
</code>
</p>
<p>
The thread has connected to the source and is waiting for
binary log events to arrive. This can last for a long time
if the source is idle. If the wait lasts for
<a class="link" href="replication-options-replica.html#sysvar_replica_net_timeout">
<code class="literal">
replica_net_timeout
</code>
</a>
seconds, a timeout occurs. At that point, the thread
considers the connection to be broken and makes an attempt
to reconnect.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221178112">
</a>
<a class="indexterm" name="idm46045221176656">
</a>
<code class="literal">
Waiting for master update
</code>
</p>
<p>
<a class="indexterm" name="idm46045221174064">
</a>
<a class="indexterm" name="idm46045221172560">
</a>
<code class="literal">
Waiting for source update
</code>
</p>
<p>
The initial state before
<code class="literal">
Connecting to
master
</code>
or
<code class="literal">
Connecting to source
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221167696">
</a>
<a class="indexterm" name="idm46045221166192">
</a>
<code class="literal">
Waiting for slave mutex on exit
</code>
</p>
<p>
<a class="indexterm" name="idm46045221163600">
</a>
<a class="indexterm" name="idm46045221162096">
</a>
<code class="literal">
Waiting for replica mutex on exit
</code>
</p>
<p>
A state that occurs briefly as the thread is stopping.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221158640">
</a>
<a class="indexterm" name="idm46045221157104">
</a>
<code class="literal">
Waiting for the slave SQL thread to free enough
relay log space
</code>
</p>
<p>
<a class="indexterm" name="idm46045221154432">
</a>
<a class="indexterm" name="idm46045221152896">
</a>
<code class="literal">
Waiting for the replica SQL thread to free enough
relay log space
</code>
</p>
<p>
You are using a nonzero
<a class="link" href="replication-options-replica.html#sysvar_relay_log_space_limit">
<code class="literal">
relay_log_space_limit
</code>
</a>
value, and the relay logs have grown large enough that their
combined size exceeds this value. The I/O (receiver) thread
is waiting until the SQL (applier) thread frees enough space
by processing relay log contents so that it can delete some
relay log files.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221147760">
</a>
<a class="indexterm" name="idm46045221146240">
</a>
<code class="literal">
Waiting to reconnect after a failed binlog dump
request
</code>
</p>
<p>
If the binary log dump request failed (due to
disconnection), the thread goes into this state while it
sleeps, then tries to reconnect periodically. The interval
between retries can be specified using the
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE TO
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045221141312">
</a>
<a class="indexterm" name="idm46045221139792">
</a>
<code class="literal">
Waiting to reconnect after a failed master event
read
</code>
</p>
<p>
<a class="indexterm" name="idm46045221137152">
</a>
<a class="indexterm" name="idm46045221135632">
</a>
<code class="literal">
Waiting to reconnect after a failed source event
read
</code>
</p>
<p>
An error occurred while reading (due to disconnection). The
thread is sleeping for the number of seconds set by the
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE TO
</code>
</a>
statement before attempting to reconnect.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/role-names.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="role-names">
</a>
8.2.5 Specifying Role Names
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045249894160">
</a>
<a class="indexterm" name="idm46045249893088">
</a>
<a class="indexterm" name="idm46045249891600">
</a>
<p>
MySQL role names refer to roles, which are named collections of
privileges. For role usage examples, see
<a class="xref" href="roles.html" title="8.2.10 Using Roles">
Section 8.2.10, “Using Roles”
</a>
.
</p>
<p>
Role names have syntax and semantics similar to account names; see
<a class="xref" href="account-names.html" title="8.2.4 Specifying Account Names">
Section 8.2.4, “Specifying Account Names”
</a>
. As stored in the grant tables,
they have the same properties as account names, which are
described in
<a class="xref" href="grant-tables.html#grant-tables-scope-column-properties" title="Grant Table Scope Column Properties">
Grant Table Scope Column Properties
</a>
.
</p>
<p>
Role names differ from account names in these respects:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The user part of role names cannot be blank. Thus, there is no
<span class="quote">
“
<span class="quote">
anonymous role
</span>
”
</span>
analogous to the concept of
<span class="quote">
“
<span class="quote">
anonymous user.
</span>
”
</span>
</p>
</li>
<li class="listitem">
<p>
As for an account name, omitting the host part of a role name
results in a host part of
<code class="literal">
'%'
</code>
. But unlike
<code class="literal">
'%'
</code>
in an account name, a host part of
<code class="literal">
'%'
</code>
in a role name has no wildcard
properties. For example, for a name
<code class="literal">
'me'@'%'
</code>
used as a role name, the host part
(
<code class="literal">
'%'
</code>
) is just a literal value; it has no
<span class="quote">
“
<span class="quote">
any host
</span>
”
</span>
matching property.
</p>
</li>
<li class="listitem">
<p>
Netmask notation in the host part of a role name has no
significance.
</p>
</li>
<li class="listitem">
<p>
An account name is permitted to be
<a class="link" href="information-functions.html#function_current-user">
<code class="literal">
CURRENT_USER()
</code>
</a>
in several
contexts. A role name is not.
</p>
</li>
</ul>
</div>
<p>
It is possible for a row in the
<code class="literal">
mysql.user
</code>
system table to serve as both an account and a role. In this case,
any special user or host name matching properties do not apply in
contexts for which the name is used as a role name. For example,
you cannot execute the following statement with the expectation
that it sets the current session roles using all roles that have a
user part of
<code class="literal">
myrole
</code>
and any host name:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa66019502"><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">ROLE</span> <span class="token string">'myrole'</span>@<span class="token string">'%'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Instead, the statement sets the active role for the session to the
role with exactly the name
<code class="literal">
'myrole'@'%'
</code>
.
</p>
<p>
For this reason, role names are often specified using only the
user name part and letting the host name part implicitly be
<code class="literal">
'%'
</code>
. Specifying a role with a
non-
<code class="literal">
'%'
</code>
host part can be useful if you intend
to create a name that works both as a role an as a user account
that is permitted to connect from the given host.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/data-masking-components-vs-plugin.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="data-masking-components-vs-plugin">
</a>
8.5.1 Data-Masking Components Versus the Data-Masking Plugin
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045233491696">
</a>
<a class="indexterm" name="idm46045233490160">
</a>
<p>
Previously, MySQL enabled masking and de-identification
capabilities using a server-side plugin, but transitioned to use
the component infrastructure as an alternative implementation. The
following table briefly compares MySQL Enterprise Data Masking and De-Identification components and the
plugin library to provide an overview of their differences. It may
assist you in making the transition from the plugin to components.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Only the data-masking components or the plugin should be enabled
at a time. Enabling both components and the plugin is
unsupported and results may not be as anticipated.
</p>
</div>
<div class="table">
<a name="data-masking-component-vs-plugin">
</a>
<p class="title">
<b>
Table 8.45 Comparison Between Data-Masking Components and Plugin Elements
</b>
</p>
<div class="table-contents">
<table>
<colgroup>
<col width="50%"/>
<col width="25%"/>
<col width="25%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
Category
</th>
<th scope="col">
Components
</th>
<th scope="col">
Plugin
</th>
</tr>
</thead>
<tbody>
<tr>
<td scope="row">
Interface
</td>
<td>
Service functions, loadable functions
</td>
<td>
Loadable functions
</td>
</tr>
<tr>
<td scope="row">
Support for multibyte character sets
</td>
<td>
Yes, for general-purpose masking functions
</td>
<td>
No
</td>
</tr>
<tr>
<td scope="row">
General-purpose masking functions
</td>
<td>
<a class="link" href="data-masking-component-functions.html#function_mask-inner">
<code class="literal">
mask_inner()
</code>
</a>
,
<a class="link" href="data-masking-component-functions.html#function_mask-outer">
<code class="literal">
mask_outer()
</code>
</a>
</td>
<td>
<a class="link" href="data-masking-plugin-functions.html#function_mask-inner-plugin">
<code class="literal">
mask_inner()
</code>
</a>
,
<a class="link" href="data-masking-plugin-functions.html#function_mask-outer-plugin">
<code class="literal">
mask_outer()
</code>
</a>
</td>
</tr>
<tr>
<td scope="row">
Masking of specific types
</td>
<td>
PAN, SSN, IBAN, UUID, Canada SIN, UK NIN
</td>
<td>
PAN, SSN
</td>
</tr>
<tr>
<td scope="row">
Random generation, specific types
</td>
<td>
email, US phone, PAN, SSN, IBAN, UUID, Canada SIN, UK NIN
</td>
<td>
email, US phone, PAN, SSN
</td>
</tr>
<tr>
<td scope="row">
Random generation of integer from given range
</td>
<td>
Yes
</td>
<td>
Yes
</td>
</tr>
<tr>
<td scope="row">
Persisting substitution dictionaries
</td>
<td>
Database
</td>
<td>
File
</td>
</tr>
<tr>
<td scope="row">
Privilege to manage dictionaries
</td>
<td>
Dedicated privilege
</td>
<td>
FILE
</td>
</tr>
<tr>
<td scope="row">
Automated loadable-function registration/deregistration during
installation/uninstallation
</td>
<td>
Yes
</td>
<td>
No
</td>
</tr>
<tr>
<td scope="row">
Enhancements to existing functions
</td>
<td>
More arguments added to the
<a class="link" href="data-masking-component-functions.html#function_gen-rnd-email">
<code class="literal">
gen_rnd_email()
</code>
</a>
function
</td>
<td>
N/A
</td>
</tr>
</tbody>
</table>
</div>
<div class="table-contents">
<table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
<thead>
<tr>
<th scope="col" style="width: 369px;">
Category
</th>
<th scope="col" style="width: 184.5px;">
Components
</th>
<th scope="col" style="width: 184.5px;">
Plugin
</th>
</tr>
</thead>
</table>
</div>
</div>
<br class="table-break"/>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-install-first-start.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="mysql-cluster-install-first-start">
</a>
25.3.4 Initial Startup of NDB Cluster
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045122217312">
</a>
<p>
Starting the cluster is not very difficult after it has been
configured. Each cluster node process must be started separately,
and on the host where it resides. The management node should be
started first, followed by the data nodes, and then finally by any
SQL nodes:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
On the management host, issue the following command from the
system shell to start the management node process:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa82515273"><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">$> </span><span class="token command">ndb_mgmd</span> <span class="token property">--initial</span> <span class="token property">-f</span> /var/lib/mysql-cluster/config<span class="token punctuation">.</span>ini</code></pre>
</div>
<p>
The first time that it is started,
<a class="link" href="mysql-cluster-programs-ndb-mgmd.html" title="25.5.4 ndb_mgmd — The NDB Cluster Management Server Daemon">
<span class="command">
<strong>
ndb_mgmd
</strong>
</span>
</a>
must be told where to find its configuration file, using the
<code class="option">
-f
</code>
or
<a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_config-file">
<code class="option">
--config-file
</code>
</a>
option. This
option requires that
<a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_initial">
<code class="option">
--initial
</code>
</a>
or
<a class="link" href="mysql-cluster-programs-ndb-mgmd.html#option_ndb_mgmd_reload">
<code class="option">
--reload
</code>
</a>
also be specified;
see
<a class="xref" href="mysql-cluster-programs-ndb-mgmd.html" title="25.5.4 ndb_mgmd — The NDB Cluster Management Server Daemon">
Section 25.5.4, “ndb_mgmd — The NDB Cluster Management Server Daemon”
</a>
, for
details.
</p>
</li>
<li class="listitem">
<p>
On each of the data node hosts, run this command to start the
<a class="link" href="mysql-cluster-programs-ndbd.html" title="25.5.1 ndbd — The NDB Cluster Data Node Daemon">
<span class="command">
<strong>
ndbd
</strong>
</span>
</a>
process:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa62921103"><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">$> </span><span class="token command">ndbd</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
If you used RPM files to install MySQL on the cluster host
where the SQL node is to reside, you can (and should) use the
supplied startup script to start the MySQL server process on
the SQL node.
</p>
</li>
</ol>
</div>
<a class="indexterm" name="idm46045122200864">
</a>
<a class="indexterm" name="idm46045122199376">
</a>
<p>
If all has gone well, and the cluster has been set up correctly,
the cluster should now be operational. You can test this by
invoking the
<a class="link" href="mysql-cluster-programs-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client">
<span class="command">
<strong>
ndb_mgm
</strong>
</span>
</a>
management node client.
The output should look like that shown here, although you might
see some slight differences in the output depending upon the exact
version of MySQL that you are using:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-ndbmgm"><div class="docs-select-all right" id="sa94324881"><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-ndbmgm">$<span class="token operator">></span> ndb_mgm
<span class="token operator">--</span> NDB Cluster <span class="token operator">--</span> Management Client <span class="token operator">--</span>
<span class="token prompt">ndb_mgm></span> <span class="token keyword">SHOW</span>
Connected to Management Server at<span class="token operator">:</span> localhost<span class="token operator">:</span>1186 <span class="token punctuation">(</span>using cleartext<span class="token punctuation">)</span>
Cluster Configuration
<span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">-</span>
<span class="token selector">[ndbd(NDB)]</span> 2 node<span class="token punctuation">(</span>s<span class="token punctuation">)</span>
id<span class="token operator">=</span>2 @198<span class="token punctuation">.</span>51<span class="token punctuation">.</span>100<span class="token punctuation">.</span>30 <span class="token punctuation">(</span>Version<span class="token operator">:</span> 8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0<span class="token operator">-</span>ndb<span class="token operator">-</span>8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0<span class="token punctuation">,</span> Nodegroup<span class="token operator">:</span> 0<span class="token punctuation">,</span> <span class="token operator">*</span><span class="token punctuation">)</span>
id<span class="token operator">=</span>3 @198<span class="token punctuation">.</span>51<span class="token punctuation">.</span>100<span class="token punctuation">.</span>40 <span class="token punctuation">(</span>Version<span class="token operator">:</span> 8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0<span class="token operator">-</span>ndb<span class="token operator">-</span>8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0<span class="token punctuation">,</span> Nodegroup<span class="token operator">:</span> 0<span class="token punctuation">)</span>
<span class="token selector">[ndb_mgmd(MGM)]</span> 1 node<span class="token punctuation">(</span>s<span class="token punctuation">)</span>
id<span class="token operator">=</span>1 @198<span class="token punctuation">.</span>51<span class="token punctuation">.</span>100<span class="token punctuation">.</span>10 <span class="token punctuation">(</span>Version<span class="token operator">:</span> 8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0<span class="token operator">-</span>ndb<span class="token operator">-</span>8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0<span class="token punctuation">)</span>
<span class="token selector">[mysqld(API)]</span> 1 node<span class="token punctuation">(</span>s<span class="token punctuation">)</span>
id<span class="token operator">=</span>4 @198<span class="token punctuation">.</span>51<span class="token punctuation">.</span>100<span class="token punctuation">.</span>20 <span class="token punctuation">(</span>Version<span class="token operator">:</span> 8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0<span class="token operator">-</span>ndb<span class="token operator">-</span>8<span class="token punctuation">.</span>4<span class="token punctuation">.</span>0<span class="token punctuation">)</span></code></pre>
</div>
<p>
The SQL node is referenced here as
<code class="literal">
[mysqld(API)]
</code>
, which reflects the fact that the
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
process is acting as an NDB Cluster API
node.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
The IP address shown for a given NDB Cluster SQL or other API
node in the output of
<a class="link" href="mysql-cluster-mgm-client-commands.html#ndbclient-show">
<code class="literal">
SHOW
</code>
</a>
is the address used by the SQL or API node to connect to the
cluster data nodes, and not to any management node.
</p>
</div>
<p>
You should now be ready to work with databases, tables, and data
in NDB Cluster. See
<a class="xref" href="mysql-cluster-install-example-data.html" title="25.3.5 NDB Cluster Example with Tables and Data">
Section 25.3.5, “NDB Cluster Example with Tables and Data”
</a>
, for a brief
discussion.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/performance-schema-clone-status-table.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="performance-schema-clone-status-table">
</a>
29.12.19.1 The clone_status Table
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045069457376">
</a>
<a class="indexterm" name="idm46045069455888">
</a>
<p>
The
<code class="literal">
clone_status
</code>
table shows the status of
the current or last executed cloning operation only. The table
only ever contains one row of data, or is empty.
</p>
<p>
The
<code class="literal">
clone_status
</code>
table has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
ID
</code>
</p>
<p>
A unique cloning operation identifier in the current MySQL
server instance.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PID
</code>
</p>
<p>
Process list ID of the session executing the cloning
operation.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
STATE
</code>
</p>
<p>
Current state of the cloning operation. Values include
<code class="literal">
Not Started
</code>
,
<code class="literal">
In
Progress
</code>
,
<code class="literal">
Completed
</code>
, and
<code class="literal">
Failed
</code>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
BEGIN_TIME
</code>
</p>
<p>
A timestamp in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format that shows when the cloning operation started.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
END_TIME
</code>
</p>
<p>
A timestamp in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format that shows when the cloning operation finished.
Reports NULL if the operation has not ended.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
SOURCE
</code>
</p>
<p>
The donor MySQL server address in
'
<code class="literal">
HOST:PORT
</code>
' format. The column displays
'
<code class="literal">
LOCAL INSTANCE
</code>
' for a local cloning
operation.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DESTINATION
</code>
</p>
<p>
The directory being cloned to.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ERROR_NO
</code>
</p>
<p>
The error number reported for a failed cloning operation.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ERROR_MESSAGE
</code>
</p>
<p>
The error message string for a failed cloning operation.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
BINLOG_FILE
</code>
</p>
<p>
The name of the binary log file up to which data is
cloned.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
BINLOG_POSITION
</code>
</p>
<p>
The binary log file offset up to which data is cloned.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
GTID_EXECUTED
</code>
</p>
<p>
The GTID value for the last cloned transaction.
</p>
</li>
</ul>
</div>
<p>
The
<code class="literal">
clone_status
</code>
table is read-only. DDL,
including
<a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
<code class="literal">
TRUNCATE TABLE
</code>
</a>
, is
not permitted.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/programs-server.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="programs-server">
</a>
6.3 Server and Server-Startup Programs
</h2>
</div>
</div>
</div>
<div class="toc">
<dl class="toc">
<dt>
<span class="section">
<a href="mysqld.html">
6.3.1 mysqld — The MySQL Server
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="mysqld-safe.html">
6.3.2 mysqld_safe — MySQL Server Startup Script
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="mysql-server.html">
6.3.3 mysql.server — MySQL Server Startup Script
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="mysqld-multi.html">
6.3.4 mysqld_multi — Manage Multiple MySQL Servers
</a>
</span>
</dt>
</dl>
</div>
<p>
This section describes
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
, the MySQL server,
and several programs that are used to start the server.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/myisamchk-check-options.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="myisamchk-check-options">
</a>
6.6.4.2 myisamchk Check Options
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045307240496">
</a>
<a class="indexterm" name="idm46045307239008">
</a>
<p>
<a class="link" href="myisamchk.html" title="6.6.4 myisamchk — MyISAM Table-Maintenance Utility">
<span class="command">
<strong>
myisamchk
</strong>
</span>
</a>
supports the following options for
table checking operations:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a name="option_myisamchk_check">
</a>
<a class="link" href="myisamchk-check-options.html#option_myisamchk_check">
<code class="option">
--check
</code>
</a>
,
<code class="option">
-c
</code>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for check">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--check
</code>
</td>
</tr>
</tbody>
</table>
</div>
<a class="indexterm" name="idm46045307227728">
</a>
<a class="indexterm" name="idm46045307226240">
</a>
<p>
Check the table for errors. This is the default operation if
you specify no option that selects an operation type
explicitly.
</p>
</li>
<li class="listitem">
<p>
<a name="option_myisamchk_check-only-changed">
</a>
<a class="link" href="myisamchk-check-options.html#option_myisamchk_check-only-changed">
<code class="option">
--check-only-changed
</code>
</a>
,
<code class="option">
-C
</code>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for check-only-changed">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--check-only-changed
</code>
</td>
</tr>
</tbody>
</table>
</div>
<a class="indexterm" name="idm46045307216048">
</a>
<a class="indexterm" name="idm46045307214544">
</a>
<p>
Check only tables that have changed since the last check.
</p>
</li>
<li class="listitem">
<p>
<a name="option_myisamchk_extend-check">
</a>
<a class="link" href="myisamchk-check-options.html#option_myisamchk_extend-check">
<code class="option">
--extend-check
</code>
</a>
,
<code class="option">
-e
</code>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for extend-check">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--extend-check
</code>
</td>
</tr>
</tbody>
</table>
</div>
<a class="indexterm" name="idm46045307204496">
</a>
<a class="indexterm" name="idm46045307203008">
</a>
<p>
Check the table very thoroughly. This is quite slow if the
table has many indexes. This option should only be used in
extreme cases. Normally,
<a class="link" href="myisamchk.html" title="6.6.4 myisamchk — MyISAM Table-Maintenance Utility">
<span class="command">
<strong>
myisamchk
</strong>
</span>
</a>
or
<a class="link" href="myisamchk.html" title="6.6.4 myisamchk — MyISAM Table-Maintenance Utility">
<span class="command">
<strong>
myisamchk --medium-check
</strong>
</span>
</a>
should be able
to determine whether there are any errors in the table.
</p>
<p>
If you are using
<a class="link" href="myisamchk-check-options.html#option_myisamchk_extend-check">
<code class="option">
--extend-check
</code>
</a>
and have
plenty of memory, setting the
<code class="literal">
key_buffer_size
</code>
variable to a large value
helps the repair operation run faster.
</p>
<p>
See also the description of this option under table repair
options.
</p>
<p>
For a description of the output format, see
<a class="xref" href="myisamchk-table-info.html" title="6.6.4.5 Obtaining Table Information with myisamchk">
Section 6.6.4.5, “Obtaining Table Information with myisamchk”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="option_myisamchk_fast">
</a>
<a class="link" href="myisamchk-check-options.html#option_myisamchk_fast">
<code class="option">
--fast
</code>
</a>
,
<code class="option">
-F
</code>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for fast">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--fast
</code>
</td>
</tr>
</tbody>
</table>
</div>
<a class="indexterm" name="idm46045307186240">
</a>
<a class="indexterm" name="idm46045307184752">
</a>
<p>
Check only tables that haven't been closed properly.
</p>
</li>
<li class="listitem">
<p>
<a name="option_myisamchk_force">
</a>
<a class="link" href="myisamchk-check-options.html#option_myisamchk_force">
<code class="option">
--force
</code>
</a>
,
<code class="option">
-f
</code>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for force">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--force
</code>
</td>
</tr>
</tbody>
</table>
</div>
<a class="indexterm" name="idm46045307174736">
</a>
<a class="indexterm" name="idm46045307173248">
</a>
<p>
Do a repair operation automatically if
<a class="link" href="myisamchk.html" title="6.6.4 myisamchk — MyISAM Table-Maintenance Utility">
<span class="command">
<strong>
myisamchk
</strong>
</span>
</a>
finds any errors in the table.
The repair type is the same as that specified with the
<a class="link" href="myisamchk-repair-options.html#option_myisamchk_recover">
<code class="option">
--recover
</code>
</a>
or
<code class="option">
-r
</code>
option.
</p>
</li>
<li class="listitem">
<p>
<a name="option_myisamchk_information">
</a>
<a class="link" href="myisamchk-check-options.html#option_myisamchk_information">
<code class="option">
--information
</code>
</a>
,
<code class="option">
-i
</code>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for information">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--information
</code>
</td>
</tr>
</tbody>
</table>
</div>
<a class="indexterm" name="idm46045307160432">
</a>
<a class="indexterm" name="idm46045307158944">
</a>
<p>
Print informational statistics about the table that is
checked.
</p>
</li>
<li class="listitem">
<p>
<a name="option_myisamchk_medium-check">
</a>
<a class="link" href="myisamchk-check-options.html#option_myisamchk_medium-check">
<code class="option">
--medium-check
</code>
</a>
,
<code class="option">
-m
</code>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for medium-check">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--medium-check
</code>
</td>
</tr>
</tbody>
</table>
</div>
<a class="indexterm" name="idm46045307148896">
</a>
<a class="indexterm" name="idm46045307147408">
</a>
<p>
Do a check that is faster than an
<a class="link" href="myisamchk-check-options.html#option_myisamchk_extend-check">
<code class="option">
--extend-check
</code>
</a>
operation.
This finds only 99.99% of all errors, which should be good
enough in most cases.
</p>
</li>
<li class="listitem">
<p>
<a name="option_myisamchk_read-only">
</a>
<a class="link" href="myisamchk-check-options.html#option_myisamchk_read-only">
<code class="option">
--read-only
</code>
</a>
,
<code class="option">
-T
</code>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for read-only">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--read-only
</code>
</td>
</tr>
</tbody>
</table>
</div>
<a class="indexterm" name="idm46045307136288">
</a>
<a class="indexterm" name="idm46045307134800">
</a>
<p>
Do not mark the table as checked. This is useful if you use
<a class="link" href="myisamchk.html" title="6.6.4 myisamchk — MyISAM Table-Maintenance Utility">
<span class="command">
<strong>
myisamchk
</strong>
</span>
</a>
to check a table that is in use
by some other application that does not use locking, such as
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
when run with external locking
disabled.
</p>
</li>
<li class="listitem">
<p>
<a name="option_myisamchk_update-state">
</a>
<a class="link" href="myisamchk-check-options.html#option_myisamchk_update-state">
<code class="option">
--update-state
</code>
</a>
,
<code class="option">
-U
</code>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for update-state">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--update-state
</code>
</td>
</tr>
</tbody>
</table>
</div>
<a class="indexterm" name="idm46045307122096">
</a>
<a class="indexterm" name="idm46045307120608">
</a>
<p>
Store information in the
<code class="filename">
.MYI
</code>
file to
indicate when the table was checked and whether the table
crashed. This should be used to get full benefit of the
<a class="link" href="myisamchk-check-options.html#option_myisamchk_check-only-changed">
<code class="option">
--check-only-changed
</code>
</a>
option, but you shouldn't use this option if the
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
server is using the table and you
are running it with external locking disabled.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/validate-password-installation.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="validate-password-installation">
</a>
8.4.3.1 Password Validation Component Installation and Uninstallation
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045241757456">
</a>
<a class="indexterm" name="idm46045241756000">
</a>
<a class="indexterm" name="idm46045241754496">
</a>
<a class="indexterm" name="idm46045241753008">
</a>
<p>
This section describes how to install and uninstall the
<code class="literal">
validate_password
</code>
password-validation
component. For general information about installing and
uninstalling components, see
<a class="xref" href="components.html" title="7.5 MySQL Components">
Section 7.5, “MySQL Components”
</a>
.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
If you install MySQL 8.4 using the
<a class="ulink" href="https://dev.mysql.com/downloads/repo/yum/" target="_top">
MySQL Yum
repository
</a>
,
<a class="ulink" href="https://dev.mysql.com/downloads/repo/suse/" target="_top">
MySQL SLES
Repository
</a>
, or
<a class="link" href="linux-installation-rpm.html" title="2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle">
RPM packages provided
by Oracle
</a>
, the
<code class="literal">
validate_password
</code>
component is enabled by default after you start your MySQL
Server for the first time.
</p>
<p>
Upgrades to MySQL 8.4 from 8.3
using Yum or RPM packages leave the
<code class="literal">
validate_password
</code>
plugin in place. To make
the transition from the
<code class="literal">
validate_password
</code>
plugin to the
<code class="literal">
validate_password
</code>
component,
see
<a class="xref" href="validate-password-transitioning.html" title="8.4.3.3 Transitioning to the Password Validation Component">
Section 8.4.3.3, “Transitioning to the Password Validation Component”
</a>
.
</p>
</div>
<p>
To be usable by the server, the component library file must be
located in the MySQL plugin directory (the directory named by
the
<a class="link" href="server-system-variables.html#sysvar_plugin_dir">
<code class="literal">
plugin_dir
</code>
</a>
system
variable). If necessary, configure the plugin directory location
by setting the value of
<a class="link" href="server-system-variables.html#sysvar_plugin_dir">
<code class="literal">
plugin_dir
</code>
</a>
at server startup.
</p>
<p>
To install the
<code class="literal">
validate_password
</code>
component,
use this statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa54012447"><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">INSTALL</span> <span class="token keyword">COMPONENT</span> <span class="token string">'file://component_validate_password'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Component installation is a one-time operation that need not be
done per server startup.
<a class="link" href="install-component.html" title="15.7.4.3 INSTALL COMPONENT Statement">
<code class="literal">
INSTALL
COMPONENT
</code>
</a>
loads the component, and also registers it
in the
<code class="literal">
mysql.component
</code>
system table to cause
it to be loaded during subsequent server startups.
</p>
<p>
To uninstall the
<code class="literal">
validate_password
</code>
component,
use this statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa65214366"><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">UNINSTALL</span> <span class="token keyword">COMPONENT</span> <span class="token string">'file://component_validate_password'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
<a class="link" href="uninstall-component.html" title="15.7.4.5 UNINSTALL COMPONENT Statement">
<code class="literal">
UNINSTALL COMPONENT
</code>
</a>
unloads the
component, and unregisters it from the
<code class="literal">
mysql.component
</code>
system table to cause it not
to be loaded during subsequent server startups.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="server-system-variables">
</a>
7.1.8 Server System Variables
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045278726128">
</a>
<a class="indexterm" name="idm46045278725056">
</a>
<a class="indexterm" name="idm46045278723568">
</a>
<p>
The MySQL server maintains many system variables that affect its
operation. Most 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 at runtime 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, which enables you to modify operation of the server
without having to stop and restart it. Some variables are
read-only, and their values are determined by the system
environment, by how MySQL is installed on the system, or possibly
by the options used to compile MySQL. Most system variables have a
default value, but there are exceptions, including read-only
variables. You can also use system variable values in expressions.
</p>
<p>
Setting a global system variable runtime value normally requires
the
<a class="link" href="privileges-provided.html#priv_system-variables-admin">
<code class="literal">
SYSTEM_VARIABLES_ADMIN
</code>
</a>
privilege (or the deprecated
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege). Setting a session system runtime variable value
normally requires no special privileges and can be done by any
user, although there are exceptions. For more information, 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>
There are several ways to see the names and values of system
variables:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
To see the values that a server uses based on its compiled-in
defaults and any option files that it reads, use this command:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa5921026"><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 property">--verbose</span> <span class="token property">--help</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
To see the values that a server uses based only on its
compiled-in defaults, ignoring the settings in any option
files, use this command:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa43122592"><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 property">--no-defaults</span> <span class="token property">--verbose</span> <span class="token property">--help</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
To see the current values used by a running server, 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 or the
Performance Schema system variable tables. See
<a class="xref" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
Section 29.12.14, “Performance Schema System Variable Tables”
</a>
.
</p>
</li>
</ul>
</div>
<p>
This section provides a description of each system variable. For a
system variable summary table, see
<a class="xref" href="server-system-variable-reference.html" title="7.1.5 Server System Variable Reference">
Section 7.1.5, “Server System Variable Reference”
</a>
. For more
information about manipulation of system variables, see
<a class="xref" href="using-system-variables.html" title="7.1.9 Using System Variables">
Section 7.1.9, “Using System Variables”
</a>
.
</p>
<p>
For additional system variable information, see these sections:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="xref" href="using-system-variables.html" title="7.1.9 Using System Variables">
Section 7.1.9, “Using System Variables”
</a>
, discusses the syntax
for setting and displaying system variable values.
</p>
</li>
<li class="listitem">
<p>
<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>
, lists the
variables that can be set at runtime.
</p>
</li>
<li class="listitem">
<p>
Information on tuning system variables can be found in
<a class="xref" href="server-configuration.html" title="7.1.1 Configuring the Server">
Section 7.1.1, “Configuring the Server”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="innodb-parameters.html" title="17.14 InnoDB Startup Options and System Variables">
Section 17.14, “InnoDB Startup Options and System Variables”
</a>
, lists
<code class="literal">
InnoDB
</code>
system variables.
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-options-variables.html#mysql-cluster-system-variables" title="25.4.3.9.2 NDB Cluster System Variables">
Section 25.4.3.9.2, “NDB Cluster System Variables”
</a>
, lists system
variables which are specific to NDB Cluster.
</p>
</li>
<li class="listitem">
<p>
For information on server system variables specific to
replication, see
<a class="xref" href="replication-options.html" title="19.1.6 Replication and Binary Logging Options and Variables">
Section 19.1.6, “Replication and Binary Logging Options and Variables”
</a>
.
</p>
</li>
</ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Some of the following variable descriptions refer to
<span class="quote">
“
<span class="quote">
enabling
</span>
”
</span>
or
<span class="quote">
“
<span class="quote">
disabling
</span>
”
</span>
a variable.
These variables can be enabled 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 by setting them to
<code class="literal">
ON
</code>
or
<code class="literal">
1
</code>
, or disabled by setting them to
<code class="literal">
OFF
</code>
or
<code class="literal">
0
</code>
. Boolean
variables can be set at startup to the values
<code class="literal">
ON
</code>
,
<code class="literal">
TRUE
</code>
,
<code class="literal">
OFF
</code>
, and
<code class="literal">
FALSE
</code>
(not
case-sensitive), as well as
<code class="literal">
1
</code>
and
<code class="literal">
0
</code>
. See
<a class="xref" href="option-modifiers.html" title="6.2.2.4 Program Option Modifiers">
Section 6.2.2.4, “Program Option Modifiers”
</a>
.
</p>
</div>
<p>
Some system variables control the size of buffers or caches. For a
given buffer, the server might need to allocate internal data
structures. These structures typically are allocated from the
total memory allocated to the buffer, and the amount of space
required might be platform dependent. This means that when you
assign a value to a system variable that controls a buffer size,
the amount of space actually available might differ from the value
assigned. In some cases, the amount might be less than the value
assigned. It is also possible that the server adjusts a value
upward. For example, if you assign a value of 0 to a variable for
which the minimal value is 1024, the server sets the value to
1024.
</p>
<p>
Values for buffer sizes, lengths, and stack sizes are given in
bytes unless otherwise specified.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
<a name="system-variables-block-size">
</a>
Note
</div>
<p>
Some system variable descriptions include a block size, in which
case a value that is not an integer multiple of the stated block
size is rounded down to the next lower multiple of the block
size before being stored by the server, that is to
<a class="link" href="mathematical-functions.html#function_floor">
<code class="literal">
FLOOR(
<em class="replaceable">
<code>
value
</code>
</em>
)
</code>
</a>
<code class="literal">
*
<em class="replaceable">
<code>
block_size
</code>
</em>
</code>
.
</p>
<p>
<span class="emphasis">
<em>
Example
</em>
</span>
: Suppose that the block size for a
given variable is given as 4096, and you set the value of the
variable to 100000 (we assume that the variable's maximum
value is greater than this number). Since 100000 / 4096 =
24.4140625, the server automatically lowers the value to 98304
(24 * 4096) before storing it.
</p>
<p>
In some cases, the stated maximum for a variable is the maximum
allowed by the MySQL parser, but is not an exact multiple of the
block size. In such cases, the effective maximum is the next
lower multiple of the block size.
</p>
<p>
<span class="emphasis">
<em>
Example
</em>
</span>
: A system variable's maxmum
value is shown as 4294967295 (2
<sup>
32
</sup>
-1),
and its block size is 1024. 4294967295 / 1024 =
4194303.9990234375, so if you set this variable to its stated
maximum, the value actually stored is 4194303 * 1024 =
4294966272.
</p>
</div>
<p>
Some system variables take file name values. Unless otherwise
specified, the default file location is the data directory if the
value is a relative path name. To specify the location explicitly,
use an absolute path name. Suppose that the data directory is
<code class="filename">
/var/mysql/data
</code>
. If a file-valued variable is
given as a relative path name, it is located under
<code class="filename">
/var/mysql/data
</code>
. If the value is an absolute
path name, its location is as given by the path name.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a name="sysvar_activate_all_roles_on_login">
</a>
<a class="link" href="server-system-variables.html#sysvar_activate_all_roles_on_login">
<code class="literal">
activate_all_roles_on_login
</code>
</a>
</p>
<a class="indexterm" name="idm46045278669888">
</a>
<a class="indexterm" name="idm46045278668784">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for activate_all_roles_on_login">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--activate-all-roles-on-login[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_activate_all_roles_on_login">
activate_all_roles_on_login
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether to enable automatic activation of all granted roles
when users log in to the server:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If
<a class="link" href="server-system-variables.html#sysvar_activate_all_roles_on_login">
<code class="literal">
activate_all_roles_on_login
</code>
</a>
is enabled, the server activates all roles granted to each
account at login time. This takes precedence over default
roles specified with
<a class="link" href="set-default-role.html" title="15.7.1.9 SET DEFAULT ROLE Statement">
<code class="literal">
SET DEFAULT
ROLE
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
If
<a class="link" href="server-system-variables.html#sysvar_activate_all_roles_on_login">
<code class="literal">
activate_all_roles_on_login
</code>
</a>
is disabled, the server activates the default roles
specified with
<a class="link" href="set-default-role.html" title="15.7.1.9 SET DEFAULT ROLE Statement">
<code class="literal">
SET DEFAULT
ROLE
</code>
</a>
, if any, at login time.
</p>
</li>
</ul>
</div>
<p>
Granted roles include those granted explicitly to the user and
those named in the
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
<code class="literal">
mandatory_roles
</code>
</a>
system
variable value.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_activate_all_roles_on_login">
<code class="literal">
activate_all_roles_on_login
</code>
</a>
applies only at login time, and at the beginning of execution
for stored programs and views that execute in definer context.
To change the active roles within a session, use
<a class="link" href="set-role.html" title="15.7.1.11 SET ROLE Statement">
<code class="literal">
SET ROLE
</code>
</a>
. To change the active
roles for a stored program, the program body should execute
<a class="link" href="set-role.html" title="15.7.1.11 SET ROLE Statement">
<code class="literal">
SET ROLE
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_admin_address">
</a>
<a class="link" href="server-system-variables.html#sysvar_admin_address">
<code class="literal">
admin_address
</code>
</a>
</p>
<a class="indexterm" name="idm46045278630368">
</a>
<a class="indexterm" name="idm46045278629280">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for admin_address">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--admin-address=addr
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_admin_address">
admin_address
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
The IP address on which to listen for TCP/IP connections on
the administrative network interface (see
<a class="xref" href="connection-interfaces.html" title="7.1.12.1 Connection Interfaces">
Section 7.1.12.1, “Connection Interfaces”
</a>
). There is no default
<a class="link" href="server-system-variables.html#sysvar_admin_address">
<code class="literal">
admin_address
</code>
</a>
value. If this
variable is not specified at startup, the server maintains no
administrative interface. The server also has a
<a class="link" href="server-system-variables.html#sysvar_bind_address">
<code class="literal">
bind_address
</code>
</a>
system variable
for configuring regular (nonadministrative) client TCP/IP
connections. See
<a class="xref" href="connection-interfaces.html" title="7.1.12.1 Connection Interfaces">
Section 7.1.12.1, “Connection Interfaces”
</a>
.
</p>
<p>
If
<a class="link" href="server-system-variables.html#sysvar_admin_address">
<code class="literal">
admin_address
</code>
</a>
is
specified, its value must satisfy these requirements:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
The value must be a single IPv4 address, IPv6 address, or
host name.
</p>
</li>
<li class="listitem">
<p>
The value cannot specify a wildcard address format
(
<code class="literal">
*
</code>
,
<code class="literal">
0.0.0.0
</code>
, or
<code class="literal">
::
</code>
).
</p>
</li>
<li class="listitem">
<p>
The value may include a network namespace specifier.
</p>
</li>
</ul>
</div>
<p>
An IP address can be specified as an IPv4 or IPv6 address. If
the value is a host name, the server resolves the name to an
IP address and binds to that address. If a host name resolves
to multiple IP addresses, the server uses the first IPv4
address if there are any, or the first IPv6 address otherwise.
</p>
<p>
The server treats different types of addresses as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If the address is an IPv4-mapped address, the server
accepts TCP/IP connections for that address, in either
IPv4 or IPv6 format. For example, if the server is bound
to
<code class="literal">
::ffff:127.0.0.1
</code>
, clients can
connect using
<code class="option">
--host=127.0.0.1
</code>
or
<code class="option">
--host=::ffff:127.0.0.1
</code>
.
</p>
</li>
<li class="listitem">
<p>
If the address is a
<span class="quote">
“
<span class="quote">
regular
</span>
”
</span>
IPv4 or IPv6
address (such as
<code class="literal">
127.0.0.1
</code>
or
<code class="literal">
::1
</code>
), the server accepts TCP/IP
connections only for that IPv4 or IPv6 address.
</p>
</li>
</ul>
</div>
<p>
These rules apply to specifying a network namespace for an
address:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
A network namespace can be specified for an IP address or
a host name.
</p>
</li>
<li class="listitem">
<p>
A network namespace cannot be specified for a wildcard IP
address.
</p>
</li>
<li class="listitem">
<p>
For a given address, the network namespace is optional. If
given, it must be specified as a
<code class="literal">
/
<em class="replaceable">
<code>
ns
</code>
</em>
</code>
suffix
immediately following the address.
</p>
</li>
<li class="listitem">
<p>
An address with no
<code class="literal">
/
<em class="replaceable">
<code>
ns
</code>
</em>
</code>
suffix
uses the host system global namespace. The global
namespace is therefore the default.
</p>
</li>
<li class="listitem">
<p>
An address with a
<code class="literal">
/
<em class="replaceable">
<code>
ns
</code>
</em>
</code>
suffix
uses the namespace named
<em class="replaceable">
<code>
ns
</code>
</em>
.
</p>
</li>
<li class="listitem">
<p>
The host system must support network namespaces and each
named namespace must previously have been set up. Naming a
nonexistent namespace produces an error.
</p>
</li>
</ul>
</div>
<p>
For additional information about network namespaces, see
<a class="xref" href="network-namespace-support.html" title="7.1.14 Network Namespace Support">
Section 7.1.14, “Network Namespace Support”
</a>
.
</p>
<p>
If binding to the address fails, the server produces an error
and does not start.
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_admin_address">
<code class="literal">
admin_address
</code>
</a>
system
variable is similar to the
<a class="link" href="server-system-variables.html#sysvar_bind_address">
<code class="literal">
bind_address
</code>
</a>
system variable
that binds the server to an address for ordinary client
connections, but with these differences:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<a class="link" href="server-system-variables.html#sysvar_bind_address">
<code class="literal">
bind_address
</code>
</a>
permits
multiple addresses.
<a class="link" href="server-system-variables.html#sysvar_admin_address">
<code class="literal">
admin_address
</code>
</a>
permits a
single address.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="server-system-variables.html#sysvar_bind_address">
<code class="literal">
bind_address
</code>
</a>
permits
wildcard addresses.
<a class="link" href="server-system-variables.html#sysvar_admin_address">
<code class="literal">
admin_address
</code>
</a>
does not.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_admin_port">
</a>
<a class="link" href="server-system-variables.html#sysvar_admin_port">
<code class="literal">
admin_port
</code>
</a>
</p>
<a class="indexterm" name="idm46045278567664">
</a>
<a class="indexterm" name="idm46045278566576">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for admin_port">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--admin-port=port_num
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_admin_port">
admin_port
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
33062
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
65535
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The TCP/IP port number to use for connections on the
administrative network interface (see
<a class="xref" href="connection-interfaces.html" title="7.1.12.1 Connection Interfaces">
Section 7.1.12.1, “Connection Interfaces”
</a>
). Setting this
variable to 0 causes the default value to be used.
</p>
<p>
Setting
<a class="link" href="server-system-variables.html#sysvar_admin_port">
<code class="literal">
admin_port
</code>
</a>
has no
effect if
<a class="link" href="server-system-variables.html#sysvar_admin_address">
<code class="literal">
admin_address
</code>
</a>
is
not specified because in that case the server maintains no
administrative network interface.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_admin_ssl_ca">
</a>
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_ca">
<code class="literal">
admin_ssl_ca
</code>
</a>
</p>
<a class="indexterm" name="idm46045278533424">
</a>
<a class="indexterm" name="idm46045278532336">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for admin_ssl_ca">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--admin-ssl-ca=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_ca">
admin_ssl_ca
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_ca">
<code class="literal">
admin_ssl_ca
</code>
</a>
system
variable is like
<a class="link" href="server-system-variables.html#sysvar_ssl_ca">
<code class="literal">
ssl_ca
</code>
</a>
,
except that it applies to the administrative connection
interface rather than the main connection interface. For
information about configuring encryption support for the
administrative interface, see
<a class="xref" href="administrative-connection-interface.html#administrative-interface-encrypted-connections" title="Administrative Interface Support for Encrypted Connections">
Administrative Interface Support for Encrypted Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_admin_ssl_capath">
</a>
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_capath">
<code class="literal">
admin_ssl_capath
</code>
</a>
</p>
<a class="indexterm" name="idm46045278504304">
</a>
<a class="indexterm" name="idm46045278503216">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for admin_ssl_capath">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--admin-ssl-capath=dir_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_capath">
admin_ssl_capath
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Directory name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_capath">
<code class="literal">
admin_ssl_capath
</code>
</a>
system
variable is like
<a class="link" href="server-system-variables.html#sysvar_ssl_capath">
<code class="literal">
ssl_capath
</code>
</a>
,
except that it applies to the administrative connection
interface rather than the main connection interface. For
information about configuring encryption support for the
administrative interface, see
<a class="xref" href="administrative-connection-interface.html#administrative-interface-encrypted-connections" title="Administrative Interface Support for Encrypted Connections">
Administrative Interface Support for Encrypted Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_admin_ssl_cert">
</a>
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_cert">
<code class="literal">
admin_ssl_cert
</code>
</a>
</p>
<a class="indexterm" name="idm46045278475312">
</a>
<a class="indexterm" name="idm46045278474224">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for admin_ssl_cert">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--admin-ssl-cert=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_cert">
admin_ssl_cert
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_cert">
<code class="literal">
admin_ssl_cert
</code>
</a>
system
variable is like
<a class="link" href="server-system-variables.html#sysvar_ssl_cert">
<code class="literal">
ssl_cert
</code>
</a>
,
except that it applies to the administrative connection
interface rather than the main connection interface. For
information about configuring encryption support for the
administrative interface, see
<a class="xref" href="administrative-connection-interface.html#administrative-interface-encrypted-connections" title="Administrative Interface Support for Encrypted Connections">
Administrative Interface Support for Encrypted Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_admin_ssl_cipher">
</a>
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_cipher">
<code class="literal">
admin_ssl_cipher
</code>
</a>
</p>
<a class="indexterm" name="idm46045278446384">
</a>
<a class="indexterm" name="idm46045278445296">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for admin_ssl_cipher">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--admin-ssl-cipher=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_cipher">
admin_ssl_cipher
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_cipher">
<code class="literal">
admin_ssl_cipher
</code>
</a>
system
variable is like
<a class="link" href="server-system-variables.html#sysvar_ssl_cipher">
<code class="literal">
ssl_cipher
</code>
</a>
,
except that it applies to the administrative connection
interface rather than the main connection interface. For
information about configuring encryption support for the
administrative interface, see
<a class="xref" href="administrative-connection-interface.html#administrative-interface-encrypted-connections" title="Administrative Interface Support for Encrypted Connections">
Administrative Interface Support for Encrypted Connections
</a>
.
</p>
<p>
The list specified by this variable may include any of the
following values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
ECDHE-ECDSA-AES128-GCM-SHA256
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-ECDSA-AES256-GCM-SHA384
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-RSA-AES128-GCM-SHA256
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-RSA-AES256-GCM-SHA384
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-ECDSA-CHACHA20-POLY1305
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-RSA-CHACHA20-POLY1305
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-ECDSA-AES256-CCM
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-ECDSA-AES128-CCM
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DHE-RSA-AES128-GCM-SHA256
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DHE-RSA-AES256-GCM-SHA384
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DHE-RSA-AES256-CCM
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DHE-RSA-AES128-CCM
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DHE-RSA-CHACHA20-POLY1305
</code>
</p>
</li>
</ul>
</div>
<p>
Trying to include any values in the cipher list that are not
shown here when setting this variable raises an error
(
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_blocked_cipher" target="_top">
<code class="literal">
ER_BLOCKED_CIPHER
</code>
</a>
).
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_admin_ssl_crl">
</a>
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_crl">
<code class="literal">
admin_ssl_crl
</code>
</a>
</p>
<a class="indexterm" name="idm46045278395760">
</a>
<a class="indexterm" name="idm46045278394672">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for admin_ssl_crl">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--admin-ssl-crl=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_crl">
admin_ssl_crl
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_crl">
<code class="literal">
admin_ssl_crl
</code>
</a>
system
variable is like
<a class="link" href="server-system-variables.html#sysvar_ssl_crl">
<code class="literal">
ssl_crl
</code>
</a>
,
except that it applies to the administrative connection
interface rather than the main connection interface. For
information about configuring encryption support for the
administrative interface, see
<a class="xref" href="administrative-connection-interface.html#administrative-interface-encrypted-connections" title="Administrative Interface Support for Encrypted Connections">
Administrative Interface Support for Encrypted Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_admin_ssl_crlpath">
</a>
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_crlpath">
<code class="literal">
admin_ssl_crlpath
</code>
</a>
</p>
<a class="indexterm" name="idm46045278366720">
</a>
<a class="indexterm" name="idm46045278365680">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for admin_ssl_crlpath">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--admin-ssl-crlpath=dir_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_crlpath">
admin_ssl_crlpath
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Directory name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_crlpath">
<code class="literal">
admin_ssl_crlpath
</code>
</a>
system
variable is like
<a class="link" href="server-system-variables.html#sysvar_ssl_crlpath">
<code class="literal">
ssl_crlpath
</code>
</a>
,
except that it applies to the administrative connection
interface rather than the main connection interface. For
information about configuring encryption support for the
administrative interface, see
<a class="xref" href="administrative-connection-interface.html#administrative-interface-encrypted-connections" title="Administrative Interface Support for Encrypted Connections">
Administrative Interface Support for Encrypted Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_admin_ssl_key">
</a>
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_key">
<code class="literal">
admin_ssl_key
</code>
</a>
</p>
<a class="indexterm" name="idm46045278337776">
</a>
<a class="indexterm" name="idm46045278336688">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for admin_ssl_key">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--admin-ssl-key=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_key">
admin_ssl_key
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_admin_ssl_key">
<code class="literal">
admin_ssl_key
</code>
</a>
system
variable is like
<a class="link" href="server-system-variables.html#sysvar_ssl_key">
<code class="literal">
ssl_key
</code>
</a>
,
except that it applies to the administrative connection
interface rather than the main connection interface. For
information about configuring encryption support for the
administrative interface, see
<a class="xref" href="administrative-connection-interface.html#administrative-interface-encrypted-connections" title="Administrative Interface Support for Encrypted Connections">
Administrative Interface Support for Encrypted Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_admin_tls_ciphersuites">
</a>
<a class="link" href="server-system-variables.html#sysvar_admin_tls_ciphersuites">
<code class="literal">
admin_tls_ciphersuites
</code>
</a>
</p>
<a class="indexterm" name="idm46045278308736">
</a>
<a class="indexterm" name="idm46045278307696">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for admin_tls_ciphersuites">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--admin-tls-ciphersuites=ciphersuite_list
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_admin_tls_ciphersuites">
admin_tls_ciphersuites
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_admin_tls_ciphersuites">
<code class="literal">
admin_tls_ciphersuites
</code>
</a>
system variable is like
<a class="link" href="server-system-variables.html#sysvar_tls_ciphersuites">
<code class="literal">
tls_ciphersuites
</code>
</a>
, except that
it applies to the administrative connection interface rather
than the main connection interface. For information about
configuring encryption support for the administrative
interface, see
<a class="xref" href="administrative-connection-interface.html#administrative-interface-encrypted-connections" title="Administrative Interface Support for Encrypted Connections">
Administrative Interface Support for Encrypted Connections
</a>
.
</p>
<p>
The value is a list of zero or more colon-separated
ciphersuite names from among those listed here:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
TLS_AES_128_GCM_SHA256
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TLS_AES_256_GCM_SHA384
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TLS_CHACHA20_POLY1305_SHA256
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TLS_AES_128_CCM_SHA256
</code>
</p>
</li>
</ul>
</div>
<p>
Trying to include any values in the cipher list that are not
shown here when setting this variable raises an error
(
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_blocked_cipher" target="_top">
<code class="literal">
ER_BLOCKED_CIPHER
</code>
</a>
).
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_admin_tls_version">
</a>
<a class="link" href="server-system-variables.html#sysvar_admin_tls_version">
<code class="literal">
admin_tls_version
</code>
</a>
</p>
<a class="indexterm" name="idm46045278271088">
</a>
<a class="indexterm" name="idm46045278270048">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for admin_tls_version">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--admin-tls-version=protocol_list
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_admin_tls_version">
admin_tls_version
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
TLSv1.2,TLSv1.3
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_admin_tls_version">
<code class="literal">
admin_tls_version
</code>
</a>
system
variable is like
<a class="link" href="server-system-variables.html#sysvar_tls_version">
<code class="literal">
tls_version
</code>
</a>
,
except that it applies to the administrative connection
interface rather than the main connection interface. For
information about configuring encryption support for the
administrative interface, see
<a class="xref" href="administrative-connection-interface.html#administrative-interface-encrypted-connections" title="Administrative Interface Support for Encrypted Connections">
Administrative Interface Support for Encrypted Connections
</a>
.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
MySQL 8.4 does not support the TLSv1 and
TLSv1.1 connection protocols. See
<a class="xref" href="encrypted-connection-protocols-ciphers.html#encrypted-connection-deprecated-protocols" title="Removal of Support for the TLSv1 and TLSv1.1 Protocols">
Removal of Support for the TLSv1 and TLSv1.1 Protocols
</a>
for more information.
</p>
</li>
<li class="listitem">
<p>
MuySQL 8.4 supports the TLSv1.3 protocol,
provided that the MySQL server was compiled using
OpenSSL 1.1.1 or newer. The server checks the version of
OpenSSL at startup, and if it is older than 1.1.1,
TLSv1.3 is removed from the default value for the system
variable. In that case, the default is
<code class="literal">
TLSv1.2
</code>
.
</p>
</li>
</ul>
</div>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_authentication_policy">
</a>
<a class="link" href="server-system-variables.html#sysvar_authentication_policy">
<code class="literal">
authentication_policy
</code>
</a>
</p>
<a class="indexterm" name="idm46045278237664">
</a>
<a class="indexterm" name="idm46045278236624">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for authentication_policy">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--authentication-policy=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_authentication_policy">
authentication_policy
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
*,,
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable is used to administer multifactor authentication
(MFA) capabilities. For
<a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
<code class="literal">
CREATE
USER
</code>
</a>
and
<a class="link" href="alter-user.html" title="15.7.1.1 ALTER USER Statement">
<code class="literal">
ALTER USER
</code>
</a>
statements used to manage MySQL account definitions, it
determines what authentication factor or factors may be
specified, where
<span class="quote">
“
<span class="quote">
factor
</span>
”
</span>
corresponds to an
authentication method or plugin associated with an account.
<code class="literal">
authentication_policy
</code>
determines the
following aspects of multifactor authentication:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
The number of authentication factors.
</p>
</li>
<li class="listitem">
<p>
The plugins (or methods) permitted for each factor.
</p>
</li>
<li class="listitem">
<p>
The default authentication plugin for authentication
specifications that do not name a plugin explicitly.
</p>
</li>
</ul>
</div>
<p>
Because
<a class="link" href="server-system-variables.html#sysvar_authentication_policy">
<code class="literal">
authentication_policy
</code>
</a>
applies only when accounts are created or altered, changes to
its value have no effect on existing user accounts.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Although the
<a class="link" href="server-system-variables.html#sysvar_authentication_policy">
<code class="literal">
authentication_policy
</code>
</a>
system variable places certain constraints on the
authentication-related clauses of
<a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
<code class="literal">
CREATE USER
</code>
</a>
and
<a class="link" href="alter-user.html" title="15.7.1.1 ALTER USER Statement">
<code class="literal">
ALTER USER
</code>
</a>
statements, a user
who has the
<a class="link" href="privileges-provided.html#priv_authentication-policy-admin">
<code class="literal">
AUTHENTICATION_POLICY_ADMIN
</code>
</a>
privilege is not subject to these constraints. (A warning
does occur for statements that otherwise would not be
permitted.)
</p>
</div>
<p>
The value of
<a class="link" href="server-system-variables.html#sysvar_authentication_policy">
<code class="literal">
authentication_policy
</code>
</a>
is a
list of 1, 2, or 3 comma-separated elements, each
corresponding to an authentication factor and each being of
one of the forms listed here, with their meanings:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<span class="emphasis">
<em>
empty
</em>
</span>
</p>
<p>
The authentication factor is optional; any authentication
plugin may be used.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
*
</code>
</p>
<p>
The authentication factor is required; any authentication
plugin may be used.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<em class="replaceable">
<code>
plugin_name
</code>
</em>
</code>
</p>
<p>
The authentication factor is required; this factor must be
<em class="replaceable">
<code>
plugin_name
</code>
</em>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
*:
<em class="replaceable">
<code>
plugin_name
</code>
</em>
</code>
</p>
<p>
The authentication factor is required;
<code class="literal">
plugin_name
</code>
is the default, but another
authentication plugin may be used.
</p>
</li>
</ul>
</div>
<p>
In each case, an element may be surrounded by whitespace
characters. The entire list must be enclosed in single quotes.
</p>
<p>
<code class="literal">
authentication_policy
</code>
must contain at least
one nonempty factor, and any empty factors must come at the
end of the list, following any nonempty factors. This means
that
<code class="literal">
',,'
</code>
is not permitted because this
signifies that all factors are optional. Every account must
have at least one authentication factor.
</p>
<p>
The default value of
<a class="link" href="server-system-variables.html#sysvar_authentication_policy">
<code class="literal">
authentication_policy
</code>
</a>
is
<code class="literal">
'*,,'
</code>
. This means that factor 1 is required
in account definitions and can use any authentication plugin
(with
<code class="literal">
caching_sha2_password
</code>
being the
default), and that factors 2 and 3 are optional and each can
use any authentication plugin.
</p>
<p>
If
<code class="literal">
authentication_policy
</code>
does not specify a
default plugin for the first factor, the default plugin for
this factor is
<code class="literal">
caching_sha2_password
</code>
,
although another plugin may be used.
</p>
<p>
The following table shows some possible values for
<a class="link" href="server-system-variables.html#sysvar_authentication_policy">
<code class="literal">
authentication_policy
</code>
</a>
and the
policy that each establishes for creating or altering
accounts.
</p>
<div class="table">
<a name="idm46045278178080">
</a>
<p class="title">
<b>
Table 7.4 Example authentication_policy Values
</b>
</p>
<div class="table-contents">
<table summary="Example authentication_policy values and their meanings.">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<thead>
<tr>
<th>
authentication_policy
</th>
<th>
Policy
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="literal">
'*'
</code>
</td>
<td>
One factor only, which uses
<code class="literal">
caching_sha2_password
</code>
,
although another plugin may be used.
</td>
</tr>
<tr>
<td>
<code class="literal">
'*,*'
</code>
</td>
<td>
Two factors only; the first factor uses
<code class="literal">
caching_sha2_password
</code>
by default,
although another plugin may be used; the second may use
any plugin.
</td>
</tr>
<tr>
<td>
<code class="literal">
'*,*,*'
</code>
</td>
<td>
Three factors only, where the first factor uses
<code class="literal">
caching_sha2_password
</code>
by default,
although another plugin may be used; the second and
third factors may use any plugins.
</td>
</tr>
<tr>
<td>
<code class="literal">
'*,'
</code>
</td>
<td>
One or two factors, where the first factor uses
<code class="literal">
caching_sha2_password
</code>
by default,
although another plugin may be used; the second factor
is optional and may use any plugin.
</td>
</tr>
<tr>
<td>
<code class="literal">
'*,,'
</code>
</td>
<td>
One, two, or three factors, where the first factor uses
<code class="literal">
caching_sha2_password
</code>
by default,
although another plugin may be used; the second factor
and third factors are optional and may use any plugins.
</td>
</tr>
<tr>
<td>
<code class="literal">
'*,*,'
</code>
</td>
<td>
Two or three factors, where the first factor uses
<code class="literal">
caching_sha2_password
</code>
by default,
although another plugin may be used; the second factor
is required and the third factor is optional; the second
and third factors may use any plugins.
</td>
</tr>
<tr>
<td>
<code class="literal">
'*,
<em class="replaceable">
<code>
auth_plugin
</code>
</em>
'
</code>
</td>
<td>
Two factors, where the first factor uses
<code class="literal">
caching_sha2_password
</code>
by default,
although another plugin may be used; the second factor
must be the named plugin.
</td>
</tr>
<tr>
<td>
<code class="literal">
'
<em class="replaceable">
<code>
auth_plugin
</code>
</em>
,*,'
</code>
</td>
<td>
Two or three factors, where the first factor must be the named plugin;
the second factor is required but may use any plugin;
the third factor is optional and may use any plugin.
</td>
</tr>
<tr>
<td>
<code class="literal">
'*,*:
<em class="replaceable">
<code>
auth_plugin
</code>
</em>
'
</code>
</td>
<td>
Two factors, where the first factor uses
<code class="literal">
caching_sha2_password
</code>
by default,
although another plugin may be used; the second factor
is required and uses the named plugin, but another
plugin may be used.
</td>
</tr>
<tr>
<td>
<code class="literal">
'
<em class="replaceable">
<code>
auth_plugin
</code>
</em>
,'
</code>
</td>
<td>
One or two factors, where the first factor must be the named plugin; the
second factor is optional and may use any plugin.
</td>
</tr>
<tr>
<td>
<code class="literal">
'*:
<em class="replaceable">
<code>
auth_plugin
</code>
</em>
,*,'
</code>
</td>
<td>
Two or three factors, where the first factor must be the named plugin;
the second factor is required and may use any plugin,
and the third factor is optional and may use any plugin.
</td>
</tr>
<tr>
<td>
<code class="literal">
'
<em class="replaceable">
<code>
auth_plugin
</code>
</em>
,
<em class="replaceable">
<code>
auth_plugin
</code>
</em>
,
<em class="replaceable">
<code>
auth_plugin
</code>
</em>
'
</code>
</td>
<td>
Three factors, where all three factors must use the named plugins.
</td>
</tr>
</tbody>
</table>
</div>
<div class="table-contents">
<table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 431px; width: 709px;">
<thead>
<tr>
<th style="width: 300.234px;">
authentication_policy
</th>
<th style="width: 407.766px;">
Policy
</th>
</tr>
</thead>
</table>
</div>
</div>
<br class="table-break"/>
</li>
<li class="listitem">
<p>
<a name="sysvar_authentication_windows_log_level">
</a>
<a class="link" href="server-system-variables.html#sysvar_authentication_windows_log_level">
<code class="literal">
authentication_windows_log_level
</code>
</a>
</p>
<a class="indexterm" name="idm46045278128128">
</a>
<a class="indexterm" name="idm46045278127024">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for authentication_windows_log_level">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--authentication-windows-log-level=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_authentication_windows_log_level">
authentication_windows_log_level
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
2
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable is available only if the
<code class="literal">
authentication_windows
</code>
Windows
authentication plugin is enabled and debugging code is
enabled. See
<a class="xref" href="windows-pluggable-authentication.html" title="8.4.1.6 Windows Pluggable Authentication">
Section 8.4.1.6, “Windows Pluggable Authentication”
</a>
.
</p>
<p>
This variable sets the logging level for the Windows
authentication plugin. The following table shows the permitted
values.
</p>
<div class="informaltable">
<table summary="Permitted values for the authentication_windows system variable.">
<colgroup>
<col style="width: 10%"/>
<col style="width: 75%"/>
</colgroup>
<thead>
<tr>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
0
</td>
<td>
No logging
</td>
</tr>
<tr>
<td>
1
</td>
<td>
Log only error messages
</td>
</tr>
<tr>
<td>
2
</td>
<td>
Log level 1 messages and warning messages
</td>
</tr>
<tr>
<td>
3
</td>
<td>
Log level 2 messages and information notes
</td>
</tr>
<tr>
<td>
4
</td>
<td>
Log level 3 messages and debug messages
</td>
</tr>
</tbody>
</table>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_authentication_windows_use_principal_name">
</a>
<a class="link" href="server-system-variables.html#sysvar_authentication_windows_use_principal_name">
<code class="literal">
authentication_windows_use_principal_name
</code>
</a>
</p>
<a class="indexterm" name="idm46045278079248">
</a>
<a class="indexterm" name="idm46045278078128">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for authentication_windows_use_principal_name">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--authentication-windows-use-principal-name[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_authentication_windows_use_principal_name">
authentication_windows_use_principal_name
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable is available only if the
<code class="literal">
authentication_windows
</code>
Windows
authentication plugin is enabled. See
<a class="xref" href="windows-pluggable-authentication.html" title="8.4.1.6 Windows Pluggable Authentication">
Section 8.4.1.6, “Windows Pluggable Authentication”
</a>
.
</p>
<p>
A client that authenticates using the
<code class="literal">
InitSecurityContext()
</code>
function should
provide a string identifying the service to which it connects
(
<em class="replaceable">
<code>
targetName
</code>
</em>
). MySQL uses the
principal name (UPN) of the account under which the server is
running. The UPN has the form
<code class="literal">
<em class="replaceable">
<code>
user_id
</code>
</em>
@
<em class="replaceable">
<code>
computer_name
</code>
</em>
</code>
and need not be registered anywhere to be used. This UPN is
sent by the server at the beginning of authentication
handshake.
</p>
<p>
This variable controls whether the server sends the UPN in the
initial challenge. By default, the variable is enabled. For
security reasons, it can be disabled to avoid sending the
server's account name to a client as cleartext. If the
variable is disabled, the server always sends a
<code class="literal">
0x00
</code>
byte in the first challenge, the
client does not specify
<em class="replaceable">
<code>
targetName
</code>
</em>
,
and as a result, NTLM authentication is used.
</p>
<p>
If the server fails to obtain its UPN (which happens primarily
in environments that do not support Kerberos authentication),
the UPN is not sent by the server and NTLM authentication is
used.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_autocommit">
</a>
<a class="link" href="server-system-variables.html#sysvar_autocommit">
<code class="literal">
autocommit
</code>
</a>
</p>
<a class="indexterm" name="idm46045278046176">
</a>
<a class="indexterm" name="idm46045278045088">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for autocommit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--autocommit[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_autocommit">
autocommit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The autocommit mode. If set to 1, all changes to a table take
effect immediately. If set to 0, you must use
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
COMMIT
</code>
</a>
to accept a transaction
or
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
ROLLBACK
</code>
</a>
to cancel it. If
<a class="link" href="server-system-variables.html#sysvar_autocommit">
<code class="literal">
autocommit
</code>
</a>
is 0 and you change it to 1, MySQL performs an automatic
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
COMMIT
</code>
</a>
of any open transaction.
Another way to begin a transaction is to use a
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
START
TRANSACTION
</code>
</a>
or
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
BEGIN
</code>
</a>
statement. See
<a class="xref" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
Section 15.3.1, “START TRANSACTION, COMMIT, and ROLLBACK Statements”
</a>
.
</p>
<p>
By default, client connections begin with
<a class="link" href="server-system-variables.html#sysvar_autocommit">
<code class="literal">
autocommit
</code>
</a>
set to 1. To cause
clients to begin with a default of 0, set the global
<a class="link" href="server-system-variables.html#sysvar_autocommit">
<code class="literal">
autocommit
</code>
</a>
value by starting
the server with the
<a class="link" href="server-system-variables.html#sysvar_autocommit">
<code class="option">
--autocommit=0
</code>
</a>
option. To set
the variable using an option file, include these lines:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-ini"><div class="docs-select-all right" id="sa13813607"><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">autocommit</span><span class="token attr-value"><span class="token punctuation">=</span>0</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_automatic_sp_privileges">
</a>
<a class="link" href="server-system-variables.html#sysvar_automatic_sp_privileges">
<code class="literal">
automatic_sp_privileges
</code>
</a>
</p>
<a class="indexterm" name="idm46045278007152">
</a>
<a class="indexterm" name="idm46045278006112">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for automatic_sp_privileges">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--automatic-sp-privileges[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_automatic_sp_privileges">
automatic_sp_privileges
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
When this variable has a value of 1 (the default), the server
automatically grants the
<a class="link" href="privileges-provided.html#priv_execute">
<code class="literal">
EXECUTE
</code>
</a>
and
<a class="link" href="privileges-provided.html#priv_alter-routine">
<code class="literal">
ALTER ROUTINE
</code>
</a>
privileges to the
creator of a stored routine, if the user cannot already
execute and alter or drop the routine. (The
<a class="link" href="privileges-provided.html#priv_alter-routine">
<code class="literal">
ALTER ROUTINE
</code>
</a>
privilege is
required to drop the routine.) The server also automatically
drops those privileges from the creator when the routine is
dropped. If
<a class="link" href="server-system-variables.html#sysvar_automatic_sp_privileges">
<code class="literal">
automatic_sp_privileges
</code>
</a>
is 0,
the server does not automatically add or drop these
privileges.
</p>
<p>
The creator of a routine is the account used to execute the
<code class="literal">
CREATE
</code>
statement for it. This might not be
the same as the account named as the
<code class="literal">
DEFINER
</code>
in the routine definition.
</p>
<p>
If you start
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
with
<a class="link" href="server-options.html#option_mysqld_skip-new">
<code class="option">
--skip-new
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_automatic_sp_privileges">
<code class="literal">
automatic_sp_privileges
</code>
</a>
is
set to
<code class="literal">
OFF
</code>
.
</p>
<p>
See also
<a class="xref" href="stored-routines-privileges.html" title="27.2.2 Stored Routines and MySQL Privileges">
Section 27.2.2, “Stored Routines and MySQL Privileges”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_auto_generate_certs">
</a>
<a class="link" href="server-system-variables.html#sysvar_auto_generate_certs">
<code class="literal">
auto_generate_certs
</code>
</a>
</p>
<a class="indexterm" name="idm46045277967920">
</a>
<a class="indexterm" name="idm46045277966880">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for auto_generate_certs">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--auto-generate-certs[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_auto_generate_certs">
auto_generate_certs
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls whether the server autogenerates SSL
key and certificate files in the data directory, if they do
not already exist.
</p>
<p>
At startup, the server automatically generates server-side and
client-side SSL certificate and key files in the data
directory if the
<a class="link" href="server-system-variables.html#sysvar_auto_generate_certs">
<code class="literal">
auto_generate_certs
</code>
</a>
system
variable is enabled and the server-side SSL files are missing
from the data directory. These certificates are always
generated in such cases, regardless of the values of any other
TLS options. The certificate and key files enable secure
client connections using SSL; see
<a class="xref" href="using-encrypted-connections.html" title="8.3.1 Configuring MySQL to Use Encrypted Connections">
Section 8.3.1, “Configuring MySQL to Use Encrypted Connections”
</a>
.
</p>
<p>
For more information about SSL file autogeneration, including
file names and characteristics, see
<a class="xref" href="creating-ssl-rsa-files-using-mysql.html" title="8.3.3.1 Creating SSL and RSA Certificates and Keys using MySQL">
Section 8.3.3.1, “Creating SSL and RSA Certificates and Keys using MySQL”
</a>
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_sha256_password_auto_generate_rsa_keys">
<code class="literal">
sha256_password_auto_generate_rsa_keys
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_auto_generate_rsa_keys">
<code class="literal">
caching_sha2_password_auto_generate_rsa_keys
</code>
</a>
system variables are related but control autogeneration of RSA
key-pair files needed for secure password exchange using RSA
over unencrypted connections.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_back_log">
</a>
<a class="link" href="server-system-variables.html#sysvar_back_log">
<code class="literal">
back_log
</code>
</a>
</p>
<a class="indexterm" name="idm46045277934944">
</a>
<a class="indexterm" name="idm46045277933856">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for back_log">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--back-log=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_back_log">
back_log
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
-1
</code>
(signifies autosizing; do not assign this literal value)
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
65535
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of outstanding connection requests MySQL can have.
This comes into play when the main MySQL thread gets very many
connection requests in a very short time. It then takes some
time (although very little) for the main thread to check the
connection and start a new thread. The
<a class="link" href="server-system-variables.html#sysvar_back_log">
<code class="literal">
back_log
</code>
</a>
value indicates how
many requests can be stacked during this short time before
MySQL momentarily stops answering new requests. You need to
increase this only if you expect a large number of connections
in a short period of time.
</p>
<p>
In other words, this value is the size of the listen queue for
incoming TCP/IP connections. Your operating system has its own
limit on the size of this queue. The manual page for the Unix
<code class="literal">
listen()
</code>
system call should have more
details. Check your OS documentation for the maximum value for
this variable.
<a class="link" href="server-system-variables.html#sysvar_back_log">
<code class="literal">
back_log
</code>
</a>
cannot be set higher than your operating system limit.
</p>
<p>
The default value is the value of
<a class="link" href="server-system-variables.html#sysvar_max_connections">
<code class="literal">
max_connections
</code>
</a>
, which
enables the permitted backlog to adjust to the maximum
permitted number of connections.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_basedir">
</a>
<a class="link" href="server-system-variables.html#sysvar_basedir">
<code class="literal">
basedir
</code>
</a>
</p>
<a class="indexterm" name="idm46045277898032">
</a>
<a class="indexterm" name="idm46045277896960">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for basedir">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--basedir=dir_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_basedir">
basedir
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Directory name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
parent of mysqld installation directory
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The path to the MySQL installation base directory.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_big_tables">
</a>
<a class="link" href="server-system-variables.html#sysvar_big_tables">
<code class="literal">
big_tables
</code>
</a>
</p>
<a class="indexterm" name="idm46045277872480">
</a>
<a class="indexterm" name="idm46045277871392">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for big_tables">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--big-tables[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_big_tables">
big_tables
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<a class="indexterm" name="idm46045277849808">
</a>
<p>
If enabled, the server stores all temporary tables on disk
rather than in memory. This prevents most
<code class="literal">
The table
<em class="replaceable">
<code>
tbl_name
</code>
</em>
is full
</code>
errors
for
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
operations that
require a large temporary table, but also slows down queries
for which in-memory tables would suffice.
</p>
<p>
The default value for new connections is
<code class="literal">
OFF
</code>
(use in-memory temporary tables).
Normally, it should never be necessary to enable this
variable. When in-memory
<span class="emphasis">
<em>
internal
</em>
</span>
temporary tables are managed by the
<code class="literal">
TempTable
</code>
storage engine (the default), and
the maximum amount of memory that can be occupied by the
<code class="literal">
TempTable
</code>
storage engine is exceeded, the
<code class="literal">
TempTable
</code>
storage engine starts storing
data to temporary files on disk. When in-memory temporary
tables are managed by the
<code class="literal">
MEMORY
</code>
storage
engine, in-memory tables are automatically converted to
disk-based tables as required. For more information, see
<a class="xref" href="internal-temporary-tables.html" title="10.4.4 Internal Temporary Table Use in MySQL">
Section 10.4.4, “Internal Temporary Table Use in MySQL”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_bind_address">
</a>
<a class="link" href="server-system-variables.html#sysvar_bind_address">
<code class="literal">
bind_address
</code>
</a>
</p>
<a class="indexterm" name="idm46045277837440">
</a>
<a class="indexterm" name="idm46045277836352">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for bind_address">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--bind-address=addr
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_bind_address">
bind_address
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
*
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The MySQL server listens on one or more network sockets for
TCP/IP connections. Each socket is bound to one address, but
it is possible for an address to map onto multiple network
interfaces. To specify how the server should listen for TCP/IP
connections, set the
<a class="link" href="server-system-variables.html#sysvar_bind_address">
<code class="literal">
bind_address
</code>
</a>
system variable
at server startup. The server also has an
<a class="link" href="server-system-variables.html#sysvar_admin_address">
<code class="literal">
admin_address
</code>
</a>
system variable
that enables administrative connections on a dedicated
interface. See
<a class="xref" href="connection-interfaces.html" title="7.1.12.1 Connection Interfaces">
Section 7.1.12.1, “Connection Interfaces”
</a>
.
</p>
<p>
If
<a class="link" href="server-system-variables.html#sysvar_bind_address">
<code class="literal">
bind_address
</code>
</a>
is specified,
it accepts a list of one or more address values, each of which
may specify a single non-wildcard IP address or host name.
Each address may include a network namespace specifier. If
only one address is specified, it may make use of one of the
wildcard address formats that permit listening on multiple
network interfaces (
<code class="literal">
*
</code>
,
<code class="literal">
0.0.0.0
</code>
, or
<code class="literal">
::
</code>
).
Multiple addresses are separated by commas. When multiple
values are listed, each value must specify a single
non-wildcard IP address (either IPv4 or IPv6) or a host name,
and wildcard address formats (
<code class="literal">
*
</code>
,
<code class="literal">
0.0.0.0
</code>
, or
<code class="literal">
::
</code>
) are not
allowed.
</p>
<p>
IP addresses can be specified as IPv4 or IPv6 addresses. For
any value that is a host name, the server resolves the name to
an IP address and binds to that address. If a host name
resolves to multiple IP addresses, the server uses the first
IPv4 address if there are any, or the first IPv6 address
otherwise.
</p>
<p>
The server treats different types of addresses as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If the address is
<code class="literal">
*
</code>
, the server accepts
TCP/IP connections on all server host IPv4 interfaces,
and, if the server host supports IPv6, on all IPv6
interfaces. Use this address to permit both IPv4 and IPv6
connections on all server interfaces. This value is the
default. If the variable specifies a list of multiple
values, this value is not permitted.
</p>
</li>
<li class="listitem">
<p>
If the address is
<code class="literal">
0.0.0.0
</code>
, the server
accepts TCP/IP connections on all server host IPv4
interfaces. If the variable specifies a list of multiple
values, this value is not permitted.
</p>
</li>
<li class="listitem">
<p>
If the address is
<code class="literal">
::
</code>
, the server
accepts TCP/IP connections on all server host IPv4 and
IPv6 interfaces. If the variable specifies a list of
multiple values, this value is not permitted.
</p>
</li>
<li class="listitem">
<p>
If the address is an IPv4-mapped address, the server
accepts TCP/IP connections for that address, in either
IPv4 or IPv6 format. For example, if the server is bound
to
<code class="literal">
::ffff:127.0.0.1
</code>
, clients can
connect using
<code class="option">
--host=127.0.0.1
</code>
or
<code class="option">
--host=::ffff:127.0.0.1
</code>
.
</p>
</li>
<li class="listitem">
<p>
If the address is a
<span class="quote">
“
<span class="quote">
regular
</span>
”
</span>
IPv4 or IPv6
address (such as
<code class="literal">
127.0.0.1
</code>
or
<code class="literal">
::1
</code>
), the server accepts TCP/IP
connections only for that IPv4 or IPv6 address.
</p>
</li>
</ul>
</div>
<p>
These rules apply to specifying a network namespace for an
address:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
A network namespace can be specified for an IP address or
a host name.
</p>
</li>
<li class="listitem">
<p>
A network namespace cannot be specified for a wildcard IP
address.
</p>
</li>
<li class="listitem">
<p>
For a given address, the network namespace is optional. If
given, it must be specified as a
<code class="literal">
/
<em class="replaceable">
<code>
ns
</code>
</em>
</code>
suffix
immediately following the address.
</p>
</li>
<li class="listitem">
<p>
An address with no
<code class="literal">
/
<em class="replaceable">
<code>
ns
</code>
</em>
</code>
suffix
uses the host system global namespace. The global
namespace is therefore the default.
</p>
</li>
<li class="listitem">
<p>
An address with a
<code class="literal">
/
<em class="replaceable">
<code>
ns
</code>
</em>
</code>
suffix
uses the namespace named
<em class="replaceable">
<code>
ns
</code>
</em>
.
</p>
</li>
<li class="listitem">
<p>
The host system must support network namespaces and each
named namespace must previously have been set up. Naming a
nonexistent namespace produces an error.
</p>
</li>
<li class="listitem">
<p>
If the variable value specifies multiple addresses, it can
include addresses in the global namespace, in named
namespaces, or a mix.
</p>
</li>
</ul>
</div>
<p>
For additional information about network namespaces, see
<a class="xref" href="network-namespace-support.html" title="7.1.14 Network Namespace Support">
Section 7.1.14, “Network Namespace Support”
</a>
.
</p>
<p>
If binding to any address fails, the server produces an error
and does not start.
</p>
<p>
Examples:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
bind_address=*
</code>
</p>
<p>
The server listens on all IPv4 or IPv6 addresses, as
specified by the
<code class="literal">
*
</code>
wildcard.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
bind_address=198.51.100.20
</code>
</p>
<p>
The server listens only on the
<code class="literal">
198.51.100.20
</code>
IPv4 address.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
bind_address=198.51.100.20,2001:db8:0:f101::1
</code>
</p>
<p>
The server listens on the
<code class="literal">
198.51.100.20
</code>
IPv4 address and the
<code class="literal">
2001:db8:0:f101::1
</code>
IPv6 address.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
bind_address=198.51.100.20,*
</code>
</p>
<p>
This produces an error because wildcard addresses are not
permitted when
<a class="link" href="server-system-variables.html#sysvar_bind_address">
<code class="literal">
bind_address
</code>
</a>
names a list
of multiple values.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
bind_address=198.51.100.20/red,2001:db8:0:f101::1/blue,192.0.2.50
</code>
</p>
<p>
The server listens on the
<code class="literal">
198.51.100.20
</code>
IPv4 address in the
<code class="literal">
red
</code>
namespace, the
<code class="literal">
2001:db8:0:f101::1
</code>
IPv6 address in the
<code class="literal">
blue
</code>
namespace, and the
<code class="literal">
192.0.2.50
</code>
IPv4 address in the global
namespace.
</p>
</li>
</ul>
</div>
<p>
When
<a class="link" href="server-system-variables.html#sysvar_bind_address">
<code class="literal">
bind_address
</code>
</a>
names a
single value (wildcard or non-wildcard), the server listens on
a single socket, which for a wildcard address may be bound to
multiple network interfaces. When
<a class="link" href="server-system-variables.html#sysvar_bind_address">
<code class="literal">
bind_address
</code>
</a>
names a list of
multiple values, the server listens on one socket per value,
with each socket bound to a single network interface. The
number of sockets is linear with the number of values
specified. Depending on operating system connection-acceptance
efficiency, long value lists might incur a performance penalty
for accepting TCP/IP connections.
</p>
<p>
<a class="indexterm" name="idm46045277757264">
</a>
Because file descriptors are allocated for listening sockets
and network namespace files, it may be necessary to increase
the
<a class="link" href="server-system-variables.html#sysvar_open_files_limit">
<code class="literal">
open_files_limit
</code>
</a>
system
variable.
</p>
<p>
If you intend to bind the server to a specific address, be
sure that the
<code class="literal">
mysql.user
</code>
system table
contains an account with administrative privileges that you
can use to connect to that address. Otherwise, you cannot shut
down the server. For example, if you bind the server to
<code class="literal">
*
</code>
, you can connect to it using all existing
accounts. But if you bind the server to
<code class="literal">
::1
</code>
, it accepts connections only on that
address. In that case, first make sure that the
<code class="literal">
'root'@'::1'
</code>
account is present in the
<code class="literal">
mysql.user
</code>
table so you can still connect
to the server to shut it down.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_block_encryption_mode">
</a>
<a class="link" href="server-system-variables.html#sysvar_block_encryption_mode">
<code class="literal">
block_encryption_mode
</code>
</a>
</p>
<a class="indexterm" name="idm46045277747264">
</a>
<a class="indexterm" name="idm46045277746224">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for block_encryption_mode">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--block-encryption-mode=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_block_encryption_mode">
block_encryption_mode
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
aes-128-ecb
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls the block encryption mode for
block-based algorithms such as AES. It affects encryption for
<a class="link" href="encryption-functions.html#function_aes-encrypt">
<code class="literal">
AES_ENCRYPT()
</code>
</a>
and
<a class="link" href="encryption-functions.html#function_aes-decrypt">
<code class="literal">
AES_DECRYPT()
</code>
</a>
.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_block_encryption_mode">
<code class="literal">
block_encryption_mode
</code>
</a>
takes a
value in
<code class="literal">
aes-
<em class="replaceable">
<code>
keylen
</code>
</em>
-
<em class="replaceable">
<code>
mode
</code>
</em>
</code>
format, where
<em class="replaceable">
<code>
keylen
</code>
</em>
is the key
length in bits and
<em class="replaceable">
<code>
mode
</code>
</em>
is the
encryption mode. The value is not case-sensitive. Permitted
<em class="replaceable">
<code>
keylen
</code>
</em>
values are 128, 192, and
256. Permitted
<em class="replaceable">
<code>
mode
</code>
</em>
values are
<code class="literal">
ECB
</code>
,
<code class="literal">
CBC
</code>
,
<code class="literal">
CFB1
</code>
,
<code class="literal">
CFB8
</code>
,
<code class="literal">
CFB128
</code>
, and
<code class="literal">
OFB
</code>
.
</p>
<p>
For example, this statement causes the AES encryption
functions to use a key length of 256 bits and the CBC mode:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa32838239"><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> block_encryption_mode <span class="token operator">=</span> <span class="token string">'aes-256-cbc'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
An error occurs for attempts to set
<a class="link" href="server-system-variables.html#sysvar_block_encryption_mode">
<code class="literal">
block_encryption_mode
</code>
</a>
to a
value containing an unsupported key length or a mode that the
SSL library does not support.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_build_id">
</a>
<a class="link" href="server-system-variables.html#sysvar_build_id">
<code class="literal">
build_id
</code>
</a>
</p>
<a class="indexterm" name="idm46045277706112">
</a>
<a class="indexterm" name="idm46045277705024">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for build_id">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_build_id">
build_id
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Platform Specific
</th>
<td>
Linux
</td>
</tr>
</tbody>
</table>
</div>
<p>
This is a 160-bit
<code class="literal">
SHA1
</code>
signature which is
generated by the linker when compiling the server on Linux
systems with
<a class="link" href="source-configuration-options.html#option_cmake_with_build_id">
<code class="option">
-DWITH_BUILD_ID=ON
</code>
</a>
(enabled by default), and converted to a hexadecimal string.
This read-only value serves as a unique build ID, and is
written into the server log at startup.
</p>
<p>
<code class="literal">
build_id
</code>
is not supported on platforms
other than Linux.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_bulk_insert_buffer_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_bulk_insert_buffer_size">
<code class="literal">
bulk_insert_buffer_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045277682304">
</a>
<a class="indexterm" name="idm46045277681264">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for bulk_insert_buffer_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--bulk-insert-buffer-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_bulk_insert_buffer_size">
bulk_insert_buffer_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
8388608
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes/thread
</td>
</tr>
</tbody>
</table>
</div>
<p>
<code class="literal">
MyISAM
</code>
uses a special tree-like cache to
make bulk inserts faster for
<a class="link" href="insert-select.html" title="15.2.7.1 INSERT ... SELECT Statement">
<code class="literal">
INSERT ...
SELECT
</code>
</a>
,
<code class="literal">
INSERT ... VALUES (...), (...),
...
</code>
, and
<a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
<code class="literal">
LOAD DATA
</code>
</a>
when adding data to nonempty tables. This variable limits the
size of the cache tree in bytes per thread. Setting it to 0
disables this optimization. The default value is 8MB.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_caching_sha2_password_digest_rounds">
</a>
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_digest_rounds">
<code class="literal">
caching_sha2_password_digest_rounds
</code>
</a>
</p>
<a class="indexterm" name="idm46045277641728">
</a>
<a class="indexterm" name="idm46045277640688">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for caching_sha2_password_digest_rounds">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--caching-sha2-password-digest-rounds=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_digest_rounds">
caching_sha2_password_digest_rounds
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
5000
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
5000
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4095000
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of hash rounds used by the
<code class="literal">
caching_sha2_password
</code>
authentication plugin
for password storage.
</p>
<p>
Increasing the number of hashing rounds above the default
value incurs a performance penalty that correlates with the
amount of increase:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
Creating an account that uses the
<code class="literal">
caching_sha2_password
</code>
plugin has no
impact on the client session within which the account is
created, but the server must perform the hashing rounds to
complete the operation.
</p>
</li>
<li class="listitem">
<p>
For client connections that use the account, the server
must perform the hashing rounds and save the result in the
cache. The result is longer login time for the first
client connection, but not for subsequent connections.
This behavior occurs after each server restart.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_caching_sha2_password_auto_generate_rsa_keys">
</a>
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_auto_generate_rsa_keys">
<code class="literal">
caching_sha2_password_auto_generate_rsa_keys
</code>
</a>
</p>
<a class="indexterm" name="idm46045277606400">
</a>
<a class="indexterm" name="idm46045277605280">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for caching_sha2_password_auto_generate_rsa_keys">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--caching-sha2-password-auto-generate-rsa-keys[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_auto_generate_rsa_keys">
caching_sha2_password_auto_generate_rsa_keys
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The server uses this variable to determine whether to
autogenerate RSA private/public key-pair files in the data
directory if they do not already exist.
</p>
<p>
At startup, the server automatically generates RSA
private/public key-pair files in the data directory if all of
these conditions are true: The
<a class="link" href="server-system-variables.html#sysvar_sha256_password_auto_generate_rsa_keys">
<code class="literal">
sha256_password_auto_generate_rsa_keys
</code>
</a>
or
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_auto_generate_rsa_keys">
<code class="literal">
caching_sha2_password_auto_generate_rsa_keys
</code>
</a>
system variable is enabled; no RSA options are specified; the
RSA files are missing from the data directory. These key-pair
files enable secure password exchange using RSA over
unencrypted connections for accounts authenticated by the
<code class="literal">
sha256_password
</code>
(deprecated) or
<code class="literal">
caching_sha2_password
</code>
plugin; see
<a class="xref" href="sha256-pluggable-authentication.html" title="8.4.1.3 SHA-256 Pluggable Authentication">
Section 8.4.1.3, “SHA-256 Pluggable Authentication”
</a>
, and
<a class="xref" href="caching-sha2-pluggable-authentication.html" title="8.4.1.2 Caching SHA-2 Pluggable Authentication">
Section 8.4.1.2, “Caching SHA-2 Pluggable Authentication”
</a>
.
</p>
<p>
For more information about RSA file autogeneration, including
file names and characteristics, see
<a class="xref" href="creating-ssl-rsa-files-using-mysql.html" title="8.3.3.1 Creating SSL and RSA Certificates and Keys using MySQL">
Section 8.3.3.1, “Creating SSL and RSA Certificates and Keys using MySQL”
</a>
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_auto_generate_certs">
<code class="literal">
auto_generate_certs
</code>
</a>
system variable is related but controls autogeneration of SSL
certificate and key files needed for secure connections using
SSL.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_caching_sha2_password_private_key_path">
</a>
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_private_key_path">
<code class="literal">
caching_sha2_password_private_key_path
</code>
</a>
</p>
<a class="indexterm" name="idm46045277570864">
</a>
<a class="indexterm" name="idm46045277569824">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for caching_sha2_password_private_key_path">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--caching-sha2-password-private-key-path=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_private_key_path">
caching_sha2_password_private_key_path
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
private_key.pem
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable specifies the path name of the RSA private key
file for the
<code class="literal">
caching_sha2_password
</code>
authentication plugin. If the file is named as a relative
path, it is interpreted relative to the server data directory.
The file must be in PEM format.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
Because this file stores a private key, its access mode
should be restricted so that only the MySQL server can read
it.
</p>
</div>
<p>
For information about
<code class="literal">
caching_sha2_password
</code>
, see
<a class="xref" href="caching-sha2-pluggable-authentication.html" title="8.4.1.2 Caching SHA-2 Pluggable Authentication">
Section 8.4.1.2, “Caching SHA-2 Pluggable Authentication”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_caching_sha2_password_public_key_path">
</a>
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_public_key_path">
<code class="literal">
caching_sha2_password_public_key_path
</code>
</a>
</p>
<a class="indexterm" name="idm46045277541248">
</a>
<a class="indexterm" name="idm46045277540208">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for caching_sha2_password_public_key_path">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--caching-sha2-password-public-key-path=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_public_key_path">
caching_sha2_password_public_key_path
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
public_key.pem
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable specifies the path name of the RSA public key
file for the
<code class="literal">
caching_sha2_password
</code>
authentication plugin. If the file is named as a relative
path, it is interpreted relative to the server data directory.
The file must be in PEM format.
</p>
<p>
For information about
<code class="literal">
caching_sha2_password
</code>
, including
information about how clients request the RSA public key, see
<a class="xref" href="caching-sha2-pluggable-authentication.html" title="8.4.1.2 Caching SHA-2 Pluggable Authentication">
Section 8.4.1.2, “Caching SHA-2 Pluggable Authentication”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_character_set_client">
</a>
<a class="link" href="server-system-variables.html#sysvar_character_set_client">
<code class="literal">
character_set_client
</code>
</a>
</p>
<a class="indexterm" name="idm46045277512656">
</a>
<a class="indexterm" name="idm46045277511616">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for character_set_client">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_character_set_client">
character_set_client
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
utf8mb4
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The character set for statements that arrive from the client.
The session value of this variable is set using the character
set requested by the client when the client connects to the
server. (Many clients support a
<code class="option">
--default-character-set
</code>
option to enable this
character set to be specified explicitly. See also
<a class="xref" href="charset-connection.html" title="12.4 Connection Character Sets and Collations">
Section 12.4, “Connection Character Sets and Collations”
</a>
.) The global value of the
variable is used to set the session value in cases when the
client-requested value is unknown or not available, or the
server is configured to ignore client requests. This can
happen when the client requests a character set not known to
the server, such as when a Japanese-enabled client requests
<code class="literal">
sjis
</code>
when connecting to a server not
configured with
<code class="literal">
sjis
</code>
support.
</p>
<p>
Some character sets cannot be used as the client character
set. Attempting to use them as the
<a class="link" href="server-system-variables.html#sysvar_character_set_client">
<code class="literal">
character_set_client
</code>
</a>
value
produces an error. See
<a class="xref" href="charset-connection.html#charset-connection-impermissible-client-charset" title="Impermissible Client Character Sets">
Impermissible Client Character Sets
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_character_set_connection">
</a>
<a class="link" href="server-system-variables.html#sysvar_character_set_connection">
<code class="literal">
character_set_connection
</code>
</a>
</p>
<a class="indexterm" name="idm46045277483712">
</a>
<a class="indexterm" name="idm46045277482608">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for character_set_connection">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_character_set_connection">
character_set_connection
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
utf8mb4
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The character set used for literals specified without a
character set introducer and for number-to-string conversion.
For information about introducers, see
<a class="xref" href="charset-introducer.html" title="12.3.8 Character Set Introducers">
Section 12.3.8, “Character Set Introducers”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_character_set_database">
</a>
<a class="link" href="server-system-variables.html#sysvar_character_set_database">
<code class="literal">
character_set_database
</code>
</a>
</p>
<a class="indexterm" name="idm46045277459536">
</a>
<a class="indexterm" name="idm46045277458496">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for character_set_database">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_character_set_database">
character_set_database
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
utf8mb4
</code>
</td>
</tr>
<tr>
<th>
Footnote
</th>
<td>
This option is dynamic, but should be set only by server. You should not set this variable manually.
</td>
</tr>
</tbody>
</table>
</div>
<p>
The character set used by the default database. The server
sets this variable whenever the default database changes. If
there is no default database, the variable has the same value
as
<a class="link" href="server-system-variables.html#sysvar_character_set_server">
<code class="literal">
character_set_server
</code>
</a>
.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
The global
<a class="link" href="server-system-variables.html#sysvar_character_set_database">
<code class="literal">
character_set_database
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_collation_database">
<code class="literal">
collation_database
</code>
</a>
system
variables are deprecated; expect them to be removed in a
future version of MySQL.
</p>
<p>
Assigning a value to the session
<a class="link" href="server-system-variables.html#sysvar_character_set_database">
<code class="literal">
character_set_database
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_collation_database">
<code class="literal">
collation_database
</code>
</a>
system
variables is deprecated and assignments produce a warning.
Expect the session variables to become read-only (and
assignments to them to produce an error) in a future version
of MySQL in which it remains possible to access the session
variables to determine the database character set and
collation for the default database.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_character_set_filesystem">
</a>
<a class="link" href="server-system-variables.html#sysvar_character_set_filesystem">
<code class="literal">
character_set_filesystem
</code>
</a>
</p>
<a class="indexterm" name="idm46045277425136">
</a>
<a class="indexterm" name="idm46045277424032">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for character_set_filesystem">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--character-set-filesystem=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_character_set_filesystem">
character_set_filesystem
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
binary
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The file system character set. This variable is used to
interpret string literals that refer to file names, such as in
the
<a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
<code class="literal">
LOAD DATA
</code>
</a>
and
<a class="link" href="select-into.html" title="15.2.13.1 SELECT ... INTO Statement">
<code class="literal">
SELECT ... INTO
OUTFILE
</code>
</a>
statements and the
<a class="link" href="string-functions.html#function_load-file">
<code class="literal">
LOAD_FILE()
</code>
</a>
function. Such file
names are converted from
<a class="link" href="server-system-variables.html#sysvar_character_set_client">
<code class="literal">
character_set_client
</code>
</a>
to
<a class="link" href="server-system-variables.html#sysvar_character_set_filesystem">
<code class="literal">
character_set_filesystem
</code>
</a>
before the file opening attempt occurs. The default value is
<code class="literal">
binary
</code>
, which means that no conversion
occurs. For systems on which multibyte file names are
permitted, a different value may be more appropriate. For
example, if the system represents file names using UTF-8, set
<a class="link" href="server-system-variables.html#sysvar_character_set_filesystem">
<code class="literal">
character_set_filesystem
</code>
</a>
to
<code class="literal">
'utf8mb4'
</code>
.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_character_set_results">
</a>
<a class="link" href="server-system-variables.html#sysvar_character_set_results">
<code class="literal">
character_set_results
</code>
</a>
</p>
<a class="indexterm" name="idm46045277388496">
</a>
<a class="indexterm" name="idm46045277387456">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for character_set_results">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_character_set_results">
character_set_results
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
utf8mb4
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The character set used for returning query results to the
client. This includes result data such as column values,
result metadata such as column names, and error messages.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_character_set_server">
</a>
<a class="link" href="server-system-variables.html#sysvar_character_set_server">
<code class="literal">
character_set_server
</code>
</a>
</p>
<a class="indexterm" name="idm46045277365136">
</a>
<a class="indexterm" name="idm46045277364096">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for character_set_server">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--character-set-server=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_character_set_server">
character_set_server
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
utf8mb4
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The servers default character set. See
<a class="xref" href="charset-configuration.html" title="12.15 Character Set Configuration">
Section 12.15, “Character Set Configuration”
</a>
. If you set this
variable, you should also set
<a class="link" href="server-system-variables.html#sysvar_collation_server">
<code class="literal">
collation_server
</code>
</a>
to specify
the collation for the character set.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_character_set_system">
</a>
<a class="link" href="server-system-variables.html#sysvar_character_set_system">
<code class="literal">
character_set_system
</code>
</a>
</p>
<a class="indexterm" name="idm46045277337456">
</a>
<a class="indexterm" name="idm46045277336416">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for character_set_system">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_character_set_system">
character_set_system
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
utf8mb3
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The character set used by the server for storing identifiers.
The value is always
<code class="literal">
utf8mb3
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_character_sets_dir">
</a>
<a class="link" href="server-system-variables.html#sysvar_character_sets_dir">
<code class="literal">
character_sets_dir
</code>
</a>
</p>
<a class="indexterm" name="idm46045277313552">
</a>
<a class="indexterm" name="idm46045277312512">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for character_sets_dir">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--character-sets-dir=dir_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_character_sets_dir">
character_sets_dir
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Directory name
</td>
</tr>
</tbody>
</table>
</div>
<p>
The directory where character sets are installed. See
<a class="xref" href="charset-configuration.html" title="12.15 Character Set Configuration">
Section 12.15, “Character Set Configuration”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_check_proxy_users">
</a>
<a class="link" href="server-system-variables.html#sysvar_check_proxy_users">
<code class="literal">
check_proxy_users
</code>
</a>
</p>
<a class="indexterm" name="idm46045277289696">
</a>
<a class="indexterm" name="idm46045277288656">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for check_proxy_users">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--check-proxy-users[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_check_proxy_users">
check_proxy_users
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Some authentication plugins implement proxy user mapping for
themselves (for example, the PAM and Windows authentication
plugins). Other authentication plugins do not support proxy
users by default. Of these, some can request that the MySQL
server itself map proxy users according to granted proxy
privileges:
<code class="literal">
mysql_native_password
</code>
(deprecated),
<code class="literal">
sha256_password
</code>
(deprecated).
</p>
<p>
If the
<a class="link" href="server-system-variables.html#sysvar_check_proxy_users">
<code class="literal">
check_proxy_users
</code>
</a>
system variable is enabled, the server performs proxy user
mapping for any authentication plugins that make such a
request. It may also be necessary to enable plugin-specific
system variables to take advantage of server proxy user
mapping support:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
For the deprecated
<code class="literal">
mysql_native_password
</code>
plugin
(deprecated), enable
<a class="link" href="server-system-variables.html#sysvar_mysql_native_password_proxy_users">
<code class="literal">
mysql_native_password_proxy_users
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
For the
<code class="literal">
sha256_password
</code>
plugin
(deprecated), enable
<a class="link" href="server-system-variables.html#sysvar_sha256_password_proxy_users">
<code class="literal">
sha256_password_proxy_users
</code>
</a>
.
</p>
</li>
</ul>
</div>
<p>
For information about user proxying, see
<a class="xref" href="proxy-users.html" title="8.2.19 Proxy Users">
Section 8.2.19, “Proxy Users”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_collation_connection">
</a>
<a class="link" href="server-system-variables.html#sysvar_collation_connection">
<code class="literal">
collation_connection
</code>
</a>
</p>
<a class="indexterm" name="idm46045277253104">
</a>
<a class="indexterm" name="idm46045277252064">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for collation_connection">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_collation_connection">
collation_connection
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
The collation of the connection character set.
<a class="link" href="server-system-variables.html#sysvar_collation_connection">
<code class="literal">
collation_connection
</code>
</a>
is
important for comparisons of literal strings. For comparisons
of strings with column values,
<a class="link" href="server-system-variables.html#sysvar_collation_connection">
<code class="literal">
collation_connection
</code>
</a>
does not
matter because columns have their own collation, which has a
higher collation precedence (see
<a class="xref" href="charset-collation-coercibility.html" title="12.8.4 Collation Coercibility in Expressions">
Section 12.8.4, “Collation Coercibility in Expressions”
</a>
).
</p>
<p>
Using the name of a user-defined collation for this variable
raises a warning.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_collation_database">
</a>
<a class="link" href="server-system-variables.html#sysvar_collation_database">
<code class="literal">
collation_database
</code>
</a>
</p>
<a class="indexterm" name="idm46045277228368">
</a>
<a class="indexterm" name="idm46045277227328">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for collation_database">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_collation_database">
collation_database
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
utf8mb4_0900_ai_ci
</code>
</td>
</tr>
<tr>
<th>
Footnote
</th>
<td>
This option is dynamic, but should be set only by server. You should not set this variable manually.
</td>
</tr>
</tbody>
</table>
</div>
<p>
The collation used by the default database. The server sets
this variable whenever the default database changes. If there
is no default database, the variable has the same value as
<a class="link" href="server-system-variables.html#sysvar_collation_server">
<code class="literal">
collation_server
</code>
</a>
.
</p>
<p>
The global
<a class="link" href="server-system-variables.html#sysvar_character_set_database">
<code class="literal">
character_set_database
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_collation_database">
<code class="literal">
collation_database
</code>
</a>
system
variables are deprecated; expect them to be removed in a
future version of MySQL.
</p>
<p>
Assigning a value to the session
<a class="link" href="server-system-variables.html#sysvar_character_set_database">
<code class="literal">
character_set_database
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_collation_database">
<code class="literal">
collation_database
</code>
</a>
system
variables is deprecated and assignments produce a warning.
Expect the session variables to become read-only (and
assignments to produce an error) in a future version of MySQL
in which it remains possible to access the session variables
to determine the database character set and collation for the
default database.
</p>
<p>
Using the name of a user-defined collation for
<a class="link" href="server-system-variables.html#sysvar_collation_database">
<code class="literal">
collation_database
</code>
</a>
raises a
warning.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_collation_server">
</a>
<a class="link" href="server-system-variables.html#sysvar_collation_server">
<code class="literal">
collation_server
</code>
</a>
</p>
<a class="indexterm" name="idm46045277193648">
</a>
<a class="indexterm" name="idm46045277192560">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for collation_server">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--collation-server=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_collation_server">
collation_server
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
utf8mb4_0900_ai_ci
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The server's default collation. See
<a class="xref" href="charset-configuration.html" title="12.15 Character Set Configuration">
Section 12.15, “Character Set Configuration”
</a>
.
</p>
<p>
Setting this to the name of a user-defined collation raises a
warning.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_completion_type">
</a>
<a class="link" href="server-system-variables.html#sysvar_completion_type">
<code class="literal">
completion_type
</code>
</a>
</p>
<a class="indexterm" name="idm46045277166912">
</a>
<a class="indexterm" name="idm46045277165824">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for completion_type">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--completion-type=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_completion_type">
completion_type
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NO_CHAIN
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
NO_CHAIN
</code>
</p>
<p class="valid-value">
<code class="literal">
CHAIN
</code>
</p>
<p class="valid-value">
<code class="literal">
RELEASE
</code>
</p>
<p class="valid-value">
<code class="literal">
0
</code>
</p>
<p class="valid-value">
<code class="literal">
1
</code>
</p>
<p class="valid-value">
<code class="literal">
2
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The transaction completion type. This variable can take the
values shown in the following table. The variable can be
assigned using either the name values or corresponding integer
values.
</p>
<div class="informaltable">
<table summary="Permitted values for the completion_type system variable.">
<colgroup>
<col style="width: 10%"/>
<col style="width: 75%"/>
</colgroup>
<thead>
<tr>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="literal">
NO_CHAIN
</code>
(or 0)
</td>
<td>
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
COMMIT
</code>
</a>
and
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
ROLLBACK
</code>
</a>
are unaffected. This is the default value.
</td>
</tr>
<tr>
<td>
<code class="literal">
CHAIN
</code>
(or 1)
</td>
<td>
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
COMMIT
</code>
</a>
and
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
ROLLBACK
</code>
</a>
are equivalent to
<code class="literal">
COMMIT AND CHAIN
</code>
and
<code class="literal">
ROLLBACK AND CHAIN
</code>
, respectively.
(A new transaction starts immediately with the same
isolation level as the just-terminated transaction.)
</td>
</tr>
<tr>
<td>
<code class="literal">
RELEASE
</code>
(or 2)
</td>
<td>
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
COMMIT
</code>
</a>
and
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
ROLLBACK
</code>
</a>
are equivalent to
<code class="literal">
COMMIT RELEASE
</code>
and
<code class="literal">
ROLLBACK RELEASE
</code>
, respectively. (The
server disconnects after terminating the transaction.)
</td>
</tr>
</tbody>
</table>
</div>
<p>
<a class="link" href="server-system-variables.html#sysvar_completion_type">
<code class="literal">
completion_type
</code>
</a>
affects
transactions that begin with
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
START
TRANSACTION
</code>
</a>
or
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
BEGIN
</code>
</a>
and
end with
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
COMMIT
</code>
</a>
or
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
ROLLBACK
</code>
</a>
. It
does not apply to implicit commits resulting from execution of
the statements listed in
<a class="xref" href="implicit-commit.html" title="15.3.3 Statements That Cause an Implicit Commit">
Section 15.3.3, “Statements That Cause an Implicit Commit”
</a>
. It
also does not apply for
<a class="link" href="xa-statements.html" title="15.3.8.1 XA Transaction SQL Statements">
<code class="literal">
XA
COMMIT
</code>
</a>
,
<a class="link" href="xa-statements.html" title="15.3.8.1 XA Transaction SQL Statements">
<code class="literal">
XA
ROLLBACK
</code>
</a>
, or when
<a class="link" href="server-system-variables.html#sysvar_autocommit">
<code class="literal">
autocommit=1
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_component_scheduler.enabled">
</a>
<a class="link" href="server-system-variables.html#sysvar_component_scheduler.enabled">
<code class="literal">
component_scheduler.enabled
</code>
</a>
</p>
<a class="indexterm" name="idm46045277098752">
</a>
<a class="indexterm" name="idm46045277097648">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for component_scheduler.enabled">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--component-scheduler.enabled[=value]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_component_scheduler.enabled">
component_scheduler.enabled
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
When set to
<code class="literal">
OFF
</code>
at startup, the background
thread does not start. Tasks can still be scheduled, but they
do not run until
<code class="literal">
component_scheduler
</code>
is
enabled. When set to
<code class="literal">
ON
</code>
at startup, the
component is fully operational.
</p>
<p>
It is also possible to set the value dynamically to get the
following effects:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
ON
</code>
starts the background thread that
begins servicing the queue immediately.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
OFF
</code>
signals a termination of the
background thread, which waits for it to end. The
background thread checks the termination flag before
accessing the queue to check for tasks to execute.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_concurrent_insert">
</a>
<a class="link" href="server-system-variables.html#sysvar_concurrent_insert">
<code class="literal">
concurrent_insert
</code>
</a>
</p>
<a class="indexterm" name="idm46045277066656">
</a>
<a class="indexterm" name="idm46045277065616">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for concurrent_insert">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--concurrent-insert[=value]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_concurrent_insert">
concurrent_insert
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
AUTO
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
NEVER
</code>
</p>
<p class="valid-value">
<code class="literal">
AUTO
</code>
</p>
<p class="valid-value">
<code class="literal">
ALWAYS
</code>
</p>
<p class="valid-value">
<code class="literal">
0
</code>
</p>
<p class="valid-value">
<code class="literal">
1
</code>
</p>
<p class="valid-value">
<code class="literal">
2
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If
<code class="literal">
AUTO
</code>
(the default), MySQL permits
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
and
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements to run
concurrently for
<code class="literal">
MyISAM
</code>
tables that have no
free blocks in the middle of the data file.
</p>
<p>
This variable can take the values shown in the following
table. The variable can be assigned using either the name
values or corresponding integer values.
</p>
<div class="informaltable">
<table summary="Permitted values for the concurrent_insert system variable.">
<colgroup>
<col style="width: 10%"/>
<col style="width: 75%"/>
</colgroup>
<thead>
<tr>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="literal">
NEVER
</code>
(or 0)
</td>
<td>
Disables concurrent inserts
</td>
</tr>
<tr>
<td>
<code class="literal">
AUTO
</code>
(or 1)
</td>
<td>
(Default) Enables concurrent insert for
<code class="literal">
MyISAM
</code>
tables
that do not have holes
</td>
</tr>
<tr>
<td>
<code class="literal">
ALWAYS
</code>
(or 2)
</td>
<td>
Enables concurrent inserts for all
<code class="literal">
MyISAM
</code>
tables,
even those that have holes. For a table with a hole, new
rows are inserted at the end of the table if it is in
use by another thread. Otherwise, MySQL acquires a
normal write lock and inserts the row into the hole.
</td>
</tr>
</tbody>
</table>
</div>
<p>
If you start
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
with
<a class="link" href="server-options.html#option_mysqld_skip-new">
<code class="option">
--skip-new
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_concurrent_insert">
<code class="literal">
concurrent_insert
</code>
</a>
is set to
<code class="literal">
NEVER
</code>
.
</p>
<p>
See also
<a class="xref" href="concurrent-inserts.html" title="10.11.3 Concurrent Inserts">
Section 10.11.3, “Concurrent Inserts”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_connect_timeout">
</a>
<a class="link" href="server-system-variables.html#sysvar_connect_timeout">
<code class="literal">
connect_timeout
</code>
</a>
</p>
<a class="indexterm" name="idm46045277007888">
</a>
<a class="indexterm" name="idm46045277006816">
</a>
<a class="indexterm" name="idm46045277005728">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for connect_timeout">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--connect-timeout=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_connect_timeout">
connect_timeout
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
10
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
2
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of seconds that the
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
server waits for a connect packet before responding with
<code class="literal">
Bad handshake
</code>
. The default value is 10
seconds.
</p>
<p>
Increasing the
<a class="link" href="server-system-variables.html#sysvar_connect_timeout">
<code class="literal">
connect_timeout
</code>
</a>
value might
help if clients frequently encounter errors of the form
<code class="literal">
Lost connection to MySQL server at
'
<em class="replaceable">
<code>
XXX
</code>
</em>
', system error:
<em class="replaceable">
<code>
errno
</code>
</em>
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_connection_memory_chunk_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_connection_memory_chunk_size">
<code class="literal">
connection_memory_chunk_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045276968992">
</a>
<a class="indexterm" name="idm46045276967888">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for connection_memory_chunk_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--connection-memory-chunk-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_connection_memory_chunk_size">
connection_memory_chunk_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
8192
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
536870912
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
Set the chunking size for updates to the global memory usage
counter
<a class="link" href="server-status-variables.html#statvar_Global_connection_memory">
<code class="literal">
Global_connection_memory
</code>
</a>
.
The status variable is updated only when total memory
consumption by all user connections changes by more than this
amount. Disable updates by setting
<code class="literal">
connection_memory_chunk_size = 0
</code>
.
</p>
<p>
The memory calculation is exclusive of any memory used by
system users such as the MySQL root user. Memory used by the
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
buffer pool is also not
included.
</p>
<p>
You must have the
<a class="link" href="privileges-provided.html#priv_system-variables-admin">
<code class="literal">
SYSTEM_VARIABLES_ADMIN
</code>
</a>
or
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege to set this
variable.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_connection_memory_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_connection_memory_limit">
<code class="literal">
connection_memory_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045276929360">
</a>
<a class="indexterm" name="idm46045276928320">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for connection_memory_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--connection-memory-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_connection_memory_limit">
connection_memory_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
2097152
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
Set the maximum amount of memory that can be used by a single
user connection. If any user connection uses more than this
amount, all queries from this connection are rejected with
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_conn_limit" target="_top">
<code class="literal">
ER_CONN_LIMIT
</code>
</a>
, including any
queries currently running.
</p>
<p>
The limit set by this variable does not apply to system users,
or to the MySQL root account. Memory used by the
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
buffer pool is also not
included.
</p>
<p>
You must have the
<a class="link" href="privileges-provided.html#priv_system-variables-admin">
<code class="literal">
SYSTEM_VARIABLES_ADMIN
</code>
</a>
or
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege to set this
variable.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_core_file">
</a>
<a class="link" href="server-system-variables.html#sysvar_core_file">
<code class="literal">
core_file
</code>
</a>
</p>
<a class="indexterm" name="idm46045276890672">
</a>
<a class="indexterm" name="idm46045276889584">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for core_file">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_core_file">
core_file
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether to write a core file if the server unexpectedly exits.
This variable is set by the
<a class="link" href="server-options.html#option_mysqld_core-file">
<code class="option">
--core-file
</code>
</a>
option.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_create_admin_listener_thread">
</a>
<a class="link" href="server-system-variables.html#sysvar_create_admin_listener_thread">
<code class="literal">
create_admin_listener_thread
</code>
</a>
</p>
<a class="indexterm" name="idm46045276866480">
</a>
<a class="indexterm" name="idm46045276865376">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for create_admin_listener_thread">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--create-admin-listener-thread[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_create_admin_listener_thread">
create_admin_listener_thread
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether to use a dedicated listening thread for client
connections on the administrative network interface (see
<a class="xref" href="connection-interfaces.html" title="7.1.12.1 Connection Interfaces">
Section 7.1.12.1, “Connection Interfaces”
</a>
). The default is
<code class="literal">
OFF
</code>
; that is, the manager thread for
ordinary connections on the main interface also handles
connections for the administrative interface.
</p>
<p>
Depending on factors such as platform type and workload, you
may find one setting for this variable yields better
performance than the other setting.
</p>
<p>
Setting
<a class="link" href="server-system-variables.html#sysvar_create_admin_listener_thread">
<code class="literal">
create_admin_listener_thread
</code>
</a>
has no effect if
<a class="link" href="server-system-variables.html#sysvar_admin_address">
<code class="literal">
admin_address
</code>
</a>
is not
specified because in that case the server maintains no
administrative network interface.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_cte_max_recursion_depth">
</a>
<a class="link" href="server-system-variables.html#sysvar_cte_max_recursion_depth">
<code class="literal">
cte_max_recursion_depth
</code>
</a>
</p>
<a class="indexterm" name="idm46045276835440">
</a>
<a class="indexterm" name="idm46045276834400">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for cte_max_recursion_depth">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--cte-max-recursion-depth=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_cte_max_recursion_depth">
cte_max_recursion_depth
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1000
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The common table expression (CTE) maximum recursion depth. The
server terminates execution of any CTE that recurses more
levels than the value of this variable. For more information,
see
<a class="xref" href="with.html#common-table-expressions-recursion-limits" title="Limiting Common Table Expression Recursion">
Limiting Common Table Expression Recursion
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_datadir">
</a>
<a class="link" href="server-system-variables.html#sysvar_datadir">
<code class="literal">
datadir
</code>
</a>
</p>
<a class="indexterm" name="idm46045276803968">
</a>
<a class="indexterm" name="idm46045276802896">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for datadir">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--datadir=dir_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_datadir">
datadir
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Directory name
</td>
</tr>
</tbody>
</table>
</div>
<p>
The path to the MySQL server data directory. Relative paths
are resolved with respect to the current directory. If you
expect the server to be started automatically (that is, in
contexts for which you cannot know the current directory in
advance), it is best to specify the
<a class="link" href="server-system-variables.html#sysvar_datadir">
<code class="literal">
datadir
</code>
</a>
value as an absolute
path.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_debug">
</a>
<a class="link" href="server-system-variables.html#sysvar_debug">
<code class="literal">
debug
</code>
</a>
</p>
<a class="indexterm" name="idm46045276779408">
</a>
<a class="indexterm" name="idm46045276778336">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for debug">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--debug[=debug_options]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_debug">
debug
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value (Unix)
</th>
<td>
<code class="literal">
d:t:i:o,/tmp/mysqld.trace
</code>
</td>
</tr>
<tr>
<th>
Default Value (Windows)
</th>
<td>
<code class="literal">
d:t:i:O,\mysqld.trace
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable indicates the current debugging settings. It is
available only for servers built with debugging support. The
initial value comes from the value of instances of the
<a class="link" href="server-options.html#option_mysqld_debug">
<code class="option">
--debug
</code>
</a>
option given at server
startup. The global and session values may be set at runtime.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
Assigning a value that begins with
<code class="literal">
+
</code>
or
<code class="literal">
-
</code>
cause the value to added to or subtracted
from the current value:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa8920973"><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></span> <span class="token keyword">SET</span> debug <span class="token operator">=</span> <span class="token string">'T'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token variable">@@debug</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>
<span class="token output"><span class="token punctuation">|</span> @@debug <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>
<span class="token output"><span class="token punctuation">|</span> T <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>
<span class="token prompt">mysql></span> <span class="token keyword">SET</span> debug <span class="token operator">=</span> <span class="token string">'+P'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token variable">@@debug</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>
<span class="token output"><span class="token punctuation">|</span> @@debug <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>
<span class="token output"><span class="token punctuation">|</span> P:T <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>
<span class="token prompt">mysql></span> <span class="token keyword">SET</span> debug <span class="token operator">=</span> <span class="token string">'-P'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token variable">@@debug</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>
<span class="token output"><span class="token punctuation">|</span> @@debug <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>
<span class="token output"><span class="token punctuation">|</span> T <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></code></pre>
</div>
<p>
For more information, see
<a class="xref" href="dbug-package.html" title="7.9.4 The DBUG Package">
Section 7.9.4, “The DBUG Package”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_debug_sync">
</a>
<a class="link" href="server-system-variables.html#sysvar_debug_sync">
<code class="literal">
debug_sync
</code>
</a>
</p>
<a class="indexterm" name="idm46045276740400">
</a>
<a class="indexterm" name="idm46045276739312">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for debug_sync">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_debug_sync">
debug_sync
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable is the user interface to the Debug Sync
facility. Use of Debug Sync requires that MySQL be configured
with the
<a class="link" href="source-configuration-options.html#option_cmake_with_debug">
<code class="option">
-DWITH_DEBUG=ON
</code>
</a>
<span class="command">
<strong>
CMake
</strong>
</span>
option (see
<a class="xref" href="source-configuration-options.html" title="2.8.7 MySQL Source-Configuration Options">
Section 2.8.7, “MySQL Source-Configuration Options”
</a>
); otherwise,
this system variable is not available.
</p>
<p>
The global variable value is read only and indicates whether
the facility is enabled. By default, Debug Sync is disabled
and the value of
<a class="link" href="server-system-variables.html#sysvar_debug_sync">
<code class="literal">
debug_sync
</code>
</a>
is
<code class="literal">
OFF
</code>
. If the server is started with
<a class="link" href="server-options.html#option_mysqld_debug-sync-timeout">
<code class="option">
--debug-sync-timeout=
<em class="replaceable">
<code>
N
</code>
</em>
</code>
</a>
,
where
<em class="replaceable">
<code>
N
</code>
</em>
is a timeout value greater
than 0, Debug Sync is enabled and the value of
<a class="link" href="server-system-variables.html#sysvar_debug_sync">
<code class="literal">
debug_sync
</code>
</a>
is
<code class="literal">
ON -
current signal
</code>
followed by the signal name. Also,
<em class="replaceable">
<code>
N
</code>
</em>
becomes the default timeout for
individual synchronization points.
</p>
<p>
The session value can be read by any user and has the same
value as the global variable. The session value can be set to
control synchronization points.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
For a description of the Debug Sync facility and how to use
synchronization points, see
<a class="ulink" href="/doc/internals/en/test-synchronization.html" target="_top">
MySQL
Internals: Test Synchronization
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_default_collation_for_utf8mb4">
</a>
<a class="link" href="server-system-variables.html#sysvar_default_collation_for_utf8mb4">
<code class="literal">
default_collation_for_utf8mb4
</code>
</a>
</p>
<a class="indexterm" name="idm46045276707248">
</a>
<a class="indexterm" name="idm46045276706144">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for default_collation_for_utf8mb4">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_default_collation_for_utf8mb4">
default_collation_for_utf8mb4
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
utf8mb4_0900_ai_ci
</code>
</p>
<p class="valid-value">
<code class="literal">
utf8mb4_general_ci
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
The
<code class="literal">
default_collation_for_utf8mb4
</code>
system
variable is for internal use by MySQL Replication only.
</p>
</div>
<p>
This variable is set by the server to the default collation
for the
<code class="literal">
utf8mb4
</code>
character set. The value of
the variable is replicated from a source to a replica so that
the replica can correctly process data originating from a
source with a different default collation for
<code class="literal">
utf8mb4
</code>
. This variable is primarily
intended to support replication from a MySQL 5.7 or older
replication source server to a later MySQL replica server, or
group replication with a MySQL 5.7 primary node and one or
more MySQL 8.0 or later secondaries. The default collation for
<code class="literal">
utf8mb4
</code>
in MySQL 5.7 is
<code class="literal">
utf8mb4_general_ci
</code>
, but
<code class="literal">
utf8mb4_0900_ai_ci
</code>
in later release series.
The variable is not present in releases earlier than MySQL
8.0, so if the replica does not receive a value for the
variable, it assumes the source is from an earlier release and
sets the value to the previous default collation
<code class="literal">
utf8mb4_general_ci
</code>
.
</p>
<p>
The default
<code class="literal">
utf8mb4
</code>
collation is used in
the following statements:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<a class="link" href="show-collation.html" title="15.7.7.5 SHOW COLLATION Statement">
<code class="literal">
SHOW COLLATION
</code>
</a>
and
<a class="link" href="show-character-set.html" title="15.7.7.4 SHOW CHARACTER SET Statement">
<code class="literal">
SHOW CHARACTER SET
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
</code>
</a>
and
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
having a
<code class="literal">
CHARACTER SET utf8mb4
</code>
clause without a
<code class="literal">
COLLATION
</code>
clause, either for the table
character set or for a column character set.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="create-database.html" title="15.1.12 CREATE DATABASE Statement">
<code class="literal">
CREATE DATABASE
</code>
</a>
and
<a class="link" href="alter-database.html" title="15.1.2 ALTER DATABASE Statement">
<code class="literal">
ALTER DATABASE
</code>
</a>
having a
<code class="literal">
CHARACTER SET utf8mb4
</code>
clause without a
<code class="literal">
COLLATION
</code>
clause.
</p>
</li>
<li class="listitem">
<p>
Any statement containing a string literal of the form
<code class="literal">
_utf8mb4'
<em class="replaceable">
<code>
some
text
</code>
</em>
'
</code>
without a
<code class="literal">
COLLATE
</code>
clause.
</p>
</li>
</ul>
</div>
<p>
See also
<a class="xref" href="charset-unicode.html" title="12.9 Unicode Support">
Section 12.9, “Unicode Support”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_default_password_lifetime">
</a>
<a class="link" href="server-system-variables.html#sysvar_default_password_lifetime">
<code class="literal">
default_password_lifetime
</code>
</a>
</p>
<a class="indexterm" name="idm46045276656640">
</a>
<a class="indexterm" name="idm46045276655536">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for default_password_lifetime">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--default-password-lifetime=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_default_password_lifetime">
default_password_lifetime
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
65535
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
days
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable defines the global automatic password expiration
policy. The default
<a class="link" href="server-system-variables.html#sysvar_default_password_lifetime">
<code class="literal">
default_password_lifetime
</code>
</a>
value is 0, which disables automatic password expiration. If
the value of
<a class="link" href="server-system-variables.html#sysvar_default_password_lifetime">
<code class="literal">
default_password_lifetime
</code>
</a>
is
a positive integer
<em class="replaceable">
<code>
N
</code>
</em>
, it indicates
the permitted password lifetime; passwords must be changed
every
<em class="replaceable">
<code>
N
</code>
</em>
days.
</p>
<p>
The global password expiration policy can be overridden as
desired for individual accounts using the password expiration
option of the
<a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
<code class="literal">
CREATE USER
</code>
</a>
and
<a class="link" href="alter-user.html" title="15.7.1.1 ALTER USER Statement">
<code class="literal">
ALTER USER
</code>
</a>
statements. See
<a class="xref" href="password-management.html" title="8.2.15 Password Management">
Section 8.2.15, “Password Management”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_default_storage_engine">
</a>
<a class="link" href="server-system-variables.html#sysvar_default_storage_engine">
<code class="literal">
default_storage_engine
</code>
</a>
</p>
<a class="indexterm" name="idm46045276616688">
</a>
<a class="indexterm" name="idm46045276615648">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for default_storage_engine">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--default-storage-engine=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_default_storage_engine">
default_storage_engine
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
InnoDB
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The default storage engine for tables. See
<a class="xref" href="storage-engines.html" title="Chapter 18 Alternative Storage Engines">
Chapter 18,
<i>
Alternative Storage Engines
</i>
</a>
. This variable sets the
storage engine for permanent tables only. To set the storage
engine for
<code class="literal">
TEMPORARY
</code>
tables, set the
<a class="link" href="server-system-variables.html#sysvar_default_tmp_storage_engine">
<code class="literal">
default_tmp_storage_engine
</code>
</a>
system variable.
</p>
<p>
To see which storage engines are available and enabled, use
the
<a class="link" href="show-engines.html" title="15.7.7.17 SHOW ENGINES Statement">
<code class="literal">
SHOW ENGINES
</code>
</a>
statement or
query the
<code class="literal">
INFORMATION_SCHEMA
</code>
<a class="link" href="information-schema-engines-table.html" title="28.3.13 The INFORMATION_SCHEMA ENGINES Table">
<code class="literal">
ENGINES
</code>
</a>
table.
</p>
<p>
If you disable the default storage engine at server startup,
you must set the default engine for both permanent and
<code class="literal">
TEMPORARY
</code>
tables to a different engine, or
else the server does not start.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_default_table_encryption">
</a>
<a class="link" href="server-system-variables.html#sysvar_default_table_encryption">
<code class="literal">
default_table_encryption
</code>
</a>
</p>
<a class="indexterm" name="idm46045276582944">
</a>
<a class="indexterm" name="idm46045276581856">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for default_table_encryption">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--default-table-encryption[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_default_table_encryption">
default_table_encryption
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Defines the default encryption setting applied to schemas and
general tablespaces when they are created without specifying
an
<code class="literal">
ENCRYPTION
</code>
clause.
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_default_table_encryption">
<code class="literal">
default_table_encryption
</code>
</a>
variable is only applicable to user-created schemas and
general tablespaces. It does not govern encryption of the
<code class="literal">
mysql
</code>
system tablespace.
</p>
<p>
Setting the runtime value of
<a class="link" href="server-system-variables.html#sysvar_default_table_encryption">
<code class="literal">
default_table_encryption
</code>
</a>
requires the
<a class="link" href="privileges-provided.html#priv_system-variables-admin">
<code class="literal">
SYSTEM_VARIABLES_ADMIN
</code>
</a>
and
<a class="link" href="privileges-provided.html#priv_table-encryption-admin">
<code class="literal">
TABLE_ENCRYPTION_ADMIN
</code>
</a>
privileges, or the deprecated
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_default_table_encryption">
<code class="literal">
default_table_encryption
</code>
</a>
supports
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
PERSIST
</code>
</a>
and
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
PERSIST_ONLY
</code>
</a>
syntax. See
<a class="xref" href="persisted-system-variables.html" title="7.1.9.3 Persisted System Variables">
Section 7.1.9.3, “Persisted System Variables”
</a>
.
</p>
<p>
For more information, see
<a class="xref" href="innodb-data-encryption.html#innodb-schema-tablespace-encryption-default" title="Defining an Encryption Default for Schemas and General Tablespaces">
Defining an Encryption Default for Schemas and General Tablespaces
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_default_tmp_storage_engine">
</a>
<a class="link" href="server-system-variables.html#sysvar_default_tmp_storage_engine">
<code class="literal">
default_tmp_storage_engine
</code>
</a>
</p>
<a class="indexterm" name="idm46045276542016">
</a>
<a class="indexterm" name="idm46045276540912">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for default_tmp_storage_engine">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--default-tmp-storage-engine=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_default_tmp_storage_engine">
default_tmp_storage_engine
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
InnoDB
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The default storage engine for
<code class="literal">
TEMPORARY
</code>
tables (created with
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TEMPORARY
TABLE
</code>
</a>
). To set the storage engine for permanent
tables, set the
<a class="link" href="server-system-variables.html#sysvar_default_storage_engine">
<code class="literal">
default_storage_engine
</code>
</a>
system
variable. Also see the discussion of that variable regarding
possible values.
</p>
<p>
If you disable the default storage engine at server startup,
you must set the default engine for both permanent and
<code class="literal">
TEMPORARY
</code>
tables to a different engine, or
else the server does not start.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_default_week_format">
</a>
<a class="link" href="server-system-variables.html#sysvar_default_week_format">
<code class="literal">
default_week_format
</code>
</a>
</p>
<a class="indexterm" name="idm46045276511488">
</a>
<a class="indexterm" name="idm46045276510448">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for default_week_format">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--default-week-format=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_default_week_format">
default_week_format
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
7
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The default mode value to use for the
<a class="link" href="date-and-time-functions.html#function_week">
<code class="literal">
WEEK()
</code>
</a>
function. See
<a class="xref" href="date-and-time-functions.html" title="14.7 Date and Time Functions">
Section 14.7, “Date and Time Functions”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_delay_key_write">
</a>
<a class="link" href="server-system-variables.html#sysvar_delay_key_write">
<code class="literal">
delay_key_write
</code>
</a>
</p>
<a class="indexterm" name="idm46045276479104">
</a>
<a class="indexterm" name="idm46045276478016">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for delay_key_write">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--delay-key-write[={OFF|ON|ALL}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_delay_key_write">
delay_key_write
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
OFF
</code>
</p>
<p class="valid-value">
<code class="literal">
ON
</code>
</p>
<p class="valid-value">
<code class="literal">
ALL
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable specifies how to use delayed key writes. It
applies only to
<code class="literal">
MyISAM
</code>
tables. Delayed key
writing causes key buffers not to be flushed between writes.
See also
<a class="xref" href="myisam-start.html" title="18.2.1 MyISAM Startup Options">
Section 18.2.1, “MyISAM Startup Options”
</a>
.
</p>
<p>
This variable can have one of the following values to affect
handling of the
<code class="literal">
DELAY_KEY_WRITE
</code>
table
option that can be used in
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE
TABLE
</code>
</a>
statements.
</p>
<div class="informaltable">
<table summary="Permitted values for the delay_key_write system variable.">
<colgroup>
<col style="width: 10%"/>
<col style="width: 75%"/>
</colgroup>
<thead>
<tr>
<th>
Option
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="literal">
OFF
</code>
</td>
<td>
<code class="literal">
DELAY_KEY_WRITE
</code>
is ignored.
</td>
</tr>
<tr>
<td>
<code class="literal">
ON
</code>
</td>
<td>
MySQL honors any
<code class="literal">
DELAY_KEY_WRITE
</code>
option specified in
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
</code>
</a>
statements.
This is the default value.
</td>
</tr>
<tr>
<td>
<code class="literal">
ALL
</code>
</td>
<td>
All new opened tables are treated as if they were created with the
<code class="literal">
DELAY_KEY_WRITE
</code>
option enabled.
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
If you set this variable to
<code class="literal">
ALL
</code>
, you
should not use
<code class="literal">
MyISAM
</code>
tables from within
another program (such as another MySQL server or
<a class="link" href="myisamchk.html" title="6.6.4 myisamchk — MyISAM Table-Maintenance Utility">
<span class="command">
<strong>
myisamchk
</strong>
</span>
</a>
) when the tables are in use.
Doing so leads to index corruption.
</p>
</div>
<p>
If
<code class="literal">
DELAY_KEY_WRITE
</code>
is enabled for a table,
the key buffer is not flushed for the table on every index
update, but only when the table is closed. This speeds up
writes on keys a lot, but if you use this feature, you should
add automatic checking of all
<code class="literal">
MyISAM
</code>
tables
by starting the server with the
<a class="link" href="server-system-variables.html#sysvar_myisam_recover_options">
<code class="literal">
myisam_recover_options
</code>
</a>
system
variable set (for example,
<a class="link" href="server-system-variables.html#sysvar_myisam_recover_options">
<code class="literal">
myisam_recover_options='BACKUP,FORCE'
</code>
</a>
).
See
<a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
Section 7.1.8, “Server System Variables”
</a>
, and
<a class="xref" href="myisam-start.html" title="18.2.1 MyISAM Startup Options">
Section 18.2.1, “MyISAM Startup Options”
</a>
.
</p>
<p>
If you start
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
with
<a class="link" href="server-options.html#option_mysqld_skip-new">
<code class="option">
--skip-new
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_delay_key_write">
<code class="literal">
delay_key_write
</code>
</a>
is set to
<code class="literal">
OFF
</code>
.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Warning
</div>
<p>
If you enable external locking with
<a class="link" href="server-options.html#option_mysqld_external-locking">
<code class="option">
--external-locking
</code>
</a>
, there is
no protection against index corruption for tables that use
delayed key writes.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_delayed_insert_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_delayed_insert_limit">
<code class="literal">
delayed_insert_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045276412336">
</a>
<a class="indexterm" name="idm46045276411296">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for delayed_insert_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--delayed-insert-limit=#
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_delayed_insert_limit">
delayed_insert_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
100
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This system variable is deprecated (because
<code class="literal">
DELAYED
</code>
inserts are not supported), and you
should expect it to be removed in a future release.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_delayed_insert_timeout">
</a>
<a class="link" href="server-system-variables.html#sysvar_delayed_insert_timeout">
<code class="literal">
delayed_insert_timeout
</code>
</a>
</p>
<a class="indexterm" name="idm46045276376512">
</a>
<a class="indexterm" name="idm46045276375472">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for delayed_insert_timeout">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--delayed-insert-timeout=#
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_delayed_insert_timeout">
delayed_insert_timeout
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
300
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
This system variable is deprecated (because
<code class="literal">
DELAYED
</code>
inserts are not supported), and you
should expect it to be removed in a future release.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_delayed_queue_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_delayed_queue_size">
<code class="literal">
delayed_queue_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045276341072">
</a>
<a class="indexterm" name="idm46045276340032">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for delayed_queue_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--delayed-queue-size=#
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_delayed_queue_size">
delayed_queue_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1000
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This system variable is deprecated (because
<code class="literal">
DELAYED
</code>
inserts are not supported), and you
should expect it to be removed in a future release.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_disabled_storage_engines">
</a>
<a class="link" href="server-system-variables.html#sysvar_disabled_storage_engines">
<code class="literal">
disabled_storage_engines
</code>
</a>
</p>
<a class="indexterm" name="idm46045276305328">
</a>
<a class="indexterm" name="idm46045276304224">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for disabled_storage_engines">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--disabled-storage-engines=engine[,engine]...
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_disabled_storage_engines">
disabled_storage_engines
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
empty string
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable indicates which storage engines cannot be used
to create tables or tablespaces. For example, to prevent new
<code class="literal">
MyISAM
</code>
or
<code class="literal">
FEDERATED
</code>
tables from being created, start the server with these lines
in the server option file:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-ini"><div class="docs-select-all right" id="sa52040265"><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">disabled_storage_engines</span><span class="token attr-value"><span class="token punctuation">=</span>"MyISAM,FEDERATED"</span></code></pre>
</div>
<p>
By default,
<a class="link" href="server-system-variables.html#sysvar_disabled_storage_engines">
<code class="literal">
disabled_storage_engines
</code>
</a>
is
empty (no engines disabled), but it can be set to a
comma-separated list of one or more engines (not
case-sensitive). Any engine named in the value cannot be used
to create tables or tablespaces with
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
</code>
</a>
or
<a class="link" href="create-tablespace.html" title="15.1.21 CREATE TABLESPACE Statement">
<code class="literal">
CREATE TABLESPACE
</code>
</a>
, and cannot
be used with
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE ...
ENGINE
</code>
</a>
or
<a class="link" href="alter-tablespace.html" title="15.1.10 ALTER TABLESPACE Statement">
<code class="literal">
ALTER
TABLESPACE ... ENGINE
</code>
</a>
to change the storage engine
of existing tables or tablespaces. Attempts to do so result in
an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_disabled_storage_engine" target="_top">
<code class="literal">
ER_DISABLED_STORAGE_ENGINE
</code>
</a>
error.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_disabled_storage_engines">
<code class="literal">
disabled_storage_engines
</code>
</a>
does
not restrict other DDL statements for existing tables, such as
<a class="link" href="create-index.html" title="15.1.15 CREATE INDEX Statement">
<code class="literal">
CREATE INDEX
</code>
</a>
,
<a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
<code class="literal">
TRUNCATE TABLE
</code>
</a>
,
<a class="link" href="analyze-table.html" title="15.7.3.1 ANALYZE TABLE Statement">
<code class="literal">
ANALYZE TABLE
</code>
</a>
,
<a class="link" href="drop-table.html" title="15.1.32 DROP TABLE Statement">
<code class="literal">
DROP TABLE
</code>
</a>
, or
<a class="link" href="drop-tablespace.html" title="15.1.33 DROP TABLESPACE Statement">
<code class="literal">
DROP TABLESPACE
</code>
</a>
. This permits a
smooth transition so that existing tables or tablespaces that
use a disabled engine can be migrated to a permitted engine by
means such as
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE ...
ENGINE
<em class="replaceable">
<code>
permitted_engine
</code>
</em>
</code>
</a>
.
</p>
<p>
It is permitted to set the
<a class="link" href="server-system-variables.html#sysvar_default_storage_engine">
<code class="literal">
default_storage_engine
</code>
</a>
or
<a class="link" href="server-system-variables.html#sysvar_default_tmp_storage_engine">
<code class="literal">
default_tmp_storage_engine
</code>
</a>
system variable to a storage engine that is disabled. This
could cause applications to behave erratically or fail,
although that might be a useful technique in a development
environment for identifying applications that use disabled
engines, so that they can be modified.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_disabled_storage_engines">
<code class="literal">
disabled_storage_engines
</code>
</a>
is
disabled and has no effect if the server is started with any
of these options:
<a class="link" href="server-options.html#option_mysqld_initialize">
<code class="option">
--initialize
</code>
</a>
,
<a class="link" href="server-options.html#option_mysqld_initialize-insecure">
<code class="option">
--initialize-insecure
</code>
</a>
,
<a class="link" href="server-options.html#option_mysqld_skip-grant-tables">
<code class="option">
--skip-grant-tables
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_disconnect_on_expired_password">
</a>
<a class="link" href="server-system-variables.html#sysvar_disconnect_on_expired_password">
<code class="literal">
disconnect_on_expired_password
</code>
</a>
</p>
<a class="indexterm" name="idm46045276250976">
</a>
<a class="indexterm" name="idm46045276249872">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for disconnect_on_expired_password">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--disconnect-on-expired-password[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_disconnect_on_expired_password">
disconnect_on_expired_password
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls how the server handles clients with
expired passwords:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If the client indicates that it can handle expired
passwords, the value of
<a class="link" href="server-system-variables.html#sysvar_disconnect_on_expired_password">
<code class="literal">
disconnect_on_expired_password
</code>
</a>
is irrelevant. The server permits the client to connect
but puts it in sandbox mode.
</p>
</li>
<li class="listitem">
<p>
If the client does not indicate that it can handle expired
passwords, the server handles the client according to the
value of
<a class="link" href="server-system-variables.html#sysvar_disconnect_on_expired_password">
<code class="literal">
disconnect_on_expired_password
</code>
</a>
:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: square; ">
<li class="listitem">
<p>
If
<a class="link" href="server-system-variables.html#sysvar_disconnect_on_expired_password">
<code class="literal">
disconnect_on_expired_password
</code>
</a>
:
is enabled, the server disconnects the client.
</p>
</li>
<li class="listitem">
<p>
If
<a class="link" href="server-system-variables.html#sysvar_disconnect_on_expired_password">
<code class="literal">
disconnect_on_expired_password
</code>
</a>
:
is disabled, the server permits the client to connect
but puts it in sandbox mode.
</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<p>
For more information about the interaction of client and
server settings relating to expired-password handling, see
<a class="xref" href="expired-password-handling.html" title="8.2.16 Server Handling of Expired Passwords">
Section 8.2.16, “Server Handling of Expired Passwords”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_div_precision_increment">
</a>
<a class="link" href="server-system-variables.html#sysvar_div_precision_increment">
<code class="literal">
div_precision_increment
</code>
</a>
</p>
<a class="indexterm" name="idm46045276214192">
</a>
<a class="indexterm" name="idm46045276213152">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for div_precision_increment">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--div-precision-increment=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_div_precision_increment">
div_precision_increment
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
4
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
30
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable indicates the number of digits by which to
increase the scale of the result of division operations
performed with the
<a class="link" href="arithmetic-functions.html#operator_divide">
<code class="literal">
/
</code>
</a>
operator.
The default value is 4. The minimum and maximum values are 0
and 30, respectively. The following example illustrates the
effect of increasing the default value.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-ini"><div class="docs-select-all right" id="sa79574625"><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">mysql> SELECT 1/7;
+--------+
| 1/7 |
+--------+
| 0.1429 |
+--------+
mysql> SET div_precision_increment <span class="token attr-value"><span class="token punctuation">=</span> 12;</span>
mysql> SELECT 1/7;
+----------------+
| 1/7 |
+----------------+
| 0.142857142857 |
+----------------+</code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_dragnet.log_error_filter_rules">
</a>
<a class="link" href="server-system-variables.html#sysvar_dragnet.log_error_filter_rules">
<code class="literal">
dragnet.log_error_filter_rules
</code>
</a>
</p>
<a class="indexterm" name="idm46045276178784">
</a>
<a class="indexterm" name="idm46045276177680">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for dragnet.log_error_filter_rules">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--dragnet.log-error-filter-rules=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_dragnet.log_error_filter_rules">
dragnet.log_error_filter_rules
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
IF prio>=INFORMATION THEN drop. IF EXISTS source_line THEN unset source_line.
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The filter rules that control operation of the
<code class="literal">
log_filter_dragnet
</code>
error log filter
component. If
<code class="literal">
log_filter_dragnet
</code>
is not
installed,
<a class="link" href="server-system-variables.html#sysvar_dragnet.log_error_filter_rules">
<code class="literal">
dragnet.log_error_filter_rules
</code>
</a>
is unavailable. If
<code class="literal">
log_filter_dragnet
</code>
is
installed but not enabled, changes to
<a class="link" href="server-system-variables.html#sysvar_dragnet.log_error_filter_rules">
<code class="literal">
dragnet.log_error_filter_rules
</code>
</a>
have no effect.
</p>
<p>
The effect of the default value is similar to the filtering
performed by the
<code class="literal">
log_sink_internal
</code>
filter
with a setting of
<a class="link" href="server-system-variables.html#sysvar_log_error_verbosity">
<code class="literal">
log_error_verbosity=2
</code>
</a>
.
</p>
<p>
<a class="link" href="server-status-variables.html#statvar_dragnet.Status">
<code class="literal">
dragnet.Status
</code>
</a>
status
variable can be consulted to determine the result of the most
recent assignment to
<a class="link" href="server-system-variables.html#sysvar_dragnet.log_error_filter_rules">
<code class="literal">
dragnet.log_error_filter_rules
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_enterprise_encryption.maximum_rsa_key_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_enterprise_encryption.maximum_rsa_key_size">
<code class="literal">
enterprise_encryption.maximum_rsa_key_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045276142416">
</a>
<a class="indexterm" name="idm46045276141296">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for enterprise_encryption.maximum_rsa_key_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--enterprise-encryption.maximum-rsa-key-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_enterprise_encryption.maximum_rsa_key_size">
enterprise_encryption.maximum_rsa_key_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
4096
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
2048
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
16384
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable limits the maximum size of RSA keys generated by
MySQL Enterprise Encryption. The variable is available only if
the MySQL Enterprise Encryption component
<code class="literal">
component_enterprise_encryption
</code>
is
installed.
</p>
<p>
The lowest setting is 2048 bits, which is the minimum RSA key
length that is acceptable by current best practice. The
default setting is 4096 bits. The highest setting is 16384
bits. Generating longer keys can consume significant CPU
resources, so you can use this setting to limit keys to a
length that provides adequate security for your requirements
while balancing this with resource usage. See
<a class="xref" href="enterprise-encryption-configuring.html" title="8.6.2 Configuring MySQL Enterprise Encryption">
Section 8.6.2, “Configuring MySQL Enterprise Encryption”
</a>
for more
information.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_enterprise_encryption.rsa_support_legacy_padding">
</a>
<a class="link" href="server-system-variables.html#sysvar_enterprise_encryption.rsa_support_legacy_padding">
<code class="literal">
enterprise_encryption.rsa_support_legacy_padding
</code>
</a>
</p>
<a class="indexterm" name="idm46045276108880">
</a>
<a class="indexterm" name="idm46045276107760">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for enterprise_encryption.rsa_support_legacy_padding">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--enterprise-encryption.rsa_support_legacy_padding[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_enterprise_encryption.rsa_support_legacy_padding">
enterprise_encryption.rsa_support_legacy_padding
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls whether encrypted data and signatures
that MySQL Enterprise Encryption produced using the old
<code class="literal">
openssl_udf
</code>
shared library functions can be
decrypted or verified by the MySQL Enterprise Encryption
component
(
<code class="literal">
component_enterprise_encryption
</code>
). The
variable is available only if the MySQL Enterprise Encryption
component is installed.
</p>
<p>
For the component functions to support decryption and
verification for content produced by the old
<code class="literal">
openssl_udf
</code>
shared library functions, you
must set the system variable padding to
<code class="literal">
ON
</code>
.
When
<code class="literal">
ON
</code>
is set, if the component functions
cannot decrypt or verify content when assuming it has the
RSAES-OAEP or RSASSA-PSS scheme (as used by the component),
they make another attempt assuming it has the RSAES-PKCS1-v1_5
or RSASSA-PKCS1-v1_5 scheme (as used by the
<code class="literal">
openssl_udf
</code>
shared library functions). When
<code class="literal">
OFF
</code>
is set, if the component functions
cannot decrypt or verify content using their normal schemes,
they return null output. See
<a class="xref" href="enterprise-encryption-configuring.html" title="8.6.2 Configuring MySQL Enterprise Encryption">
Section 8.6.2, “Configuring MySQL Enterprise Encryption”
</a>
for more
information.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_end_markers_in_json">
</a>
<a class="link" href="server-system-variables.html#sysvar_end_markers_in_json">
<code class="literal">
end_markers_in_json
</code>
</a>
</p>
<a class="indexterm" name="idm46045276076000">
</a>
<a class="indexterm" name="idm46045276074960">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for end_markers_in_json">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--end-markers-in-json[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_end_markers_in_json">
end_markers_in_json
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether optimizer JSON output should add end markers. See
<a class="ulink" href="/doc/internals/en/end-markers-in-json-system-variable.html" target="_top">
MySQL
Internals: The end_markers_in_json System Variable
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_eq_range_index_dive_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_eq_range_index_dive_limit">
<code class="literal">
eq_range_index_dive_limit
</code>
</a>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for eq_range_index_dive_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--eq-range-index-dive-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_eq_range_index_dive_limit">
eq_range_index_dive_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
200
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable indicates the number of equality ranges in an
equality comparison condition when the optimizer should switch
from using index dives to index statistics in estimating the
number of qualifying rows. It applies to evaluation of
expressions that have either of these equivalent forms, where
the optimizer uses a nonunique index to look up
<em class="replaceable">
<code>
col_name
</code>
</em>
values:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa36824180"><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"><em class="replaceable">col_name</em> <span class="token keyword">IN</span><span class="token punctuation">(</span><em class="replaceable">val1</em><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> <em class="replaceable">valN</em><span class="token punctuation">)</span>
<em class="replaceable">col_name</em> <span class="token operator">=</span> <em class="replaceable">val1</em> <span class="token operator">OR</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token operator">OR</span> <em class="replaceable">col_name</em> <span class="token operator">=</span> <em class="replaceable">valN</em></code></pre>
</div>
<p>
In both cases, the expression contains
<em class="replaceable">
<code>
N
</code>
</em>
equality ranges. The optimizer
can make row estimates using index dives or index statistics.
If
<a class="link" href="server-system-variables.html#sysvar_eq_range_index_dive_limit">
<code class="literal">
eq_range_index_dive_limit
</code>
</a>
is greater than 0, the optimizer uses existing index
statistics instead of index dives if there are
<a class="link" href="server-system-variables.html#sysvar_eq_range_index_dive_limit">
<code class="literal">
eq_range_index_dive_limit
</code>
</a>
or
more equality ranges. Thus, to permit use of index dives for
up to
<em class="replaceable">
<code>
N
</code>
</em>
equality ranges, set
<a class="link" href="server-system-variables.html#sysvar_eq_range_index_dive_limit">
<code class="literal">
eq_range_index_dive_limit
</code>
</a>
to
<em class="replaceable">
<code>
N
</code>
</em>
+ 1. To disable use of index
statistics and always use index dives regardless of
<em class="replaceable">
<code>
N
</code>
</em>
, set
<a class="link" href="server-system-variables.html#sysvar_eq_range_index_dive_limit">
<code class="literal">
eq_range_index_dive_limit
</code>
</a>
to
0.
</p>
<p>
For more information, see
<a class="xref" href="range-optimization.html#equality-range-optimization" title="Equality Range Optimization of Many-Valued Comparisons">
Equality Range Optimization of Many-Valued Comparisons
</a>
.
</p>
<p>
To update table index statistics for best estimates, use
<a class="link" href="analyze-table.html" title="15.7.3.1 ANALYZE TABLE Statement">
<code class="literal">
ANALYZE TABLE
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_error_count">
</a>
<a class="link" href="server-system-variables.html#sysvar_error_count">
<code class="literal">
error_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045276006368">
</a>
<a class="indexterm" name="idm46045276005280">
</a>
<p>
The number of errors that resulted from the last statement
that generated messages. This variable is read only. See
<a class="xref" href="show-errors.html" title="15.7.7.18 SHOW ERRORS Statement">
Section 15.7.7.18, “SHOW ERRORS Statement”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_event_scheduler">
</a>
<a class="link" href="server-system-variables.html#sysvar_event_scheduler">
<code class="literal">
event_scheduler
</code>
</a>
</p>
<a class="indexterm" name="idm46045276000064">
</a>
<a class="indexterm" name="idm46045275998976">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for event_scheduler">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--event-scheduler[=value]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_event_scheduler">
event_scheduler
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
ON
</code>
</p>
<p class="valid-value">
<code class="literal">
OFF
</code>
</p>
<p class="valid-value">
<code class="literal">
DISABLED
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable enables or disables, and starts or stops, the
Event Scheduler. The possible status values are
<code class="literal">
ON
</code>
,
<code class="literal">
OFF
</code>
, and
<code class="literal">
DISABLED
</code>
. Turning the Event Scheduler
<code class="literal">
OFF
</code>
is not the same as disabling the Event
Scheduler, which requires setting the status to
<code class="literal">
DISABLED
</code>
. This variable and its effects on
the Event Scheduler's operation are discussed in greater
detail in
<a class="xref" href="events-configuration.html" title="27.4.2 Event Scheduler Configuration">
Section 27.4.2, “Event Scheduler Configuration”
</a>
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_explain_format">
</a>
<a class="link" href="server-system-variables.html#sysvar_explain_format">
<code class="literal">
explain_format
</code>
</a>
</p>
<a class="indexterm" name="idm46045275965328">
</a>
<a class="indexterm" name="idm46045275964240">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for explain_format">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--explain-format=format
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_explain_format">
explain_format
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
TRADITIONAL
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
TRADITIONAL (DEFAULT)
</code>
</p>
<p class="valid-value">
<code class="literal">
JSON
</code>
</p>
<p class="valid-value">
<code class="literal">
TREE
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable determines the default output format used by
<a class="link" href="explain.html#explain-execution-plan" title="Obtaining Execution Plan Information">
<code class="literal">
EXPLAIN
</code>
</a>
in the absence of a
<code class="literal">
FORMAT
</code>
option when
displaying a query execution plan. Possible values and their
effects are listed here:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
TRADITIONAL
</code>
: Use MySQL's
traditional table-based output, as if
<code class="literal">
FORMAT=TRADITIONAL
</code>
had been specified
as part of the
<code class="literal">
EXPLAIN
</code>
statement. This
is the variable's default value.
<code class="literal">
DEFAULT
</code>
is also supported as a synonym
for
<code class="literal">
TRADITIONAL
</code>
, and has exactly the
same effect.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
<code class="literal">
DEFAULT
</code>
cannot be used as part of an
<code class="literal">
EXPLAIN
</code>
statement's
<code class="literal">
FORMAT
</code>
option.
</p>
</div>
</li>
<li class="listitem">
<p>
<code class="literal">
JSON
</code>
: Use the JSON output format, as if
<code class="literal">
FORMAT=JSON
</code>
had been specified.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TREE
</code>
: Use the tree-based output format,
as if
<code class="literal">
FORMAT=TREE
</code>
had been specified.
</p>
</li>
</ul>
</div>
<p>
The setting for this variable also affects
<code class="literal">
EXPLAIN
ANALYZE
</code>
. For this purpose,
<code class="literal">
DEFAULT
</code>
and
<code class="literal">
TRADITIONAL
</code>
are interpeted as
<code class="literal">
TREE
</code>
. If the value of
<code class="literal">
explain_format
</code>
is
<code class="literal">
JSON
</code>
and an
<code class="literal">
EXPLAIN ANALYZE
</code>
statement having no
<code class="literal">
FORMAT
</code>
option is issued, the statement
raises an error
(
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_not_supported_yet" target="_top">
<code class="literal">
ER_NOT_SUPPORTED_YET
</code>
</a>
).
</p>
<p>
Using a format specifier with
<code class="literal">
EXPLAIN
</code>
or
<code class="literal">
EXPLAIN ANALYZE
</code>
overrides any setting for
<code class="literal">
explain_format
</code>
.
</p>
<p>
The
<code class="literal">
explain_format
</code>
system variable has no
effect on
<code class="literal">
EXPLAIN
</code>
output when this
statement is used to display information about table columns.
</p>
<p>
Setting the session value of
<code class="literal">
explain_format
</code>
requires no special privileges; setting it on the global level
requires
<a class="link" href="privileges-provided.html#priv_system-variables-admin">
<code class="literal">
SYSTEM_VARIABLES_ADMIN
</code>
</a>
(or the deprecated
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege). 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>
For more information and examples, see
<a class="xref" href="explain.html#explain-execution-plan" title="Obtaining Execution Plan Information">
Obtaining Execution Plan Information
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_explain_json_format_version">
</a>
<a class="link" href="server-system-variables.html#sysvar_explain_json_format_version">
<code class="literal">
explain_json_format_version
</code>
</a>
</p>
<a class="indexterm" name="idm46045275902576">
</a>
<a class="indexterm" name="idm46045275901472">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for explain_json_format_version">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--explain-json-format-version=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_explain_json_format_version">
explain_json_format_version
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Determines the version of the JSON output format used by
<code class="literal">
EXPLAIN FORMAT=JSON
</code>
statements. Setting
this variable to
<code class="literal">
1
</code>
causes the server to use
Version 1, which is the linear format used for output from
such statements in older versions of MySQL; this is the
default in MySQL 8.4. Setting
<code class="literal">
explain_json_format_version
</code>
to
<code class="literal">
2
</code>
causes the Version 2 format to be used;
this JSON output format is based on access paths, and is
intended to provide better compatibility with future versions
of the MySQL Optimizer.
</p>
<p>
For an example of use, see
<a class="xref" href="explain.html#explain-execution-plan" title="Obtaining Execution Plan Information">
Obtaining Execution Plan Information
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_explicit_defaults_for_timestamp">
</a>
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
</p>
<a class="indexterm" name="idm46045275867680">
</a>
<a class="indexterm" name="idm46045275866576">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for explicit_defaults_for_timestamp">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--explicit-defaults-for-timestamp[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
explicit_defaults_for_timestamp
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This system variable determines whether the server enables
certain nonstandard behaviors for default values and
<code class="literal">
NULL
</code>
-value handling in
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
columns. By default,
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
is enabled, which disables the nonstandard behaviors.
Disabling
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
results in a warning.
</p>
<p>
If
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
is disabled, the server enables the nonstandard behaviors and
handles
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
columns as
follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
columns not
explicitly declared with the
<code class="literal">
NULL
</code>
attribute are automatically declared with the
<code class="literal">
NOT
NULL
</code>
attribute. Assigning such a column a value
of
<code class="literal">
NULL
</code>
is permitted and sets the
column to the current timestamp.
<span class="emphasis">
<em>
Exception
</em>
</span>
: Attempting to insert
<code class="literal">
NULL
</code>
into a generated column declared
as
<code class="literal">
TIMESTAMP NOT NULL
</code>
is rejected with
an error.
</p>
</li>
<li class="listitem">
<p>
The first
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
column
in a table, if not explicitly declared with the
<code class="literal">
NULL
</code>
attribute or an explicit
<code class="literal">
DEFAULT
</code>
or
<code class="literal">
ON UPDATE
</code>
attribute, is automatically declared with the
<code class="literal">
DEFAULT CURRENT_TIMESTAMP
</code>
and
<code class="literal">
ON UPDATE CURRENT_TIMESTAMP
</code>
attributes.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
columns following
the first one, if not explicitly declared with the
<code class="literal">
NULL
</code>
attribute or an explicit
<code class="literal">
DEFAULT
</code>
attribute, are automatically
declared as
<code class="literal">
DEFAULT '0000-00-00
00:00:00'
</code>
(the
<span class="quote">
“
<span class="quote">
zero
</span>
”
</span>
timestamp).
For inserted rows that specify no explicit value for such
a column, the column is assigned
<code class="literal">
'0000-00-00
00:00:00'
</code>
and no warning occurs.
</p>
<p>
Depending on whether strict SQL mode or the
<a class="link" href="sql-mode.html#sqlmode_no_zero_date">
<code class="literal">
NO_ZERO_DATE
</code>
</a>
SQL mode is
enabled, a default value of
<code class="literal">
'0000-00-00
00:00:00'
</code>
may be invalid. Be aware that the
<a class="link" href="sql-mode.html#sqlmode_traditional">
<code class="literal">
TRADITIONAL
</code>
</a>
SQL mode
includes strict mode and
<a class="link" href="sql-mode.html#sqlmode_no_zero_date">
<code class="literal">
NO_ZERO_DATE
</code>
</a>
. See
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
.
</p>
</li>
</ul>
</div>
<p>
The nonstandard behaviors just described are deprecated;
expect them to be removed in a future MySQL release.
</p>
<p>
If
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
is enabled, the server disables the nonstandard behaviors and
handles
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
columns as
follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
It is not possible to assign a
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
column a value of
<code class="literal">
NULL
</code>
to set it to the current
timestamp. To assign the current timestamp, set the column
to
<a class="link" href="date-and-time-functions.html#function_current-timestamp">
<code class="literal">
CURRENT_TIMESTAMP
</code>
</a>
or a
synonym such as
<a class="link" href="date-and-time-functions.html#function_now">
<code class="literal">
NOW()
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
columns not
explicitly declared with the
<code class="literal">
NOT NULL
</code>
attribute are automatically declared with the
<code class="literal">
NULL
</code>
attribute and permit
<code class="literal">
NULL
</code>
values. Assigning such a column a
value of
<code class="literal">
NULL
</code>
sets it to
<code class="literal">
NULL
</code>
, not the current timestamp.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
columns declared
with the
<code class="literal">
NOT NULL
</code>
attribute do not
permit
<code class="literal">
NULL
</code>
values. For inserts that
specify
<code class="literal">
NULL
</code>
for such a column, the
result is either an error for a single-row insert if
strict SQL mode is enabled, or
<code class="literal">
'0000-00-00
00:00:00'
</code>
is inserted for multiple-row inserts
with strict SQL mode disabled. In no case does assigning
the column a value of
<code class="literal">
NULL
</code>
set it to
the current timestamp.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
columns
explicitly declared with the
<code class="literal">
NOT NULL
</code>
attribute and without an explicit
<code class="literal">
DEFAULT
</code>
attribute are treated as having
no default value. For inserted rows that specify no
explicit value for such a column, the result depends on
the SQL mode. If strict SQL mode is enabled, an error
occurs. If strict SQL mode is not enabled, the column is
declared with the implicit default of
<code class="literal">
'0000-00-00
00:00:00'
</code>
and a warning occurs. This is similar
to how MySQL treats other temporal types such as
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATETIME
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
No
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
column is
automatically declared with the
<code class="literal">
DEFAULT
CURRENT_TIMESTAMP
</code>
or
<code class="literal">
ON UPDATE
CURRENT_TIMESTAMP
</code>
attributes. Those attributes
must be explicitly specified.
</p>
</li>
<li class="listitem">
<p>
The first
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
column
in a table is not handled differently from
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
columns following
the first one.
</p>
</li>
</ul>
</div>
<p>
If
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
is disabled at server startup, this warning appears in the
error log:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-simple"><div class="docs-select-all right" id="sa91915399"><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-simple"><span class="token punctuation">[</span>Warning<span class="token punctuation">]</span> TIMESTAMP with implicit DEFAULT value is deprecated<span class="token punctuation">.</span>
Please use <span class="token operator">--</span>explicit_defaults_for_timestamp server option <span class="token punctuation">(</span>see
documentation for more details<span class="token punctuation">)</span><span class="token punctuation">.</span></code></pre>
</div>
<p>
As indicated by the warning, to disable the deprecated
nonstandard behaviors, enable the
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
system variable at server startup.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
is itself deprecated because its only purpose is to permit
control over deprecated
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
behaviors that are
to be removed in a future MySQL release. When removal of
those behaviors occurs, expect
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
to be removed as well.
</p>
</div>
<p>
For additional information, see
<a class="xref" href="timestamp-initialization.html" title="13.2.5 Automatic Initialization and Updating for TIMESTAMP and DATETIME">
Section 13.2.5, “Automatic Initialization and Updating for TIMESTAMP and DATETIME”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_external_user">
</a>
<a class="link" href="server-system-variables.html#sysvar_external_user">
<code class="literal">
external_user
</code>
</a>
</p>
<a class="indexterm" name="idm46045275762800">
</a>
<a class="indexterm" name="idm46045275761712">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for external_user">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_external_user">
external_user
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
The external user name used during the authentication process,
as set by the plugin used to authenticate the client. With
native (built-in) MySQL authentication, or if the plugin does
not set the value, this variable is
<code class="literal">
NULL
</code>
.
See
<a class="xref" href="proxy-users.html" title="8.2.19 Proxy Users">
Section 8.2.19, “Proxy Users”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_flush">
</a>
<a class="link" href="server-system-variables.html#sysvar_flush">
<code class="literal">
flush
</code>
</a>
</p>
<a class="indexterm" name="idm46045275740544">
</a>
<a class="indexterm" name="idm46045275739472">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for flush">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--flush[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_flush">
flush
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If
<code class="literal">
ON
</code>
, the server flushes (synchronizes)
all changes to disk after each SQL statement. Normally, MySQL
does a write of all changes to disk only after each SQL
statement and lets the operating system handle the
synchronizing to disk. See
<a class="xref" href="crashing.html" title="B.3.3.3 What to Do If MySQL Keeps Crashing">
Section B.3.3.3, “What to Do If MySQL Keeps Crashing”
</a>
. This
variable is set to
<code class="literal">
ON
</code>
if you start
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
with the
<a class="link" href="server-options.html#option_mysqld_flush">
<code class="option">
--flush
</code>
</a>
option.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
If
<a class="link" href="server-system-variables.html#sysvar_flush">
<code class="literal">
flush
</code>
</a>
is enabled, the
value of
<a class="link" href="server-system-variables.html#sysvar_flush_time">
<code class="literal">
flush_time
</code>
</a>
does
not matter and changes to
<a class="link" href="server-system-variables.html#sysvar_flush_time">
<code class="literal">
flush_time
</code>
</a>
have no effect
on flush behavior.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_flush_time">
</a>
<a class="link" href="server-system-variables.html#sysvar_flush_time">
<code class="literal">
flush_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045275706016">
</a>
<a class="indexterm" name="idm46045275704928">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for flush_time">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--flush-time=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_flush_time">
flush_time
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
If this is set to a nonzero value, all tables are closed every
<a class="link" href="server-system-variables.html#sysvar_flush_time">
<code class="literal">
flush_time
</code>
</a>
seconds to free up
resources and synchronize unflushed data to disk. This option
is best used only on systems with minimal resources.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
If
<a class="link" href="server-system-variables.html#sysvar_flush">
<code class="literal">
flush
</code>
</a>
is enabled, the
value of
<a class="link" href="server-system-variables.html#sysvar_flush_time">
<code class="literal">
flush_time
</code>
</a>
does
not matter and changes to
<a class="link" href="server-system-variables.html#sysvar_flush_time">
<code class="literal">
flush_time
</code>
</a>
have no effect
on flush behavior.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_foreign_key_checks">
</a>
<a class="link" href="server-system-variables.html#sysvar_foreign_key_checks">
<code class="literal">
foreign_key_checks
</code>
</a>
</p>
<a class="indexterm" name="idm46045275667520">
</a>
<a class="indexterm" name="idm46045275666480">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for foreign_key_checks">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_foreign_key_checks">
foreign_key_checks
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If set to 1 (the default), foreign key constraints are
checked. If set to 0, foreign key constraints are ignored,
with a couple of exceptions. When re-creating a table that was
dropped, an error is returned if the table definition does not
conform to the foreign key constraints referencing the table.
Likewise, an
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
operation returns an error if a foreign key definition is
incorrectly formed. For more information, see
<a class="xref" href="create-table-foreign-keys.html" title="15.1.20.5 FOREIGN KEY Constraints">
Section 15.1.20.5, “FOREIGN KEY Constraints”
</a>
.
</p>
<p>
Setting this variable has the same effect on
<a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
<code class="literal">
NDB
</code>
</a>
tables as it does for
<code class="literal">
InnoDB
</code>
tables. Typically you leave this
setting enabled during normal operation, to enforce
<a class="link" href="glossary.html#glos_referential_integrity" title="referential integrity">
referential
integrity
</a>
. Disabling foreign key checking can be useful
for reloading
<code class="literal">
InnoDB
</code>
tables in an order
different from that required by their parent/child
relationships. See
<a class="xref" href="create-table-foreign-keys.html" title="15.1.20.5 FOREIGN KEY Constraints">
Section 15.1.20.5, “FOREIGN KEY Constraints”
</a>
.
</p>
<p>
Setting
<code class="literal">
foreign_key_checks
</code>
to 0 also
affects data definition statements:
<a class="link" href="drop-database.html" title="15.1.24 DROP DATABASE Statement">
<code class="literal">
DROP
SCHEMA
</code>
</a>
drops a schema even if it contains tables
that have foreign keys that are referred to by tables outside
the schema, and
<a class="link" href="drop-table.html" title="15.1.32 DROP TABLE Statement">
<code class="literal">
DROP TABLE
</code>
</a>
drops tables that have foreign keys that are referred to by
other tables.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Setting
<code class="literal">
foreign_key_checks
</code>
to 1 does not
trigger a scan of the existing table data. Therefore, rows
added to the table while
<a class="link" href="server-system-variables.html#sysvar_foreign_key_checks">
<code class="literal">
foreign_key_checks = 0
</code>
</a>
are
not verified for consistency.
</p>
<p>
Dropping an index required by a foreign key constraint is
not permitted, even with
<a class="link" href="server-system-variables.html#sysvar_foreign_key_checks">
<code class="literal">
foreign_key_checks=0
</code>
</a>
. The
foreign key constraint must be removed before dropping the
index.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_ft_boolean_syntax">
</a>
<a class="link" href="server-system-variables.html#sysvar_ft_boolean_syntax">
<code class="literal">
ft_boolean_syntax
</code>
</a>
</p>
<a class="indexterm" name="idm46045275628272">
</a>
<a class="indexterm" name="idm46045275627232">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ft_boolean_syntax">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ft-boolean-syntax=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ft_boolean_syntax">
ft_boolean_syntax
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
+ -><()~*:""&|
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The list of operators supported by boolean full-text searches
performed using
<code class="literal">
IN BOOLEAN MODE
</code>
. See
<a class="xref" href="fulltext-boolean.html" title="14.9.2 Boolean Full-Text Searches">
Section 14.9.2, “Boolean Full-Text Searches”
</a>
.
</p>
<p>
The default variable value is
<code class="literal">
'+ -><()~*:""&|'
</code>
. The rules
for changing the value are as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
Operator function is determined by position within the
string.
</p>
</li>
<li class="listitem">
<p>
The replacement value must be 14 characters.
</p>
</li>
<li class="listitem">
<p>
Each character must be an ASCII nonalphanumeric character.
</p>
</li>
<li class="listitem">
<p>
Either the first or second character must be a space.
</p>
</li>
<li class="listitem">
<p>
No duplicates are permitted except the phrase quoting
operators in positions 11 and 12. These two characters are
not required to be the same, but they are the only two
that may be.
</p>
</li>
<li class="listitem">
<p>
Positions 10, 13, and 14 (which by default are set to
<code class="literal">
:
</code>
,
<code class="literal">
&
</code>
, and
<code class="literal">
|
</code>
) are reserved for future extensions.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_ft_max_word_len">
</a>
<a class="link" href="server-system-variables.html#sysvar_ft_max_word_len">
<code class="literal">
ft_max_word_len
</code>
</a>
</p>
<a class="indexterm" name="idm46045275591984">
</a>
<a class="indexterm" name="idm46045275590896">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ft_max_word_len">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ft-max-word-len=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ft_max_word_len">
ft_max_word_len
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
84
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
10
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
84
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum length of the word to be included in a
<code class="literal">
MyISAM
</code>
<code class="literal">
FULLTEXT
</code>
index.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
<code class="literal">
FULLTEXT
</code>
indexes on
<code class="literal">
MyISAM
</code>
tables must be rebuilt after
changing this variable. Use
<code class="literal">
REPAIR TABLE
<em class="replaceable">
<code>
tbl_name
</code>
</em>
QUICK
</code>
.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_ft_min_word_len">
</a>
<a class="link" href="server-system-variables.html#sysvar_ft_min_word_len">
<code class="literal">
ft_min_word_len
</code>
</a>
</p>
<a class="indexterm" name="idm46045275556752">
</a>
<a class="indexterm" name="idm46045275555664">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ft_min_word_len">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ft-min-word-len=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ft_min_word_len">
ft_min_word_len
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
4
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
82
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The minimum length of the word to be included in a
<code class="literal">
MyISAM
</code>
<code class="literal">
FULLTEXT
</code>
index.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
<code class="literal">
FULLTEXT
</code>
indexes on
<code class="literal">
MyISAM
</code>
tables must be rebuilt after
changing this variable. Use
<code class="literal">
REPAIR TABLE
<em class="replaceable">
<code>
tbl_name
</code>
</em>
QUICK
</code>
.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_ft_query_expansion_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_ft_query_expansion_limit">
<code class="literal">
ft_query_expansion_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045275521440">
</a>
<a class="indexterm" name="idm46045275520336">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ft_query_expansion_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ft-query-expansion-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ft_query_expansion_limit">
ft_query_expansion_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
20
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
1000
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of top matches to use for full-text searches
performed using
<code class="literal">
WITH QUERY EXPANSION
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ft_stopword_file">
</a>
<a class="link" href="server-system-variables.html#sysvar_ft_stopword_file">
<code class="literal">
ft_stopword_file
</code>
</a>
</p>
<a class="indexterm" name="idm46045275490192">
</a>
<a class="indexterm" name="idm46045275489104">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ft_stopword_file">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ft-stopword-file=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ft_stopword_file">
ft_stopword_file
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
</tbody>
</table>
</div>
<p>
The file from which to read the list of stopwords for
full-text searches on
<code class="literal">
MyISAM
</code>
tables. The
server looks for the file in the data directory unless an
absolute path name is given to specify a different directory.
All the words from the file are used; comments are
<span class="emphasis">
<em>
not
</em>
</span>
honored. By default, a built-in list
of stopwords is used (as defined in the
<code class="filename">
storage/myisam/ft_static.c
</code>
file). Setting
this variable to the empty string (
<code class="literal">
''
</code>
)
disables stopword filtering. See also
<a class="xref" href="fulltext-stopwords.html" title="14.9.4 Full-Text Stopwords">
Section 14.9.4, “Full-Text Stopwords”
</a>
.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
<code class="literal">
FULLTEXT
</code>
indexes on
<code class="literal">
MyISAM
</code>
tables must be rebuilt after
changing this variable or the contents of the stopword file.
Use
<code class="literal">
REPAIR TABLE
<em class="replaceable">
<code>
tbl_name
</code>
</em>
QUICK
</code>
.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_general_log">
</a>
<a class="link" href="server-system-variables.html#sysvar_general_log">
<code class="literal">
general_log
</code>
</a>
</p>
<a class="indexterm" name="idm46045275459792">
</a>
<a class="indexterm" name="idm46045275458704">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for general_log">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--general-log[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_general_log">
general_log
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether the general query log is enabled. The value can be 0
(or
<code class="literal">
OFF
</code>
) to disable the log or 1 (or
<code class="literal">
ON
</code>
) to enable the log. The destination for
log output is controlled by the
<a class="link" href="server-system-variables.html#sysvar_log_output">
<code class="literal">
log_output
</code>
</a>
system variable;
if that value is
<code class="literal">
NONE
</code>
, no log entries are
written even if the log is enabled.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_general_log_file">
</a>
<a class="link" href="server-system-variables.html#sysvar_general_log_file">
<code class="literal">
general_log_file
</code>
</a>
</p>
<a class="indexterm" name="idm46045275430688">
</a>
<a class="indexterm" name="idm46045275429600">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for general_log_file">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--general-log-file=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_general_log_file">
general_log_file
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
host_name.log
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The name of the general query log file. The default value is
<code class="filename">
<em class="replaceable">
<code>
host_name
</code>
</em>
.log
</code>
,
but the initial value can be changed with the
<a class="link" href="server-system-variables.html#sysvar_general_log_file">
<code class="option">
--general_log_file
</code>
</a>
option.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_generated_random_password_length">
</a>
<a class="link" href="server-system-variables.html#sysvar_generated_random_password_length">
<code class="literal">
generated_random_password_length
</code>
</a>
</p>
<a class="indexterm" name="idm46045275403056">
</a>
<a class="indexterm" name="idm46045275401952">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for generated_random_password_length">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--generated-random-password-length=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_generated_random_password_length">
generated_random_password_length
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
20
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
5
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
255
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum number of characters permitted in random passwords
generated for
<a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
<code class="literal">
CREATE USER
</code>
</a>
,
<a class="link" href="alter-user.html" title="15.7.1.1 ALTER USER Statement">
<code class="literal">
ALTER USER
</code>
</a>
, and
<a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement">
<code class="literal">
SET PASSWORD
</code>
</a>
statements. For
more information, see
<a class="xref" href="password-management.html#random-password-generation" title="Random Password Generation">
Random Password Generation
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_global_connection_memory_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_global_connection_memory_limit">
<code class="literal">
global_connection_memory_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045275367744">
</a>
<a class="indexterm" name="idm46045275366640">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for global_connection_memory_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--global-connection-memory-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_global_connection_memory_limit">
global_connection_memory_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
16777216
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
Set the total amount of memory that can be used by all user
connections; that is,
<a class="link" href="server-status-variables.html#statvar_Global_connection_memory">
<code class="literal">
Global_connection_memory
</code>
</a>
should not exceed this amount. Any time that it does, all
queries (including any currently running) from regular users
are rejected with
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_global_conn_limit" target="_top">
<code class="literal">
ER_GLOBAL_CONN_LIMIT
</code>
</a>
.
</p>
<p>
Memory used by the system users such as the MySQL root user is
included in this total, but is not counted towards the
disconnection limit; such users are never disconnected due to
memory usage.
</p>
<p>
Memory used by the
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
buffer
pool is excluded from the total.
</p>
<p>
You must have the
<a class="link" href="privileges-provided.html#priv_system-variables-admin">
<code class="literal">
SYSTEM_VARIABLES_ADMIN
</code>
</a>
or
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege to set this
variable.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_global_connection_memory_tracking">
</a>
<a class="link" href="server-system-variables.html#sysvar_global_connection_memory_tracking">
<code class="literal">
global_connection_memory_tracking
</code>
</a>
</p>
<a class="indexterm" name="idm46045275326976">
</a>
<a class="indexterm" name="idm46045275325936">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for global_connection_memory_tracking">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--global-connection-memory-tracking={TRUE|FALSE}
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_global_connection_memory_tracking">
global_connection_memory_tracking
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
FALSE
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Determines whether the server calculates
<a class="link" href="server-status-variables.html#statvar_Global_connection_memory">
<code class="literal">
Global_connection_memory
</code>
</a>
.
This variable must be enabled explicitly; otherwise, the
memory calculation is not performed, and
<code class="literal">
Global_connection_memory
</code>
is not set.
</p>
<p>
You must have the
<a class="link" href="privileges-provided.html#priv_system-variables-admin">
<code class="literal">
SYSTEM_VARIABLES_ADMIN
</code>
</a>
or
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege to set this
variable.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_group_concat_max_len">
</a>
<a class="link" href="server-system-variables.html#sysvar_group_concat_max_len">
<code class="literal">
group_concat_max_len
</code>
</a>
</p>
<a class="indexterm" name="idm46045275296176">
</a>
<a class="indexterm" name="idm46045275295136">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for group_concat_max_len">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--group-concat-max-len=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_group_concat_max_len">
group_concat_max_len
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
4
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum permitted result length in bytes for the
<a class="link" href="aggregate-functions.html#function_group-concat">
<code class="literal">
GROUP_CONCAT()
</code>
</a>
function. The
default is 1024.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_have_compress">
</a>
<a class="link" href="server-system-variables.html#sysvar_have_compress">
<code class="literal">
have_compress
</code>
</a>
</p>
<a class="indexterm" name="idm46045275261984">
</a>
<a class="indexterm" name="idm46045275260896">
</a>
<p>
<code class="literal">
YES
</code>
if the
<code class="literal">
zlib
</code>
compression library is available to the server,
<code class="literal">
NO
</code>
if not. If not, the
<a class="link" href="encryption-functions.html#function_compress">
<code class="literal">
COMPRESS()
</code>
</a>
and
<a class="link" href="encryption-functions.html#function_uncompress">
<code class="literal">
UNCOMPRESS()
</code>
</a>
functions cannot
be used.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_have_dynamic_loading">
</a>
<a class="link" href="server-system-variables.html#sysvar_have_dynamic_loading">
<code class="literal">
have_dynamic_loading
</code>
</a>
</p>
<a class="indexterm" name="idm46045275251872">
</a>
<a class="indexterm" name="idm46045275250832">
</a>
<p>
<code class="literal">
YES
</code>
if
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
supports
dynamic loading of plugins,
<code class="literal">
NO
</code>
if not. If
the value is
<code class="literal">
NO
</code>
, you cannot use options
such as
<a class="link" href="server-options.html#option_mysqld_plugin-load">
<code class="option">
--plugin-load
</code>
</a>
to load
plugins at server startup, or the
<a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
<code class="literal">
INSTALL
PLUGIN
</code>
</a>
statement to load plugins at runtime.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_have_geometry">
</a>
<a class="link" href="server-system-variables.html#sysvar_have_geometry">
<code class="literal">
have_geometry
</code>
</a>
</p>
<a class="indexterm" name="idm46045275240880">
</a>
<a class="indexterm" name="idm46045275239792">
</a>
<p>
<code class="literal">
YES
</code>
if the server supports spatial data
types,
<code class="literal">
NO
</code>
if not.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_have_profiling">
</a>
<a class="link" href="server-system-variables.html#sysvar_have_profiling">
<code class="literal">
have_profiling
</code>
</a>
</p>
<a class="indexterm" name="idm46045275234112">
</a>
<a class="indexterm" name="idm46045275233024">
</a>
<p>
<code class="literal">
YES
</code>
if statement profiling capability is
present,
<code class="literal">
NO
</code>
if not. If present, the
<code class="literal">
profiling
</code>
system variable controls whether
this capability is enabled or disabled. See
<a class="xref" href="show-profiles.html" title="15.7.7.33 SHOW PROFILES Statement">
Section 15.7.7.33, “SHOW PROFILES Statement”
</a>
.
</p>
<p>
This variable is deprecated; you should expect it to be
removed in a future MySQL release.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_have_query_cache">
</a>
<a class="link" href="server-system-variables.html#sysvar_have_query_cache">
<code class="literal">
have_query_cache
</code>
</a>
</p>
<a class="indexterm" name="idm46045275225312">
</a>
<a class="indexterm" name="idm46045275224224">
</a>
<p>
<a class="link" href="server-system-variables.html#sysvar_have_query_cache">
<code class="literal">
have_query_cache
</code>
</a>
is
deprecated, always has a value of
<code class="literal">
NO
</code>
, and
you should expect it to be removed in a future MySQL release.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_have_rtree_keys">
</a>
<a class="link" href="server-system-variables.html#sysvar_have_rtree_keys">
<code class="literal">
have_rtree_keys
</code>
</a>
</p>
<a class="indexterm" name="idm46045275217936">
</a>
<a class="indexterm" name="idm46045275216848">
</a>
<p>
<code class="literal">
YES
</code>
if
<code class="literal">
RTREE
</code>
indexes are
available,
<code class="literal">
NO
</code>
if not. (These are used for
spatial indexes in
<code class="literal">
MyISAM
</code>
tables.)
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_have_statement_timeout">
</a>
<a class="link" href="server-system-variables.html#sysvar_have_statement_timeout">
<code class="literal">
have_statement_timeout
</code>
</a>
</p>
<a class="indexterm" name="idm46045275209648">
</a>
<a class="indexterm" name="idm46045275208608">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for have_statement_timeout">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_have_statement_timeout">
have_statement_timeout
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether the statement execution timeout feature is available
(see
<a class="xref" href="optimizer-hints.html#optimizer-hints-execution-time" title="Statement Execution Time Optimizer Hints">
Statement Execution Time Optimizer Hints
</a>
). The
value can be
<code class="literal">
NO
</code>
if the background thread
used by this feature could not be initialized.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_have_symlink">
</a>
<a class="link" href="server-system-variables.html#sysvar_have_symlink">
<code class="literal">
have_symlink
</code>
</a>
</p>
<a class="indexterm" name="idm46045275187360">
</a>
<a class="indexterm" name="idm46045275186272">
</a>
<p>
<code class="literal">
YES
</code>
if symbolic link support is enabled,
<code class="literal">
NO
</code>
if not. This is required on Unix for
support of the
<code class="literal">
DATA DIRECTORY
</code>
and
<code class="literal">
INDEX DIRECTORY
</code>
table options. If the
server is started with the
<a class="link" href="server-options.html#option_mysqld_symbolic-links">
<code class="option">
--skip-symbolic-links
</code>
</a>
option, the value is
<code class="literal">
DISABLED
</code>
.
</p>
<p>
This variable has no meaning on Windows.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Symbolic link support, along with the
<a class="link" href="server-options.html#option_mysqld_symbolic-links">
<code class="option">
--symbolic-links
</code>
</a>
option that
controls it, is deprecated; expect these to be removed in a
future version of MySQL. In addition, the option is disabled
by default. The related
<a class="link" href="server-system-variables.html#sysvar_have_symlink">
<code class="literal">
have_symlink
</code>
</a>
system
variable also is deprecated and you should expect it to be
removed in a future version of MySQL.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_histogram_generation_max_mem_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_histogram_generation_max_mem_size">
<code class="literal">
histogram_generation_max_mem_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045275173328">
</a>
<a class="indexterm" name="idm46045275172288">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for histogram_generation_max_mem_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--histogram-generation-max-mem-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_histogram_generation_max_mem_size">
histogram_generation_max_mem_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
20000000
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1000000
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum amount of memory available for generating
histogram statistics. See
<a class="xref" href="optimizer-statistics.html" title="10.9.6 Optimizer Statistics">
Section 10.9.6, “Optimizer Statistics”
</a>
, and
<a class="xref" href="analyze-table.html" title="15.7.3.1 ANALYZE TABLE Statement">
Section 15.7.3.1, “ANALYZE TABLE Statement”
</a>
.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_host_cache_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_host_cache_size">
<code class="literal">
host_cache_size
</code>
</a>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for host_cache_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--host-cache-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_host_cache_size">
host_cache_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
-1
</code>
(signifies autosizing; do not assign this literal value)
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
65536
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The MySQL server maintains an in-memory host cache that
contains client host name and IP address information and is
used to avoid Domain Name System (DNS) lookups; see
<a class="xref" href="host-cache.html" title="7.1.12.3 DNS Lookups and the Host Cache">
Section 7.1.12.3, “DNS Lookups and the Host Cache”
</a>
.
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_host_cache_size">
<code class="literal">
host_cache_size
</code>
</a>
variable
controls the size of the host cache, as well as the size of
the Performance Schema
<a class="link" href="performance-schema-host-cache-table.html" title="29.12.22.3 The host_cache Table">
<code class="literal">
host_cache
</code>
</a>
table that exposes the cache contents. Setting
<a class="link" href="server-system-variables.html#sysvar_host_cache_size">
<code class="literal">
host_cache_size
</code>
</a>
has these
effects:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
Setting the size to 0 disables the host cache. With the
cache disabled, the server performs a DNS lookup every
time a client connects.
</p>
</li>
<li class="listitem">
<p>
Changing the size at runtime causes an implicit host cache
flushing operation that clears the host cache, truncates
the
<a class="link" href="performance-schema-host-cache-table.html" title="29.12.22.3 The host_cache Table">
<code class="literal">
host_cache
</code>
</a>
table, and
unblocks any blocked hosts.
</p>
</li>
</ul>
</div>
<p>
The default value is autosized to 128, plus 1 for a value of
<a class="link" href="server-system-variables.html#sysvar_max_connections">
<code class="literal">
max_connections
</code>
</a>
up to 500,
plus 1 for every increment of 20 over 500 in the
<a class="link" href="server-system-variables.html#sysvar_max_connections">
<code class="literal">
max_connections
</code>
</a>
value, capped
to a limit of 2000.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_hostname">
</a>
<a class="link" href="server-system-variables.html#sysvar_hostname">
<code class="literal">
hostname
</code>
</a>
</p>
<a class="indexterm" name="idm46045275095696">
</a>
<a class="indexterm" name="idm46045275094608">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for hostname">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_hostname">
hostname
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
The server sets this variable to the server host name at
startup. The maximum length is 255 characters.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_identity">
</a>
<a class="link" href="server-system-variables.html#sysvar_identity">
<code class="literal">
identity
</code>
</a>
</p>
<a class="indexterm" name="idm46045275075040">
</a>
<a class="indexterm" name="idm46045275073952">
</a>
<p>
This variable is a synonym for the
<a class="link" href="server-system-variables.html#sysvar_last_insert_id">
<code class="literal">
last_insert_id
</code>
</a>
variable. It
exists for compatibility with other database systems. You can
read its value with
<code class="literal">
SELECT @@identity
</code>
, and
set it using
<code class="literal">
SET identity
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_init_connect">
</a>
<a class="link" href="server-system-variables.html#sysvar_init_connect">
<code class="literal">
init_connect
</code>
</a>
</p>
<a class="indexterm" name="idm46045275066880">
</a>
<a class="indexterm" name="idm46045275065792">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for init_connect">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--init-connect=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_init_connect">
init_connect
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
A string to be executed by the server for each client that
connects. The string consists of one or more SQL statements,
separated by semicolon characters.
</p>
<p>
For users that have the
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
privilege (or
the deprecated
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege), the content of
<a class="link" href="server-system-variables.html#sysvar_init_connect">
<code class="literal">
init_connect
</code>
</a>
is not executed.
This is done so that an erroneous value for
<a class="link" href="server-system-variables.html#sysvar_init_connect">
<code class="literal">
init_connect
</code>
</a>
does not prevent
all clients from connecting. For example, the value might
contain a statement that has a syntax error, thus causing
client connections to fail. Not executing
<a class="link" href="server-system-variables.html#sysvar_init_connect">
<code class="literal">
init_connect
</code>
</a>
for users that
have the
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
or
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege enables them to
open a connection and fix the
<a class="link" href="server-system-variables.html#sysvar_init_connect">
<code class="literal">
init_connect
</code>
</a>
value.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_init_connect">
<code class="literal">
init_connect
</code>
</a>
execution is
skipped for any client user with an expired password. This is
done because such a user cannot execute arbitrary statements,
and thus
<a class="link" href="server-system-variables.html#sysvar_init_connect">
<code class="literal">
init_connect
</code>
</a>
execution fails, leaving the client unable to connect.
Skipping
<a class="link" href="server-system-variables.html#sysvar_init_connect">
<code class="literal">
init_connect
</code>
</a>
execution enables the user to connect and change password.
</p>
<p>
The server discards any result sets produced by statements in
the value of
<a class="link" href="server-system-variables.html#sysvar_init_connect">
<code class="literal">
init_connect
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_information_schema_stats_expiry">
</a>
<a class="link" href="server-system-variables.html#sysvar_information_schema_stats_expiry">
<code class="literal">
information_schema_stats_expiry
</code>
</a>
</p>
<a class="indexterm" name="idm46045275026736">
</a>
<a class="indexterm" name="idm46045275025632">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for information_schema_stats_expiry">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--information-schema-stats-expiry=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_information_schema_stats_expiry">
information_schema_stats_expiry
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
86400
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
Some
<code class="literal">
INFORMATION_SCHEMA
</code>
tables contain
columns that provide table statistics:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-none"><div class="docs-select-all right" id="sa46338806"><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-none">STATISTICS.CARDINALITY
TABLES.AUTO_INCREMENT
TABLES.AVG_ROW_LENGTH
TABLES.CHECKSUM
TABLES.CHECK_TIME
TABLES.CREATE_TIME
TABLES.DATA_FREE
TABLES.DATA_LENGTH
TABLES.INDEX_LENGTH
TABLES.MAX_DATA_LENGTH
TABLES.TABLE_ROWS
TABLES.UPDATE_TIME</code></pre>
</div>
<p>
Those columns represent dynamic table metadata; that is,
information that changes as table contents change.
</p>
<p>
By default, MySQL retrieves cached values for those columns
from the
<code class="literal">
mysql.index_stats
</code>
and
<code class="literal">
mysql.table_stats
</code>
dictionary tables when
the columns are queried, which is more efficient than
retrieving statistics directly from the storage engine. If
cached statistics are not available or have expired, MySQL
retrieves the latest statistics from the storage engine and
caches them in the
<code class="literal">
mysql.index_stats
</code>
and
<code class="literal">
mysql.table_stats
</code>
dictionary tables.
Subsequent queries retrieve the cached statistics until the
cached statistics expire. A server restart or the first
opening of the
<code class="literal">
mysql.index_stats
</code>
and
<code class="literal">
mysql.table_stats
</code>
tables do not update
cached statistics automatically.
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_information_schema_stats_expiry">
<code class="literal">
information_schema_stats_expiry
</code>
</a>
session variable defines the period of time before cached
statistics expire. The default is 86400 seconds (24 hours),
but the time period can be extended to as much as one year.
</p>
<p>
To update cached values at any time for a given table, use
<a class="link" href="analyze-table.html" title="15.7.3.1 ANALYZE TABLE Statement">
<code class="literal">
ANALYZE TABLE
</code>
</a>
.
</p>
<p>
To always retrieve the latest statistics directly from the
storage engine and bypass cached values, set
<a class="link" href="server-system-variables.html#sysvar_information_schema_stats_expiry">
<code class="literal">
information_schema_stats_expiry
</code>
</a>
to
<code class="literal">
0
</code>
.
</p>
<p>
Querying statistics columns does not store or update
statistics in the
<code class="literal">
mysql.index_stats
</code>
and
<code class="literal">
mysql.table_stats
</code>
dictionary tables under
these circumstances:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
When cached statistics have not expired.
</p>
</li>
<li class="listitem">
<p>
When
<a class="link" href="server-system-variables.html#sysvar_information_schema_stats_expiry">
<code class="literal">
information_schema_stats_expiry
</code>
</a>
is set to 0.
</p>
</li>
<li class="listitem">
<p>
When the server is in
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_transaction_read_only">
<code class="literal">
transaction_read_only
</code>
</a>
, or
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_only">
<code class="literal">
innodb_read_only
</code>
</a>
mode.
</p>
</li>
<li class="listitem">
<p>
When the query also fetches Performance Schema data.
</p>
</li>
</ul>
</div>
<p>
The statistics cache may be updated during a
multiple-statement transaction before it is known whether the
transaction commits. As a result, the cache may contain
information that does not correspond to a known committed
state. This can occur with
<a class="link" href="server-system-variables.html#sysvar_autocommit">
<code class="literal">
autocommit=0
</code>
</a>
or after
<a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
<code class="literal">
START
TRANSACTION
</code>
</a>
.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_information_schema_stats_expiry">
<code class="literal">
information_schema_stats_expiry
</code>
</a>
is a session variable, and each client session can define its
own expiration value. Statistics that are retrieved from the
storage engine and cached by one session are available to
other sessions.
</p>
<p>
For related information, see
<a class="xref" href="information-schema-optimization.html" title="10.2.3 Optimizing INFORMATION_SCHEMA Queries">
Section 10.2.3, “Optimizing INFORMATION_SCHEMA Queries”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_init_file">
</a>
<a class="link" href="server-system-variables.html#sysvar_init_file">
<code class="literal">
init_file
</code>
</a>
</p>
<a class="indexterm" name="idm46045274961120">
</a>
<a class="indexterm" name="idm46045274960032">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for init_file">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--init-file=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_init_file">
init_file
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
</tbody>
</table>
</div>
<p>
If specified, this variable names a file containing SQL
statements to be read and executed during the startup process.
The acceptable format for statements in this file support the
following constructs:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
delimiter ;
</code>
, to set the statement
delimiter to the
<code class="literal">
;
</code>
character.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
delimiter $$
</code>
, to set the statement
delimiter to the
<code class="literal">
$$
</code>
character sequence.
</p>
</li>
<li class="listitem">
<p>
Multiple statements on the same line, delimited by the
current delimiter.
</p>
</li>
<li class="listitem">
<p>
Multiple-line statements.
</p>
</li>
<li class="listitem">
<p>
Comments from a
<code class="literal">
#
</code>
character to the end
of the line.
</p>
</li>
<li class="listitem">
<p>
Comments from a
<code class="literal">
--
</code>
sequence to
the end of the line.
</p>
</li>
<li class="listitem">
<p>
C-style comments from a
<code class="literal">
/*
</code>
sequence to
the following
<code class="literal">
*/
</code>
sequence, including
over multiple lines.
</p>
</li>
<li class="listitem">
<p>
Multiple-line string literals enclosed within either
single quote (
<code class="literal">
'
</code>
) or double quote
(
<code class="literal">
"
</code>
) characters.
</p>
</li>
</ul>
</div>
<p>
If the server is started with the
<a class="link" href="server-options.html#option_mysqld_initialize">
<code class="option">
--initialize
</code>
</a>
or
<a class="link" href="server-options.html#option_mysqld_initialize-insecure">
<code class="option">
--initialize-insecure
</code>
</a>
option,
it operates in bootstrap mode and some functionality is
unavailable that limits the statements permitted in the file.
These include statements that relate to account management
(such as
<a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
<code class="literal">
CREATE USER
</code>
</a>
or
<a class="link" href="grant.html" title="15.7.1.6 GRANT Statement">
<code class="literal">
GRANT
</code>
</a>
), replication, and global
transaction identifiers. See
<a class="xref" href="replication-gtids.html" title="19.1.3 Replication with Global Transaction Identifiers">
Section 19.1.3, “Replication with Global Transaction Identifiers”
</a>
.
</p>
<p>
Threads created during server startup are used for tasks such
as creating the data dictionary, running upgrade procedures,
and creating system tables. To ensure a stable and predictable
environment, these threads are executed with the server
built-in defaults for some system variables, such as
<a class="link" href="server-system-variables.html#sysvar_sql_mode">
<code class="literal">
sql_mode
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_character_set_server">
<code class="literal">
character_set_server
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_collation_server">
<code class="literal">
collation_server
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_completion_type">
<code class="literal">
completion_type
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
,
and
<a class="link" href="server-system-variables.html#sysvar_default_table_encryption">
<code class="literal">
default_table_encryption
</code>
</a>
.
</p>
<p>
These threads are also used to execute the statements in any
file specified with
<a class="link" href="server-system-variables.html#sysvar_init_file">
<code class="literal">
init_file
</code>
</a>
when starting the server, so such statements execute with the
server's built-in default values for those system variables.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
innodb_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
</p>
<p>
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
system variables are
listed in
<a class="xref" href="innodb-parameters.html" title="17.14 InnoDB Startup Options and System Variables">
Section 17.14, “InnoDB Startup Options and System Variables”
</a>
. These variables
control many aspects of storage, memory use, and I/O patterns
for
<code class="literal">
InnoDB
</code>
tables, and are especially
important now that
<code class="literal">
InnoDB
</code>
is the default
storage engine.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_insert_id">
</a>
<a class="link" href="server-system-variables.html#sysvar_insert_id">
<code class="literal">
insert_id
</code>
</a>
</p>
<a class="indexterm" name="idm46045274901696">
</a>
<a class="indexterm" name="idm46045274900608">
</a>
<p>
The value to be used by the following
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
or
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
statement when
inserting an
<code class="literal">
AUTO_INCREMENT
</code>
value. This is
mainly used with the binary log.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_interactive_timeout">
</a>
<a class="link" href="server-system-variables.html#sysvar_interactive_timeout">
<code class="literal">
interactive_timeout
</code>
</a>
</p>
<a class="indexterm" name="idm46045274892896">
</a>
<a class="indexterm" name="idm46045274891856">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for interactive_timeout">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--interactive-timeout=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_interactive_timeout">
interactive_timeout
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
28800
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of seconds the server waits for activity on an
interactive connection before closing it. An interactive
client is defined as a client that uses the
<code class="literal">
CLIENT_INTERACTIVE
</code>
option to
<a class="ulink" href="/doc/c-api/8.4/en/mysql-real-connect.html" target="_top">
<code class="literal">
mysql_real_connect()
</code>
</a>
. See also
<a class="link" href="server-system-variables.html#sysvar_wait_timeout">
<code class="literal">
wait_timeout
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_internal_tmp_mem_storage_engine">
</a>
<a class="link" href="server-system-variables.html#sysvar_internal_tmp_mem_storage_engine">
<code class="literal">
internal_tmp_mem_storage_engine
</code>
</a>
</p>
<a class="indexterm" name="idm46045274857088">
</a>
<a class="indexterm" name="idm46045274855984">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for internal_tmp_mem_storage_engine">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--internal-tmp-mem-storage-engine=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_internal_tmp_mem_storage_engine">
internal_tmp_mem_storage_engine
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
TempTable
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
MEMORY
</code>
</p>
<p class="valid-value">
<code class="literal">
TempTable
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The storage engine for in-memory internal temporary tables
(see
<a class="xref" href="internal-temporary-tables.html" title="10.4.4 Internal Temporary Table Use in MySQL">
Section 10.4.4, “Internal Temporary Table Use in MySQL”
</a>
). Permitted
values are
<code class="literal">
TempTable
</code>
(the default) and
<code class="literal">
MEMORY
</code>
.
</p>
<p>
The
<a class="link" href="glossary.html#glos_optimizer" title="optimizer">
optimizer
</a>
uses the
storage engine defined by
<a class="link" href="server-system-variables.html#sysvar_internal_tmp_mem_storage_engine">
<code class="literal">
internal_tmp_mem_storage_engine
</code>
</a>
for in-memory internal temporary tables.
</p>
<p>
Configuring a session setting for
<a class="link" href="server-system-variables.html#sysvar_internal_tmp_mem_storage_engine">
<code class="literal">
internal_tmp_mem_storage_engine
</code>
</a>
requires the
<a class="link" href="privileges-provided.html#priv_session-variables-admin">
<code class="literal">
SESSION_VARIABLES_ADMIN
</code>
</a>
or
<a class="link" href="privileges-provided.html#priv_system-variables-admin">
<code class="literal">
SYSTEM_VARIABLES_ADMIN
</code>
</a>
privilege.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_join_buffer_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_join_buffer_size">
<code class="literal">
join_buffer_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045274818272">
</a>
<a class="indexterm" name="idm46045274817184">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for join_buffer_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--join-buffer-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_join_buffer_size">
join_buffer_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
262144
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
128
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Windows)
</th>
<td>
<code class="literal">
4294967168
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Other, 64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551488
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Other, 32-bit platforms)
</th>
<td>
<code class="literal">
4294967168
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
128
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The minimum size of the buffer that is used for plain index
scans, range index scans, and joins that do not use indexes
and thus perform full table scans. This variable also controls
the amount of memory used for hash joins. Normally, the best
way to get fast joins is to add indexes. Increase the value of
<a class="link" href="server-system-variables.html#sysvar_join_buffer_size">
<code class="literal">
join_buffer_size
</code>
</a>
to get a
faster full join when adding indexes is not possible. One join
buffer is allocated for each full join between two tables. For
a complex join between several tables for which indexes are
not used, multiple join buffers might be necessary.
</p>
<p>
The default is 256KB. The maximum permissible setting for
<a class="link" href="server-system-variables.html#sysvar_join_buffer_size">
<code class="literal">
join_buffer_size
</code>
</a>
is
4GB−1. Larger values are permitted for 64-bit platforms
(except 64-bit Windows, for which large values are truncated
to 4GB−1 with a warning). The block size is 128, and a
value that is not an exact multiple of the block size is
rounded down to the next lower multiple of the block size by
MySQL Server before storing the value for the system variable.
The parser allows values up to the maximum unsigned integer
value for the platform (4294967295 or
2
<sup>
32
</sup>
−1 for a 32-bit system,
18446744073709551615 or 2
<sup>
64
</sup>
−1
for a 64-bit system) but the actual maximum is a block size
lower.
</p>
<p>
Unless a Block Nested-Loop or Batched Key Access algorithm is
used, there is no gain from setting the buffer larger than
required to hold each matching row, and all joins allocate at
least the minimum size, so use caution in setting this
variable to a large value globally. It is better to keep the
global setting small and change the session setting to a
larger value only in sessions that are doing large joins, or
change the setting on a per-query basis by using a
<code class="literal">
SET_VAR
</code>
optimizer hint (see
<a class="xref" href="optimizer-hints.html" title="10.9.3 Optimizer Hints">
Section 10.9.3, “Optimizer Hints”
</a>
). Memory allocation time can
cause substantial performance drops if the global size is
larger than needed by most queries that use it.
</p>
<p>
When Block Nested-Loop is used, a larger join buffer can be
beneficial up to the point where all required columns from all
rows in the first table are stored in the join buffer. This
depends on the query; the optimal size may be smaller than
holding all rows from the first tables.
</p>
<p>
When Batched Key Access is used, the value of
<a class="link" href="server-system-variables.html#sysvar_join_buffer_size">
<code class="literal">
join_buffer_size
</code>
</a>
defines how
large the batch of keys is in each request to the storage
engine. The larger the buffer, the more sequential access is
made to the right hand table of a join operation, which can
significantly improve performance.
</p>
<p>
For additional information about join buffering, see
<a class="xref" href="nested-loop-joins.html" title="10.2.1.7 Nested-Loop Join Algorithms">
Section 10.2.1.7, “Nested-Loop Join Algorithms”
</a>
. For information about
Batched Key Access, see
<a class="xref" href="bnl-bka-optimization.html" title="10.2.1.12 Block Nested-Loop and Batched Key Access Joins">
Section 10.2.1.12, “Block Nested-Loop and Batched Key Access Joins”
</a>
. For information about
hash joins, see
<a class="xref" href="hash-joins.html" title="10.2.1.4 Hash Join Optimization">
Section 10.2.1.4, “Hash Join Optimization”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_keep_files_on_create">
</a>
<a class="link" href="server-system-variables.html#sysvar_keep_files_on_create">
<code class="literal">
keep_files_on_create
</code>
</a>
</p>
<a class="indexterm" name="idm46045274764176">
</a>
<a class="indexterm" name="idm46045274763136">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for keep_files_on_create">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--keep-files-on-create[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_keep_files_on_create">
keep_files_on_create
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If a
<code class="literal">
MyISAM
</code>
table is created with no
<code class="literal">
DATA DIRECTORY
</code>
option, the
<code class="filename">
.MYD
</code>
file is created in the database
directory. By default, if
<code class="literal">
MyISAM
</code>
finds an
existing
<code class="filename">
.MYD
</code>
file in this case, it
overwrites it. The same applies to
<code class="filename">
.MYI
</code>
files for tables created with no
<code class="literal">
INDEX
DIRECTORY
</code>
option. To suppress this behavior, set the
<a class="link" href="server-system-variables.html#sysvar_keep_files_on_create">
<code class="literal">
keep_files_on_create
</code>
</a>
variable
to
<code class="literal">
ON
</code>
(1), in which case
<code class="literal">
MyISAM
</code>
does not overwrite existing files
and returns an error instead. The default value is
<code class="literal">
OFF
</code>
(0).
</p>
<p>
If a
<code class="literal">
MyISAM
</code>
table is created with a
<code class="literal">
DATA DIRECTORY
</code>
or
<code class="literal">
INDEX
DIRECTORY
</code>
option and an existing
<code class="filename">
.MYD
</code>
or
<code class="filename">
.MYI
</code>
file is
found, MyISAM always returns an error. It does not overwrite a
file in the specified directory.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_key_buffer_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
<code class="literal">
key_buffer_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045274725856">
</a>
<a class="indexterm" name="idm46045274724368">
</a>
<a class="indexterm" name="idm46045274723280">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for key_buffer_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--key-buffer-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
key_buffer_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
8388608
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
OS_PER_PROCESS_LIMIT
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
Index blocks for
<code class="literal">
MyISAM
</code>
tables are buffered
and are shared by all threads.
<a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
<code class="literal">
key_buffer_size
</code>
</a>
is the size
of the buffer used for index blocks. The key buffer is also
known as the key cache.
</p>
<p>
The minimum permissible setting is 0, but you cannot set
<a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
<code class="literal">
key_buffer_size
</code>
</a>
to 0
dynamically. A setting of 0 drops the key cache, which is not
permitted at runtime. Setting
<a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
<code class="literal">
key_buffer_size
</code>
</a>
to 0 is
permitted only at startup, in which case the key cache is not
initialized. Changing the
<a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
<code class="literal">
key_buffer_size
</code>
</a>
setting at
runtime from a value of 0 to a permitted non-zero value
initializes the key cache.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
<code class="literal">
key_buffer_size
</code>
</a>
can be
increased or decreased only in increments or multiples of 4096
bytes. Increasing or decreasing the setting by a nonconforming
value produces a warning and truncates the setting to a
conforming value.
</p>
<p>
The maximum permissible setting for
<a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
<code class="literal">
key_buffer_size
</code>
</a>
is
4GB−1 on 32-bit platforms. Larger values are permitted
for 64-bit platforms. The effective maximum size might be
less, depending on your available physical RAM and per-process
RAM limits imposed by your operating system or hardware
platform. The value of this variable indicates the amount of
memory requested. Internally, the server allocates as much
memory as possible up to this amount, but the actual
allocation might be less.
</p>
<p>
You can increase the value to get better index handling for
all reads and multiple writes; on a system whose primary
function is to run MySQL using the
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
storage engine, 25% of the
machine's total memory is an acceptable value for this
variable. However, you should be aware that, if you make the
value too large (for example, more than 50% of the
machine's total memory), your system might start to page
and become extremely slow. This is because MySQL relies on the
operating system to perform file system caching for data
reads, so you must leave some room for the file system cache.
You should also consider the memory requirements of any other
storage engines that you may be using in addition to
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
.
</p>
<p>
For even more speed when writing many rows at the same time,
use
<a class="link" href="lock-tables.html" title="15.3.6 LOCK TABLES and UNLOCK TABLES Statements">
<code class="literal">
LOCK TABLES
</code>
</a>
. See
<a class="xref" href="insert-optimization.html" title="10.2.5.1 Optimizing INSERT Statements">
Section 10.2.5.1, “Optimizing INSERT Statements”
</a>
.
</p>
<p>
You can check the performance of the key buffer by issuing a
<a class="link" href="show-status.html" title="15.7.7.37 SHOW STATUS Statement">
<code class="literal">
SHOW STATUS
</code>
</a>
statement and
examining the
<a class="link" href="server-status-variables.html#statvar_Key_read_requests">
<code class="literal">
Key_read_requests
</code>
</a>
,
<a class="link" href="server-status-variables.html#statvar_Key_reads">
<code class="literal">
Key_reads
</code>
</a>
,
<a class="link" href="server-status-variables.html#statvar_Key_write_requests">
<code class="literal">
Key_write_requests
</code>
</a>
, and
<a class="link" href="server-status-variables.html#statvar_Key_writes">
<code class="literal">
Key_writes
</code>
</a>
status variables.
(See
<a class="xref" href="show.html" title="15.7.7 SHOW Statements">
Section 15.7.7, “SHOW Statements”
</a>
.) The
<code class="literal">
Key_reads/Key_read_requests
</code>
ratio should
normally be less than 0.01. The
<code class="literal">
Key_writes/Key_write_requests
</code>
ratio is
usually near 1 if you are using mostly updates and deletes,
but might be much smaller if you tend to do updates that
affect many rows at the same time or if you are using the
<code class="literal">
DELAY_KEY_WRITE
</code>
table option.
</p>
<p>
The fraction of the key buffer in use can be determined using
<a class="link" href="server-system-variables.html#sysvar_key_buffer_size">
<code class="literal">
key_buffer_size
</code>
</a>
in
conjunction with the
<a class="link" href="server-status-variables.html#statvar_Key_blocks_unused">
<code class="literal">
Key_blocks_unused
</code>
</a>
status
variable and the buffer block size, which is available from
the
<a class="link" href="server-system-variables.html#sysvar_key_cache_block_size">
<code class="literal">
key_cache_block_size
</code>
</a>
system variable:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa35017035"><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-simple">1 <span class="token operator">-</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>Key_blocks_unused <span class="token operator">*</span> key_cache_block_size<span class="token punctuation">)</span> <span class="token operator">/</span> key_buffer_size<span class="token punctuation">)</span></code></pre>
</div>
<p>
This value is an approximation because some space in the key
buffer is allocated internally for administrative structures.
Factors that influence the amount of overhead for these
structures include block size and pointer size. As block size
increases, the percentage of the key buffer lost to overhead
tends to decrease. Larger blocks results in a smaller number
of read operations (because more keys are obtained per read),
but conversely an increase in reads of keys that are not
examined (if not all keys in a block are relevant to a query).
</p>
<p>
It is possible to create multiple
<code class="literal">
MyISAM
</code>
key caches. The size limit of 4GB applies to each cache
individually, not as a group. See
<a class="xref" href="myisam-key-cache.html" title="10.10.2 The MyISAM Key Cache">
Section 10.10.2, “The MyISAM Key Cache”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_key_cache_age_threshold">
</a>
<a class="link" href="server-system-variables.html#sysvar_key_cache_age_threshold">
<code class="literal">
key_cache_age_threshold
</code>
</a>
</p>
<a class="indexterm" name="idm46045274654688">
</a>
<a class="indexterm" name="idm46045274653648">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for key_cache_age_threshold">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--key-cache-age-threshold=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_key_cache_age_threshold">
key_cache_age_threshold
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
300
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
100
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551516
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967196
</code>
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
100
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This value controls the demotion of buffers from the hot
sublist of a key cache to the warm sublist. Lower values cause
demotion to happen more quickly. The minimum value is 100. The
default value is 300. See
<a class="xref" href="myisam-key-cache.html" title="10.10.2 The MyISAM Key Cache">
Section 10.10.2, “The MyISAM Key Cache”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_key_cache_block_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_key_cache_block_size">
<code class="literal">
key_cache_block_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045274617936">
</a>
<a class="indexterm" name="idm46045274616896">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for key_cache_block_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--key-cache-block-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_key_cache_block_size">
key_cache_block_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
512
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
16384
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
512
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The size in bytes of blocks in the key cache. The default
value is 1024. See
<a class="xref" href="myisam-key-cache.html" title="10.10.2 The MyISAM Key Cache">
Section 10.10.2, “The MyISAM Key Cache”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_key_cache_division_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_key_cache_division_limit">
<code class="literal">
key_cache_division_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045274581712">
</a>
<a class="indexterm" name="idm46045274580608">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for key_cache_division_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--key-cache-division-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_key_cache_division_limit">
key_cache_division_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
100
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
100
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The division point between the hot and warm sublists of the
key cache buffer list. The value is the percentage of the
buffer list to use for the warm sublist. Permissible values
range from 1 to 100. The default value is 100. See
<a class="xref" href="myisam-key-cache.html" title="10.10.2 The MyISAM Key Cache">
Section 10.10.2, “The MyISAM Key Cache”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_large_files_support">
</a>
<a class="link" href="server-system-variables.html#sysvar_large_files_support">
<code class="literal">
large_files_support
</code>
</a>
</p>
<a class="indexterm" name="idm46045274550304">
</a>
<a class="indexterm" name="idm46045274549264">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for large_files_support">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_large_files_support">
large_files_support
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
was compiled with options
for large file support.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_large_pages">
</a>
<a class="link" href="server-system-variables.html#sysvar_large_pages">
<code class="literal">
large_pages
</code>
</a>
</p>
<a class="indexterm" name="idm46045274528416">
</a>
<a class="indexterm" name="idm46045274527328">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for large-pages">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--large-pages[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_large_pages">
large_pages
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Platform Specific
</th>
<td>
Linux
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether large page support is enabled (via the
<a class="link" href="server-options.html#option_mysqld_large-pages">
<code class="option">
--large-pages
</code>
</a>
option). See
<a class="xref" href="large-page-support.html" title="10.12.3.3 Enabling Large Page Support">
Section 10.12.3.3, “Enabling Large Page Support”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_large_page_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_large_page_size">
<code class="literal">
large_page_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045274499136">
</a>
<a class="indexterm" name="idm46045274498048">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for large_page_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_large_page_size">
large_page_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
65535
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
If large page support is enabled, this shows the size of
memory pages. Large memory pages are supported only on Linux;
on other platforms, the value of this variable is always 0.
See
<a class="xref" href="large-page-support.html" title="10.12.3.3 Enabling Large Page Support">
Section 10.12.3.3, “Enabling Large Page Support”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_last_insert_id">
</a>
<a class="link" href="server-system-variables.html#sysvar_last_insert_id">
<code class="literal">
last_insert_id
</code>
</a>
</p>
<a class="indexterm" name="idm46045274468368">
</a>
<a class="indexterm" name="idm46045274467280">
</a>
<p>
The value to be returned from
<a class="link" href="information-functions.html#function_last-insert-id">
<code class="literal">
LAST_INSERT_ID()
</code>
</a>
. This is
stored in the binary log when you use
<a class="link" href="information-functions.html#function_last-insert-id">
<code class="literal">
LAST_INSERT_ID()
</code>
</a>
in a statement
that updates a table. Setting this variable does not update
the value returned by the
<a class="ulink" href="/doc/c-api/8.4/en/mysql-insert-id.html" target="_top">
<code class="literal">
mysql_insert_id()
</code>
</a>
C API
function.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_lc_messages">
</a>
<a class="link" href="server-system-variables.html#sysvar_lc_messages">
<code class="literal">
lc_messages
</code>
</a>
</p>
<a class="indexterm" name="idm46045274459136">
</a>
<a class="indexterm" name="idm46045274458048">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for lc-messages">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--lc-messages=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_lc_messages">
lc_messages
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
en_US
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The locale to use for error messages. The default is
<code class="literal">
en_US
</code>
. The server converts the argument to
a language name and combines it with the value of
<a class="link" href="server-system-variables.html#sysvar_lc_messages_dir">
<code class="literal">
lc_messages_dir
</code>
</a>
to produce
the location for the error message file. See
<a class="xref" href="error-message-language.html" title="12.12 Setting the Error Message Language">
Section 12.12, “Setting the Error Message Language”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_lc_messages_dir">
</a>
<a class="link" href="server-system-variables.html#sysvar_lc_messages_dir">
<code class="literal">
lc_messages_dir
</code>
</a>
</p>
<a class="indexterm" name="idm46045274430768">
</a>
<a class="indexterm" name="idm46045274429680">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for lc-messages-dir">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--lc-messages-dir=dir_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_lc_messages_dir">
lc_messages_dir
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Directory name
</td>
</tr>
</tbody>
</table>
</div>
<p>
The directory where error messages are located. The server
uses the value together with the value of
<a class="link" href="server-system-variables.html#sysvar_lc_messages">
<code class="literal">
lc_messages
</code>
</a>
to produce the
location for the error message file. See
<a class="xref" href="error-message-language.html" title="12.12 Setting the Error Message Language">
Section 12.12, “Setting the Error Message Language”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_lc_time_names">
</a>
<a class="link" href="server-system-variables.html#sysvar_lc_time_names">
<code class="literal">
lc_time_names
</code>
</a>
</p>
<a class="indexterm" name="idm46045274405600">
</a>
<a class="indexterm" name="idm46045274404512">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for lc_time_names">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--lc-time-names=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_lc_time_names">
lc_time_names
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable specifies the locale that controls the language
used to display day and month names and abbreviations. This
variable affects the output from the
<a class="link" href="date-and-time-functions.html#function_date-format">
<code class="literal">
DATE_FORMAT()
</code>
</a>
,
<a class="link" href="date-and-time-functions.html#function_dayname">
<code class="literal">
DAYNAME()
</code>
</a>
and
<a class="link" href="date-and-time-functions.html#function_monthname">
<code class="literal">
MONTHNAME()
</code>
</a>
functions. Locale
names are POSIX-style values such as
<code class="literal">
'ja_JP'
</code>
or
<code class="literal">
'pt_BR'
</code>
. The
default value is
<code class="literal">
'en_US'
</code>
regardless of your
system's locale setting. For further information, see
<a class="xref" href="locale-support.html" title="12.16 MySQL Server Locale Support">
Section 12.16, “MySQL Server Locale Support”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_license">
</a>
<a class="link" href="server-system-variables.html#sysvar_license">
<code class="literal">
license
</code>
</a>
</p>
<a class="indexterm" name="idm46045274375120">
</a>
<a class="indexterm" name="idm46045274374048">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for license">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_license">
license
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
GPL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The type of license the server has.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_local_infile">
</a>
<a class="link" href="server-system-variables.html#sysvar_local_infile">
<code class="literal">
local_infile
</code>
</a>
</p>
<a class="indexterm" name="idm46045274352032">
</a>
<a class="indexterm" name="idm46045274350944">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for local_infile">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--local-infile[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_local_infile">
local_infile
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls server-side
<code class="literal">
LOCAL
</code>
capability for
<a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
<code class="literal">
LOAD DATA
</code>
</a>
statements. Depending on the
<a class="link" href="server-system-variables.html#sysvar_local_infile">
<code class="literal">
local_infile
</code>
</a>
setting, the
server refuses or permits local data loading by clients that
have
<code class="literal">
LOCAL
</code>
enabled on the client side.
</p>
<p>
To explicitly cause the server to refuse or permit
<a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
<code class="literal">
LOAD DATA
LOCAL
</code>
</a>
statements (regardless of how client programs
and libraries are configured at build time or runtime), start
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
with
<a class="link" href="server-system-variables.html#sysvar_local_infile">
<code class="literal">
local_infile
</code>
</a>
disabled or
enabled, respectively.
<a class="link" href="server-system-variables.html#sysvar_local_infile">
<code class="literal">
local_infile
</code>
</a>
can also be set
at runtime. For more information, see
<a class="xref" href="load-data-local-security.html" title="8.1.6 Security Considerations for LOAD DATA LOCAL">
Section 8.1.6, “Security Considerations for LOAD DATA LOCAL”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_lock_wait_timeout">
</a>
<a class="link" href="server-system-variables.html#sysvar_lock_wait_timeout">
<code class="literal">
lock_wait_timeout
</code>
</a>
</p>
<a class="indexterm" name="idm46045274315984">
</a>
<a class="indexterm" name="idm46045274314944">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for lock_wait_timeout">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--lock-wait-timeout=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_lock_wait_timeout">
lock_wait_timeout
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable specifies the timeout in seconds for attempts to
acquire metadata locks. The permissible values range from 1 to
31536000 (1 year). The default is 31536000.
</p>
<p>
This timeout applies to all statements that use metadata
locks. These include DML and DDL operations on tables, views,
stored procedures, and stored functions, as well as
<a class="link" href="lock-tables.html" title="15.3.6 LOCK TABLES and UNLOCK TABLES Statements">
<code class="literal">
LOCK TABLES
</code>
</a>
,
<a class="link" href="flush.html#flush-tables-with-read-lock">
<code class="literal">
FLUSH TABLES WITH READ LOCK
</code>
</a>
,
and
<a class="link" href="handler.html" title="15.2.5 HANDLER Statement">
<code class="literal">
HANDLER
</code>
</a>
statements.
</p>
<p>
This timeout does not apply to implicit accesses to system
tables in the
<code class="literal">
mysql
</code>
database, such as grant
tables modified by
<a class="link" href="grant.html" title="15.7.1.6 GRANT Statement">
<code class="literal">
GRANT
</code>
</a>
or
<a class="link" href="revoke.html" title="15.7.1.8 REVOKE Statement">
<code class="literal">
REVOKE
</code>
</a>
statements or table
logging statements. The timeout does apply to system tables
accessed directly, such as with
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
or
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
.
</p>
<p>
The timeout value applies separately for each metadata lock
attempt. A given statement can require more than one lock, so
it is possible for the statement to block for longer than the
<a class="link" href="server-system-variables.html#sysvar_lock_wait_timeout">
<code class="literal">
lock_wait_timeout
</code>
</a>
value
before reporting a timeout error. When lock timeout occurs,
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_lock_wait_timeout" target="_top">
<code class="literal">
ER_LOCK_WAIT_TIMEOUT
</code>
</a>
is
reported.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_lock_wait_timeout">
<code class="literal">
lock_wait_timeout
</code>
</a>
also
defines the amount of time that a
<a class="link" href="lock-instance-for-backup.html" title="15.3.5 LOCK INSTANCE FOR BACKUP and UNLOCK INSTANCE Statements">
<code class="literal">
LOCK
INSTANCE FOR BACKUP
</code>
</a>
statement waits for a lock
before giving up.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_locked_in_memory">
</a>
<a class="link" href="server-system-variables.html#sysvar_locked_in_memory">
<code class="literal">
locked_in_memory
</code>
</a>
</p>
<a class="indexterm" name="idm46045274266368">
</a>
<a class="indexterm" name="idm46045274265280">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for locked_in_memory">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_locked_in_memory">
locked_in_memory
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
was locked in memory with
<a class="link" href="server-options.html#option_mysqld_memlock">
<code class="option">
--memlock
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_log_error">
</a>
<a class="link" href="server-system-variables.html#sysvar_log_error">
<code class="literal">
log_error
</code>
</a>
</p>
<a class="indexterm" name="idm46045274241184">
</a>
<a class="indexterm" name="idm46045274240096">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for log-error">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--log-error[=file_name]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_log_error">
log_error
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
</tbody>
</table>
</div>
<p>
The default error log destination. If the destination is the
console, the value is
<code class="literal">
stderr
</code>
. Otherwise,
the destination is a file and the
<a class="link" href="server-system-variables.html#sysvar_log_error">
<code class="literal">
log_error
</code>
</a>
value is the file
name. See
<a class="xref" href="error-log.html" title="7.4.2 The Error Log">
Section 7.4.2, “The Error Log”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_log_error_services">
</a>
<a class="link" href="server-system-variables.html#sysvar_log_error_services">
<code class="literal">
log_error_services
</code>
</a>
</p>
<a class="indexterm" name="idm46045274215280">
</a>
<a class="indexterm" name="idm46045274214240">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for log_error_services">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--log-error-services=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_log_error_services">
log_error_services
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
log_filter_internal; log_sink_internal
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The components to enable for error logging. The variable may
contain a list with 0, 1, or many elements. In the latter
case, elements may be delimited by semicolons or commas,
optionally followed by space. A given setting cannot use both
semicolon and comma separators. Component order is significant
because the server executes components in the order listed.
</p>
<p>
Any loadable (not built in) component named in
<a class="link" href="server-system-variables.html#sysvar_log_error_services">
<code class="literal">
log_error_services
</code>
</a>
is
implicitly loaded if it is not already loaded. For more
information, see
<a class="xref" href="error-log-configuration.html" title="7.4.2.1 Error Log Configuration">
Section 7.4.2.1, “Error Log Configuration”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_log_error_suppression_list">
</a>
<a class="link" href="server-system-variables.html#sysvar_log_error_suppression_list">
<code class="literal">
log_error_suppression_list
</code>
</a>
</p>
<a class="indexterm" name="idm46045274185920">
</a>
<a class="indexterm" name="idm46045274184816">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for log_error_suppression_list">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--log-error-suppression-list=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_log_error_suppression_list">
log_error_suppression_list
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
empty string
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_log_error_suppression_list">
<code class="literal">
log_error_suppression_list
</code>
</a>
system variable applies to events intended for the error log
and specifies which events to suppress when they occur with a
priority of
<code class="literal">
WARNING
</code>
or
<code class="literal">
INFORMATION
</code>
. For example, if a particular
type of warning is considered undesirable
<span class="quote">
“
<span class="quote">
noise
</span>
”
</span>
in the error log because it occurs frequently but is not of
interest, it can be suppressed. This variable affects
filtering performed by the
<code class="literal">
log_filter_internal
</code>
error log filter
component, which is enabled by default (see
<a class="xref" href="error-log-components.html" title="7.5.3 Error Log Components">
Section 7.5.3, “Error Log Components”
</a>
). If
<code class="literal">
log_filter_internal
</code>
is disabled,
<a class="link" href="server-system-variables.html#sysvar_log_error_suppression_list">
<code class="literal">
log_error_suppression_list
</code>
</a>
has no effect.
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_log_error_suppression_list">
<code class="literal">
log_error_suppression_list
</code>
</a>
value may be the empty string for no suppression, or a list of
one or more comma-separated values indicating the error codes
to suppress. Error codes may be specified in symbolic or
numeric form. A numeric code may be specified with or without
the
<code class="literal">
MY-
</code>
prefix. Leading zeros in the
numeric part are not significant. Examples of permitted code
formats:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-simple"><div class="docs-select-all right" id="sa33441907"><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-simple">ER_SERVER_SHUTDOWN_COMPLETE
MY<span class="token operator">-</span>000031
000031
MY<span class="token operator">-</span>31
31</code></pre>
</div>
<p>
Symbolic values are preferable to numeric values for
readability and portability. For information about the
permitted error symbols and numbers, see
<a class="ulink" href="/doc/mysql-errors/8.4/en/" target="_top">
MySQL 8.4 Error Message Reference
</a>
.
</p>
<p>
The effect of
<a class="link" href="server-system-variables.html#sysvar_log_error_suppression_list">
<code class="literal">
log_error_suppression_list
</code>
</a>
combines with that of
<a class="link" href="server-system-variables.html#sysvar_log_error_verbosity">
<code class="literal">
log_error_verbosity
</code>
</a>
. For
additional information, see
<a class="xref" href="error-log-priority-based-filtering.html" title="7.4.2.5 Priority-Based Error Log Filtering (log_filter_internal)">
Section 7.4.2.5, “Priority-Based Error Log Filtering (log_filter_internal)”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_log_error_verbosity">
</a>
<a class="link" href="server-system-variables.html#sysvar_log_error_verbosity">
<code class="literal">
log_error_verbosity
</code>
</a>
</p>
<a class="indexterm" name="idm46045274143904">
</a>
<a class="indexterm" name="idm46045274142864">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for log_error_verbosity">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--log-error-verbosity=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_log_error_verbosity">
log_error_verbosity
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
2
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
3
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_log_error_verbosity">
<code class="literal">
log_error_verbosity
</code>
</a>
system variable specifies the verbosity for handling events
intended for the error log. This variable affects filtering
performed by the
<code class="literal">
log_filter_internal
</code>
error
log filter component, which is enabled by default (see
<a class="xref" href="error-log-components.html" title="7.5.3 Error Log Components">
Section 7.5.3, “Error Log Components”
</a>
). If
<code class="literal">
log_filter_internal
</code>
is disabled,
<a class="link" href="server-system-variables.html#sysvar_log_error_verbosity">
<code class="literal">
log_error_verbosity
</code>
</a>
has no
effect.
</p>
<p>
Events intended for the error log have a priority of
<code class="literal">
ERROR
</code>
,
<code class="literal">
WARNING
</code>
, or
<code class="literal">
INFORMATION
</code>
.
<a class="link" href="server-system-variables.html#sysvar_log_error_verbosity">
<code class="literal">
log_error_verbosity
</code>
</a>
controls
verbosity based on which priorities to permit for messages
written to the log, as shown in the following table.
</p>
<div class="informaltable">
<table summary="Permitted log_error_verbosity values and corresponding permitted message priorities">
<colgroup>
<col style="width: 40%"/>
<col style="width: 40%"/>
</colgroup>
<thead>
<tr>
<th>
log_error_verbosity Value
</th>
<th>
Permitted Message Priorities
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
1
</td>
<td>
<code class="literal">
ERROR
</code>
</td>
</tr>
<tr>
<td>
2
</td>
<td>
<code class="literal">
ERROR
</code>
,
<code class="literal">
WARNING
</code>
</td>
</tr>
<tr>
<td>
3
</td>
<td>
<code class="literal">
ERROR
</code>
,
<code class="literal">
WARNING
</code>
,
<code class="literal">
INFORMATION
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
There is also a priority of
<code class="literal">
SYSTEM
</code>
. System
messages about non-error situations are printed to the error
log regardless of the
<a class="link" href="server-system-variables.html#sysvar_log_error_verbosity">
<code class="literal">
log_error_verbosity
</code>
</a>
value.
These messages include startup and shutdown messages, and some
significant changes to settings.
</p>
<p>
The effect of
<a class="link" href="server-system-variables.html#sysvar_log_error_verbosity">
<code class="literal">
log_error_verbosity
</code>
</a>
combines
with that of
<a class="link" href="server-system-variables.html#sysvar_log_error_suppression_list">
<code class="literal">
log_error_suppression_list
</code>
</a>
.
For additional information, see
<a class="xref" href="error-log-priority-based-filtering.html" title="7.4.2.5 Priority-Based Error Log Filtering (log_filter_internal)">
Section 7.4.2.5, “Priority-Based Error Log Filtering (log_filter_internal)”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_log_output">
</a>
<a class="link" href="server-system-variables.html#sysvar_log_output">
<code class="literal">
log_output
</code>
</a>
</p>
<a class="indexterm" name="idm46045274083424">
</a>
<a class="indexterm" name="idm46045274082336">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for log_output">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--log-output=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_log_output">
log_output
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Set
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
FILE
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
TABLE
</code>
</p>
<p class="valid-value">
<code class="literal">
FILE
</code>
</p>
<p class="valid-value">
<code class="literal">
NONE
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The destination or destinations for general query log and slow
query log output. The value is a list one or more
comma-separated words chosen from
<code class="literal">
TABLE
</code>
,
<code class="literal">
FILE
</code>
, and
<code class="literal">
NONE
</code>
.
<code class="literal">
TABLE
</code>
selects logging to the
<a class="link" href="server-system-variables.html#sysvar_general_log">
<code class="literal">
general_log
</code>
</a>
and
<code class="literal">
slow_log
</code>
tables in the
<code class="literal">
mysql
</code>
system schema.
<code class="literal">
FILE
</code>
selects logging to log files.
<code class="literal">
NONE
</code>
disables logging. If
<code class="literal">
NONE
</code>
is present in the value, it takes
precedence over any other words that are present.
<code class="literal">
TABLE
</code>
and
<code class="literal">
FILE
</code>
can both
be given to select both log output destinations.
</p>
<p>
This variable selects log output destinations, but does not
enable log output. To do that, enable the
<a class="link" href="server-system-variables.html#sysvar_general_log">
<code class="literal">
general_log
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_slow_query_log">
<code class="literal">
slow_query_log
</code>
</a>
system
variables. For
<code class="literal">
FILE
</code>
logging, the
<a class="link" href="server-system-variables.html#sysvar_general_log_file">
<code class="literal">
general_log_file
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_slow_query_log_file">
<code class="literal">
slow_query_log_file
</code>
</a>
system
variables determine the log file locations. For more
information, see
<a class="xref" href="log-destinations.html" title="7.4.1 Selecting General Query Log and Slow Query Log Output Destinations">
Section 7.4.1, “Selecting General Query Log and Slow Query Log Output Destinations”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_log_queries_not_using_indexes">
</a>
<a class="link" href="server-system-variables.html#sysvar_log_queries_not_using_indexes">
<code class="literal">
log_queries_not_using_indexes
</code>
</a>
</p>
<a class="indexterm" name="idm46045274036480">
</a>
<a class="indexterm" name="idm46045274035376">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for log_queries_not_using_indexes">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--log-queries-not-using-indexes[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_log_queries_not_using_indexes">
log_queries_not_using_indexes
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If you enable this variable with the slow query log enabled,
queries that are expected to retrieve all rows are logged. See
<a class="xref" href="slow-query-log.html" title="7.4.5 The Slow Query Log">
Section 7.4.5, “The Slow Query Log”
</a>
. This option does not
necessarily mean that no index is used. For example, a query
that uses a full index scan uses an index but would be logged
because the index would not limit the number of rows.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_log_raw">
</a>
<a class="link" href="server-system-variables.html#sysvar_log_raw">
<code class="literal">
log_raw
</code>
</a>
</p>
<a class="indexterm" name="idm46045274009824">
</a>
<a class="indexterm" name="idm46045274008752">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for log-raw">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--log-raw[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_log_raw">
log_raw
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_log_raw">
<code class="literal">
log_raw
</code>
</a>
system variable
is initially set to the value of the
<a class="link" href="server-options.html#option_mysqld_log-raw">
<code class="option">
--log-raw
</code>
</a>
option. See the
description of that option for more information. The system
variable may also be set at runtime to change password masking
behavior.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_log_slow_admin_statements">
</a>
<a class="link" href="server-system-variables.html#sysvar_log_slow_admin_statements">
<code class="literal">
log_slow_admin_statements
</code>
</a>
</p>
<a class="indexterm" name="idm46045273981920">
</a>
<a class="indexterm" name="idm46045273980400">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for log_slow_admin_statements">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--log-slow-admin-statements[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_log_slow_admin_statements">
log_slow_admin_statements
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Include slow administrative statements in the statements
written to the slow query log. Administrative statements
include
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
,
<a class="link" href="analyze-table.html" title="15.7.3.1 ANALYZE TABLE Statement">
<code class="literal">
ANALYZE TABLE
</code>
</a>
,
<a class="link" href="check-table.html" title="15.7.3.2 CHECK TABLE Statement">
<code class="literal">
CHECK TABLE
</code>
</a>
,
<a class="link" href="create-index.html" title="15.1.15 CREATE INDEX Statement">
<code class="literal">
CREATE INDEX
</code>
</a>
,
<a class="link" href="drop-index.html" title="15.1.27 DROP INDEX Statement">
<code class="literal">
DROP INDEX
</code>
</a>
,
<a class="link" href="optimize-table.html" title="15.7.3.4 OPTIMIZE TABLE Statement">
<code class="literal">
OPTIMIZE TABLE
</code>
</a>
, and
<a class="link" href="repair-table.html" title="15.7.3.5 REPAIR TABLE Statement">
<code class="literal">
REPAIR TABLE
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_log_slow_extra">
</a>
<a class="link" href="server-system-variables.html#sysvar_log_slow_extra">
<code class="literal">
log_slow_extra
</code>
</a>
</p>
<a class="indexterm" name="idm46045273947184">
</a>
<a class="indexterm" name="idm46045273946096">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for log_slow_extra">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--log-slow-extra[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_log_slow_extra">
log_slow_extra
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If the slow query log is enabled and the output destination
includes
<code class="literal">
FILE
</code>
, the server writes additional
fields to log file lines that provide information about slow
statements. See
<a class="xref" href="slow-query-log.html" title="7.4.5 The Slow Query Log">
Section 7.4.5, “The Slow Query Log”
</a>
.
<code class="literal">
TABLE
</code>
output is unaffected.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_log_timestamps">
</a>
<a class="link" href="server-system-variables.html#sysvar_log_timestamps">
<code class="literal">
log_timestamps
</code>
</a>
</p>
<a class="indexterm" name="idm46045273919360">
</a>
<a class="indexterm" name="idm46045273918272">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for log_timestamps">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--log-timestamps=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_log_timestamps">
log_timestamps
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
UTC
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
UTC
</code>
</p>
<p class="valid-value">
<code class="literal">
SYSTEM
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls the time zone of timestamps in messages
written to the error log, and in general query log and slow
query log messages written to files. It does not affect the
time zone of general query log and slow query log messages
written to tables (
<code class="literal">
mysql.general_log
</code>
,
<code class="literal">
mysql.slow_log
</code>
). Rows retrieved from those
tables can be converted from the local system time zone to any
desired time zone with
<a class="link" href="date-and-time-functions.html#function_convert-tz">
<code class="literal">
CONVERT_TZ()
</code>
</a>
or by setting the
session
<a class="link" href="server-system-variables.html#sysvar_time_zone">
<code class="literal">
time_zone
</code>
</a>
system
variable.
</p>
<p>
Permitted
<a class="link" href="server-system-variables.html#sysvar_log_timestamps">
<code class="literal">
log_timestamps
</code>
</a>
values are
<code class="literal">
UTC
</code>
(the default) and
<code class="literal">
SYSTEM
</code>
(the local system time zone).
</p>
<p>
Timestamps are written using ISO 8601 / RFC 3339 format:
<code class="literal">
<em class="replaceable">
<code>
YYYY-MM-DD
</code>
</em>
T
<em class="replaceable">
<code>
hh:mm:ss.uuuuuu
</code>
</em>
</code>
plus a tail value of
<code class="literal">
Z
</code>
signifying Zulu time
(UTC) or
<code class="literal">
±hh:mm
</code>
(an offset from
UTC).
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_log_throttle_queries_not_using_indexes">
</a>
<a class="link" href="server-system-variables.html#sysvar_log_throttle_queries_not_using_indexes">
<code class="literal">
log_throttle_queries_not_using_indexes
</code>
</a>
</p>
<a class="indexterm" name="idm46045273878976">
</a>
<a class="indexterm" name="idm46045273877936">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for log_throttle_queries_not_using_indexes">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--log-throttle-queries-not-using-indexes=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_log_throttle_queries_not_using_indexes">
log_throttle_queries_not_using_indexes
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If
<a class="link" href="server-system-variables.html#sysvar_log_queries_not_using_indexes">
<code class="literal">
log_queries_not_using_indexes
</code>
</a>
is enabled, the
<a class="link" href="server-system-variables.html#sysvar_log_throttle_queries_not_using_indexes">
<code class="literal">
log_throttle_queries_not_using_indexes
</code>
</a>
variable limits the number of such queries per minute that can
be written to the slow query log. A value of 0 (the default)
means
<span class="quote">
“
<span class="quote">
no limit
</span>
”
</span>
. For more information, see
<a class="xref" href="slow-query-log.html" title="7.4.5 The Slow Query Log">
Section 7.4.5, “The Slow Query Log”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_long_query_time">
</a>
<a class="link" href="server-system-variables.html#sysvar_long_query_time">
<code class="literal">
long_query_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045273844688">
</a>
<a class="indexterm" name="idm46045273843600">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for long_query_time">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--long-query-time=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_long_query_time">
long_query_time
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Numeric
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
10
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
If a query takes longer than this many seconds, the server
increments the
<a class="link" href="server-status-variables.html#statvar_Slow_queries">
<code class="literal">
Slow_queries
</code>
</a>
status variable. If the slow query log is enabled, the query
is logged to the slow query log file. This value is measured
in real time, not CPU time, so a query that is under the
threshold on a lightly loaded system might be above the
threshold on a heavily loaded one. The minimum and default
values of
<a class="link" href="server-system-variables.html#sysvar_long_query_time">
<code class="literal">
long_query_time
</code>
</a>
are 0 and 10, respectively. The maximum is 31536000, which is
365 days in seconds. The value can be specified to a
resolution of microseconds. See
<a class="xref" href="slow-query-log.html" title="7.4.5 The Slow Query Log">
Section 7.4.5, “The Slow Query Log”
</a>
.
</p>
<p>
Smaller values of this variable result in more statements
being considered long-running, with the result that more space
is required for the slow query log. For very small values
(less than one second), the log may grow quite large in a
small time. Increasing the number of statements considered
long-running may also result in false positives for the
<span class="quote">
“
<span class="quote">
excessive Number of Long Running Processes
</span>
”
</span>
alert in MySQL Enterprise Monitor, especially if Group Replication is enabled.
For these reasons, very small values should be used in test
environments only, or, in production environments, only for a
short period.
</p>
<p>
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
performs a full table scan, which
means its queries can often exceed a
<a class="link" href="server-system-variables.html#sysvar_long_query_time">
<code class="literal">
long_query_time
</code>
</a>
setting that
is useful for regular queries. If you want to exclude most or
all of the queries generated by
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
from the slow query log, you can use
<a class="link" href="mysqldump.html#option_mysqldump_mysqld-long-query-time">
<code class="option">
--mysqld-long-query-time
</code>
</a>
to
change the session value of the system variable to a higher
value.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_low_priority_updates">
</a>
<a class="link" href="server-system-variables.html#sysvar_low_priority_updates">
<code class="literal">
low_priority_updates
</code>
</a>
</p>
<a class="indexterm" name="idm46045273801472">
</a>
<a class="indexterm" name="idm46045273800432">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for low_priority_updates">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--low-priority-updates[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_low_priority_updates">
low_priority_updates
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If set to
<code class="literal">
1
</code>
, all
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
,
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
,
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
, and
<code class="literal">
LOCK TABLE
WRITE
</code>
statements wait until there is no pending
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
or
<code class="literal">
LOCK TABLE
READ
</code>
on the affected table. The same effect can be
obtained using
<code class="literal">
{INSERT | REPLACE | DELETE | UPDATE}
LOW_PRIORITY ...
</code>
to lower the priority of only one
query. This variable affects only storage engines that use
only table-level locking (such as
<code class="literal">
MyISAM
</code>
,
<code class="literal">
MEMORY
</code>
, and
<code class="literal">
MERGE
</code>
). See
<a class="xref" href="table-locking.html" title="10.11.2 Table Locking Issues">
Section 10.11.2, “Table Locking Issues”
</a>
.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_lower_case_file_system">
</a>
<a class="link" href="server-system-variables.html#sysvar_lower_case_file_system">
<code class="literal">
lower_case_file_system
</code>
</a>
</p>
<a class="indexterm" name="idm46045273763536">
</a>
<a class="indexterm" name="idm46045273762496">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for lower_case_file_system">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_lower_case_file_system">
lower_case_file_system
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable describes the case sensitivity of file names on
the file system where the data directory is located.
<code class="literal">
OFF
</code>
means file names are case-sensitive,
<code class="literal">
ON
</code>
means they are not case-sensitive. This
variable is read only because it reflects a file system
attribute and setting it would have no effect on the file
system.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_lower_case_table_names">
</a>
<a class="link" href="server-system-variables.html#sysvar_lower_case_table_names">
<code class="literal">
lower_case_table_names
</code>
</a>
</p>
<a class="indexterm" name="idm46045273741088">
</a>
<a class="indexterm" name="idm46045273740048">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for lower_case_table_names">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--lower-case-table-names[=#]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_lower_case_table_names">
lower_case_table_names
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value (macOS)
</th>
<td>
<code class="literal">
2
</code>
</td>
</tr>
<tr>
<th>
Default Value (Unix)
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Default Value (Windows)
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If set to 0, table names are stored as specified and
comparisons are case-sensitive. If set to 1, table names are
stored in lowercase on disk and comparisons are not
case-sensitive. If set to 2, table names are stored as given
but compared in lowercase. This option also applies to
database names and table aliases. For additional details, see
<a class="xref" href="identifier-case-sensitivity.html" title="11.2.3 Identifier Case Sensitivity">
Section 11.2.3, “Identifier Case Sensitivity”
</a>
.
</p>
<p>
The default value of this variable is platform-dependent (see
<a class="link" href="server-system-variables.html#sysvar_lower_case_file_system">
<code class="literal">
lower_case_file_system
</code>
</a>
). On
Linux and other Unix-like systems, the default is
<code class="literal">
0
</code>
. On Windows the default value is
<code class="literal">
1
</code>
. On macOS, the default value is
<code class="literal">
2
</code>
. On Linux (and other Unix-like systems),
setting the value to
<code class="literal">
2
</code>
is not supported;
the server forces the value to
<code class="literal">
0
</code>
instead.
</p>
<p>
You should
<span class="emphasis">
<em>
not
</em>
</span>
set
<a class="link" href="server-system-variables.html#sysvar_lower_case_table_names">
<code class="literal">
lower_case_table_names
</code>
</a>
to 0
if you are running MySQL on a system where the data directory
resides on a case-insensitive file system (such as on Windows
or macOS). It is an unsupported combination that could result
in a hang condition when running an
<code class="literal">
INSERT INTO ...
SELECT ... FROM
<em class="replaceable">
<code>
tbl_name
</code>
</em>
</code>
operation with the wrong
<em class="replaceable">
<code>
tbl_name
</code>
</em>
lettercase. With
<code class="literal">
MyISAM
</code>
, accessing table
names using different lettercases could cause index
corruption.
</p>
<p>
An error message is printed and the server exits if you
attempt to start the server with
<a class="link" href="server-system-variables.html#sysvar_lower_case_table_names">
<code class="literal">
--lower_case_table_names=0
</code>
</a>
on
a case-insensitive file system.
</p>
<p>
The setting of this variable affects the behavior of
replication filtering options with regard to case sensitivity.
For more information, see
<a class="xref" href="replication-rules.html" title="19.2.5 How Servers Evaluate Replication Filtering Rules">
Section 19.2.5, “How Servers Evaluate Replication Filtering Rules”
</a>
.
</p>
<p>
It is prohibited to start the server with a
<a class="link" href="server-system-variables.html#sysvar_lower_case_table_names">
<code class="literal">
lower_case_table_names
</code>
</a>
setting that is different from the setting used when the
server was initialized. The restriction is necessary because
collations used by various data dictionary table fields are
determined by the setting defined when the server is
initialized, and restarting the server with a different
setting would introduce inconsistencies with respect to how
identifiers are ordered and compared.
</p>
<p>
It is therefore necessary to configure
<a class="link" href="server-system-variables.html#sysvar_lower_case_table_names">
<code class="literal">
lower_case_table_names
</code>
</a>
to the
desired setting before initializing the server. In most cases,
this requires configuring
<a class="link" href="server-system-variables.html#sysvar_lower_case_table_names">
<code class="literal">
lower_case_table_names
</code>
</a>
in a
MySQL option file before starting the MySQL server for the
first time. For APT installations on Debian and Ubuntu,
however, the server is initialized for you, and there is no
opportunity to configure the setting in an option file
beforehand. You must therefore use the
<code class="literal">
debconf-set-selection
</code>
utility prior to
installing MySQL using APT to enable
<a class="link" href="server-system-variables.html#sysvar_lower_case_table_names">
<code class="literal">
lower_case_table_names
</code>
</a>
. To do
so, run this command before installing MySQL using APT:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa31925790"><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 operator">></span> sudo debconf<span class="token operator">-</span><span class="token keyword">set</span><span class="token operator">-</span>selections <span class="token operator"><<</span><span class="token operator"><</span> <span class="token string">"mysql-server mysql-server/lowercase-table-names select Enabled"</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_mandatory_roles">
</a>
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
<code class="literal">
mandatory_roles
</code>
</a>
</p>
<a class="indexterm" name="idm46045273681888">
</a>
<a class="indexterm" name="idm46045273680800">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for mandatory_roles">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--mandatory-roles=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
mandatory_roles
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
empty string
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Roles the server should treat as mandatory. In effect, these
roles are automatically granted to every user, although
setting
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
<code class="literal">
mandatory_roles
</code>
</a>
does
not actually change any user accounts, and the granted roles
are not visible in the
<code class="literal">
mysql.role_edges
</code>
system table.
</p>
<p>
The variable value is a comma-separated list of role names.
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa47274739"><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> mandatory_roles <span class="token operator">=</span> <span class="token string">'`role1`@`%`,`role2`,role3,role4@localhost'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Setting the runtime value of
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
<code class="literal">
mandatory_roles
</code>
</a>
requires the
<a class="link" href="privileges-provided.html#priv_role-admin">
<code class="literal">
ROLE_ADMIN
</code>
</a>
privilege, in
addition to the
<a class="link" href="privileges-provided.html#priv_system-variables-admin">
<code class="literal">
SYSTEM_VARIABLES_ADMIN
</code>
</a>
privilege (or the deprecated
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege) normally
required to set a global system variable runtime value.
</p>
<p>
Role names consist of a user part and host part in
<code class="literal">
<em class="replaceable">
<code>
user_name
</code>
</em>
@
<em class="replaceable">
<code>
host_name
</code>
</em>
</code>
format. The host part, if omitted, defaults to
<code class="literal">
%
</code>
. For additional information, see
<a class="xref" href="role-names.html" title="8.2.5 Specifying Role Names">
Section 8.2.5, “Specifying Role Names”
</a>
.
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
<code class="literal">
mandatory_roles
</code>
</a>
value is
a string, so user names and host names, if quoted, must be
written in a fashion permitted for quoting within quoted
strings.
</p>
<p>
Roles named in the value of
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
<code class="literal">
mandatory_roles
</code>
</a>
cannot be
revoked with
<a class="link" href="revoke.html" title="15.7.1.8 REVOKE Statement">
<code class="literal">
REVOKE
</code>
</a>
or dropped
with
<a class="link" href="drop-role.html" title="15.7.1.4 DROP ROLE Statement">
<code class="literal">
DROP ROLE
</code>
</a>
or
<a class="link" href="drop-user.html" title="15.7.1.5 DROP USER Statement">
<code class="literal">
DROP USER
</code>
</a>
.
</p>
<p>
To prevent sessions from being made system sessions by
default, a role that has the
<a class="link" href="privileges-provided.html#priv_system-user">
<code class="literal">
SYSTEM_USER
</code>
</a>
privilege cannot be
listed in the value of the
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
<code class="literal">
mandatory_roles
</code>
</a>
system
variable:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
<code class="literal">
mandatory_roles
</code>
</a>
is
assigned a role at startup that has the
<a class="link" href="privileges-provided.html#priv_system-user">
<code class="literal">
SYSTEM_USER
</code>
</a>
privilege, the
server writes a message to the error log and exits.
</p>
</li>
<li class="listitem">
<p>
If
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
<code class="literal">
mandatory_roles
</code>
</a>
is
assigned a role at runtime that has the
<a class="link" href="privileges-provided.html#priv_system-user">
<code class="literal">
SYSTEM_USER
</code>
</a>
privilege, an
error occurs and the
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
<code class="literal">
mandatory_roles
</code>
</a>
value
remains unchanged.
</p>
</li>
</ul>
</div>
<p>
Mandatory roles, like explicitly granted roles, do not take
effect until activated (see
<a class="xref" href="roles.html#roles-activating" title="Activating Roles">
Activating Roles
</a>
). At login time, role
activation occurs for all granted roles if the
<a class="link" href="server-system-variables.html#sysvar_activate_all_roles_on_login">
<code class="literal">
activate_all_roles_on_login
</code>
</a>
system variable is enabled; otherwise, or for roles that are
set as default roles otherwise. At runtime,
<a class="link" href="set-role.html" title="15.7.1.11 SET ROLE Statement">
<code class="literal">
SET ROLE
</code>
</a>
activates roles.
</p>
<p>
Roles that do not exist when assigned to
<a class="link" href="server-system-variables.html#sysvar_mandatory_roles">
<code class="literal">
mandatory_roles
</code>
</a>
but are
created later may require special treatment to be considered
mandatory. For details, see
<a class="xref" href="roles.html#mandatory-roles" title="Defining Mandatory Roles">
Defining Mandatory Roles
</a>
.
</p>
<p>
<a class="link" href="show-grants.html" title="15.7.7.22 SHOW GRANTS Statement">
<code class="literal">
SHOW GRANTS
</code>
</a>
displays mandatory
roles according to the rules described in
<a class="xref" href="show-grants.html" title="15.7.7.22 SHOW GRANTS Statement">
Section 15.7.7.22, “SHOW GRANTS Statement”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_allowed_packet">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_allowed_packet">
<code class="literal">
max_allowed_packet
</code>
</a>
</p>
<a class="indexterm" name="idm46045273615568">
</a>
<a class="indexterm" name="idm46045273614528">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_allowed_packet">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-allowed-packet=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_allowed_packet">
max_allowed_packet
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
67108864
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
1073741824
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum size of one packet or any generated/intermediate
string, or any parameter sent by the
<a class="ulink" href="/doc/c-api/8.4/en/mysql-stmt-send-long-data.html" target="_top">
<code class="literal">
mysql_stmt_send_long_data()
</code>
</a>
C
API function. The default is 64MB.
</p>
<p>
The packet message buffer is initialized to
<a class="link" href="server-system-variables.html#sysvar_net_buffer_length">
<code class="literal">
net_buffer_length
</code>
</a>
bytes, but
can grow up to
<a class="link" href="server-system-variables.html#sysvar_max_allowed_packet">
<code class="literal">
max_allowed_packet
</code>
</a>
bytes when
needed. This value by default is small, to catch large
(possibly incorrect) packets.
</p>
<p>
You must increase this value if you are using large
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
BLOB
</code>
</a>
columns or long strings.
It should be as big as the largest
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
BLOB
</code>
</a>
you want to use. The
protocol limit for
<a class="link" href="server-system-variables.html#sysvar_max_allowed_packet">
<code class="literal">
max_allowed_packet
</code>
</a>
is 1GB.
The value should be a multiple of 1024; nonmultiples are
rounded down to the nearest multiple.
</p>
<p>
When you change the message buffer size by changing the value
of the
<a class="link" href="server-system-variables.html#sysvar_max_allowed_packet">
<code class="literal">
max_allowed_packet
</code>
</a>
variable, you should also change the buffer size on the client
side if your client program permits it. The default
<a class="link" href="server-system-variables.html#sysvar_max_allowed_packet">
<code class="literal">
max_allowed_packet
</code>
</a>
value
built in to the client library is 1GB, but individual client
programs might override this. For example,
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
and
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
have
defaults of 16MB and 24MB, respectively. They also enable you
to change the client-side value by setting
<a class="link" href="server-system-variables.html#sysvar_max_allowed_packet">
<code class="literal">
max_allowed_packet
</code>
</a>
on the
command line or in an option file.
</p>
<p>
The session value of this variable is read only. The client
can receive up to as many bytes as the session value. However,
the server does not send to the client more bytes than the
current global
<a class="link" href="server-system-variables.html#sysvar_max_allowed_packet">
<code class="literal">
max_allowed_packet
</code>
</a>
value.
(The global value could be less than the session value if the
global value is changed after the client connects.)
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_connect_errors">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_connect_errors">
<code class="literal">
max_connect_errors
</code>
</a>
</p>
<a class="indexterm" name="idm46045273561936">
</a>
<a class="indexterm" name="idm46045273560896">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_connect_errors">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-connect-errors=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_connect_errors">
max_connect_errors
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
100
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
After
<a class="link" href="server-system-variables.html#sysvar_max_connect_errors">
<code class="literal">
max_connect_errors
</code>
</a>
successive connection requests from a host are interrupted
without a successful connection, the server blocks that host
from further connections. If a connection from a host is
established successfully within fewer than
<a class="link" href="server-system-variables.html#sysvar_max_connect_errors">
<code class="literal">
max_connect_errors
</code>
</a>
attempts
after a previous connection was interrupted, the error count
for the host is cleared to zero. To unblock blocked hosts,
flush the host cache; see
<a class="xref" href="host-cache.html#host-cache-flushing" title="Flushing the Host Cache">
Flushing the Host Cache
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_connections">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_connections">
<code class="literal">
max_connections
</code>
</a>
</p>
<a class="indexterm" name="idm46045273525440">
</a>
<a class="indexterm" name="idm46045273524352">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_connections">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-connections=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_connections">
max_connections
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
151
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
100000
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum permitted number of simultaneous client
connections. The maximum effective value is the lesser of the
effective value of
<a class="link" href="server-system-variables.html#sysvar_open_files_limit">
<code class="literal">
open_files_limit
</code>
</a>
<code class="literal">
-
810
</code>
, and the value actually set for
<code class="literal">
max_connections
</code>
.
</p>
<p>
For more information, see
<a class="xref" href="connection-interfaces.html" title="7.1.12.1 Connection Interfaces">
Section 7.1.12.1, “Connection Interfaces”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_delayed_threads">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_delayed_threads">
<code class="literal">
max_delayed_threads
</code>
</a>
</p>
<a class="indexterm" name="idm46045273491104">
</a>
<a class="indexterm" name="idm46045273490064">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_delayed_threads">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-delayed-threads=#
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_delayed_threads">
max_delayed_threads
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
20
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
16384
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This system variable is deprecated (because
<code class="literal">
DELAYED
</code>
inserts are not supported) and
subject to removal in a future MySQL release.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_digest_length">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_digest_length">
<code class="literal">
max_digest_length
</code>
</a>
</p>
<a class="indexterm" name="idm46045273456544">
</a>
<a class="indexterm" name="idm46045273455504">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_digest_length">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-digest-length=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_digest_length">
max_digest_length
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
1048576
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum number of bytes of memory reserved per session for
computation of normalized statement digests. Once that amount
of space is used during digest computation, truncation occurs:
no further tokens from a parsed statement are collected or
figure into its digest value. Statements that differ only
after that many bytes of parsed tokens produce the same
normalized statement digest and are considered identical if
compared or if aggregated for digest statistics.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Warning
</div>
<p>
Setting
<a class="link" href="server-system-variables.html#sysvar_max_digest_length">
<code class="literal">
max_digest_length
</code>
</a>
to zero disables digest production, which also disables
server functionality that requires digests, such as MySQL Enterprise Firewall.
</p>
</div>
<p>
Decreasing the
<a class="link" href="server-system-variables.html#sysvar_max_digest_length">
<code class="literal">
max_digest_length
</code>
</a>
value
reduces memory use but causes the digest value of more
statements to become indistinguishable if they differ only at
the end. Increasing the value permits longer statements to be
distinguished but increases memory use, particularly for
workloads that involve large numbers of simultaneous sessions
(the server allocates
<a class="link" href="server-system-variables.html#sysvar_max_digest_length">
<code class="literal">
max_digest_length
</code>
</a>
bytes per
session).
</p>
<p>
The parser uses this system variable as a limit on the maximum
length of normalized statement digests that it computes. The
Performance Schema, if it tracks statement digests, makes a
copy of the digest value, using the
<a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_max_digest_length">
<code class="literal">
performance_schema_max_digest_length
</code>
</a>
.
system variable as a limit on the maximum length of digests
that it stores. Consequently, if
<a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_max_digest_length">
<code class="literal">
performance_schema_max_digest_length
</code>
</a>
is less than
<a class="link" href="server-system-variables.html#sysvar_max_digest_length">
<code class="literal">
max_digest_length
</code>
</a>
, digest
values stored in the Performance Schema are truncated relative
to the original digest values.
</p>
<p>
For more information about statement digesting, see
<a class="xref" href="performance-schema-statement-digests.html" title="29.10 Performance Schema Statement Digests and Sampling">
Section 29.10, “Performance Schema Statement Digests and Sampling”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_error_count">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_error_count">
<code class="literal">
max_error_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045273411408">
</a>
<a class="indexterm" name="idm46045273410320">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_error_count">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-error-count=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_error_count">
max_error_count
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
65535
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum number of error, warning, and information messages
to be stored for display by the
<a class="link" href="show-errors.html" title="15.7.7.18 SHOW ERRORS Statement">
<code class="literal">
SHOW
ERRORS
</code>
</a>
and
<a class="link" href="show-warnings.html" title="15.7.7.42 SHOW WARNINGS Statement">
<code class="literal">
SHOW
WARNINGS
</code>
</a>
statements. This is the same as the number
of condition areas in the diagnostics area, and thus the
number of conditions that can be inspected by
<a class="link" href="get-diagnostics.html" title="15.6.7.3 GET DIAGNOSTICS Statement">
<code class="literal">
GET DIAGNOSTICS
</code>
</a>
.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_execution_time">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_execution_time">
<code class="literal">
max_execution_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045273375536">
</a>
<a class="indexterm" name="idm46045273374496">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_execution_time">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-execution-time=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_execution_time">
max_execution_time
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
milliseconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
The execution timeout for
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements, in
milliseconds. If the value is 0, timeouts are not enabled.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_max_execution_time">
<code class="literal">
max_execution_time
</code>
</a>
applies as
follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
The global
<a class="link" href="server-system-variables.html#sysvar_max_execution_time">
<code class="literal">
max_execution_time
</code>
</a>
value
provides the default for the session value for new
connections. The session value applies to
<code class="literal">
SELECT
</code>
executions executed within the
session that include no
<a class="link" href="optimizer-hints.html#optimizer-hints-execution-time" title="Statement Execution Time Optimizer Hints">
<code class="literal">
MAX_EXECUTION_TIME(
<em class="replaceable">
<code>
N
</code>
</em>
)
</code>
</a>
optimizer hint or for which
<em class="replaceable">
<code>
N
</code>
</em>
is 0.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="server-system-variables.html#sysvar_max_execution_time">
<code class="literal">
max_execution_time
</code>
</a>
applies to read-only
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements. Statements that are not read only are those
that invoke a stored function that modifies data as a side
effect.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="server-system-variables.html#sysvar_max_execution_time">
<code class="literal">
max_execution_time
</code>
</a>
is
ignored for
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements in stored programs.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_heap_table_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_heap_table_size">
<code class="literal">
max_heap_table_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045273327760">
</a>
<a class="indexterm" name="idm46045273326720">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_heap_table_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-heap-table-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_heap_table_size">
max_heap_table_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
16777216
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
16384
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709550592
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294966272
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable sets the maximum size to which user-created
<code class="literal">
MEMORY
</code>
tables are permitted to grow. The
value of the variable is used to calculate
<code class="literal">
MEMORY
</code>
table
<code class="literal">
MAX_ROWS
</code>
values.
</p>
<p>
Setting this variable has no effect on any existing
<code class="literal">
MEMORY
</code>
table, unless the table is
re-created with a statement such as
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
</code>
</a>
or altered with
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
or
<a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
<code class="literal">
TRUNCATE TABLE
</code>
</a>
. A server
restart also sets the maximum size of existing
<code class="literal">
MEMORY
</code>
tables to the global
<a class="link" href="server-system-variables.html#sysvar_max_heap_table_size">
<code class="literal">
max_heap_table_size
</code>
</a>
value.
</p>
<p>
This variable is also used in conjunction with
<a class="link" href="server-system-variables.html#sysvar_tmp_table_size">
<code class="literal">
tmp_table_size
</code>
</a>
to limit the
size of internal in-memory tables. See
<a class="xref" href="internal-temporary-tables.html" title="10.4.4 Internal Temporary Table Use in MySQL">
Section 10.4.4, “Internal Temporary Table Use in MySQL”
</a>
.
</p>
<p>
<code class="literal">
max_heap_table_size
</code>
is not replicated. See
<a class="xref" href="replication-features-memory.html" title="19.5.1.21 Replication and MEMORY Tables">
Section 19.5.1.21, “Replication and MEMORY Tables”
</a>
, and
<a class="xref" href="replication-features-variables.html" title="19.5.1.39 Replication and Variables">
Section 19.5.1.39, “Replication and Variables”
</a>
, for more
information.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_insert_delayed_threads">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_insert_delayed_threads">
<code class="literal">
max_insert_delayed_threads
</code>
</a>
</p>
<a class="indexterm" name="idm46045273275072">
</a>
<a class="indexterm" name="idm46045273273968">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_insert_delayed_threads">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_insert_delayed_threads">
max_insert_delayed_threads
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
20
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
16384
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable is a synonym for
<a class="link" href="server-system-variables.html#sysvar_max_delayed_threads">
<code class="literal">
max_delayed_threads
</code>
</a>
. Like
<a class="link" href="server-system-variables.html#sysvar_max_delayed_threads">
<code class="literal">
max_delayed_threads
</code>
</a>
, it is
deprecated (because
<code class="literal">
DELAYED
</code>
inserts are not
supported) and subject to removal in a future MySQL release.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_join_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_join_size">
<code class="literal">
max_join_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045273240432">
</a>
<a class="indexterm" name="idm46045273239344">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_join_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-join-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_join_size">
max_join_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This represents a limit on the maximum number of row accesses
in base tables made by a join. If the server's estimate
indicates that a greater number of rows than
<code class="literal">
max_join_size
</code>
must be read from the base
tables, the statement is rejected with an error.
</p>
<p>
Setting this variable to a value other than
<code class="literal">
DEFAULT
</code>
resets the value of
<a class="link" href="server-system-variables.html#sysvar_sql_big_selects">
<code class="literal">
sql_big_selects
</code>
</a>
to
<code class="literal">
0
</code>
. If you set the
<code class="literal">
sql_big_selects
</code>
value again, the
<code class="literal">
max_join_size
</code>
variable is ignored.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_length_for_sort_data">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_length_for_sort_data">
<code class="literal">
max_length_for_sort_data
</code>
</a>
</p>
<a class="indexterm" name="idm46045273204368">
</a>
<a class="indexterm" name="idm46045273203264">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_length_for_sort_data">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-length-for-sort-data=#
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_length_for_sort_data">
max_length_for_sort_data
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
4096
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
4
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
8388608
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable is deprecated, and has no effect in MySQL
8.4.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_points_in_geometry">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_points_in_geometry">
<code class="literal">
max_points_in_geometry
</code>
</a>
</p>
<a class="indexterm" name="idm46045273169632">
</a>
<a class="indexterm" name="idm46045273168592">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_points_in_geometry">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-points-in-geometry=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_points_in_geometry">
max_points_in_geometry
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
65536
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
3
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
1048576
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum value of the
<em class="replaceable">
<code>
points_per_circle
</code>
</em>
argument to the
<a class="link" href="spatial-operator-functions.html#function_st-buffer-strategy">
<code class="literal">
ST_Buffer_Strategy()
</code>
</a>
function.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_prepared_stmt_count">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_prepared_stmt_count">
<code class="literal">
max_prepared_stmt_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045273137328">
</a>
<a class="indexterm" name="idm46045273136288">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_prepared_stmt_count">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-prepared-stmt-count=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_prepared_stmt_count">
max_prepared_stmt_count
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
16382
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4194304
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable limits the total number of prepared statements
in the server. It can be used in environments where there is
the potential for denial-of-service attacks based on running
the server out of memory by preparing huge numbers of
statements. If the value is set lower than the current number
of prepared statements, existing statements are not affected
and can be used, but no new statements can be prepared until
the current number drops below the limit. Setting the value to
0 disables prepared statements.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_seeks_for_key">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_seeks_for_key">
<code class="literal">
max_seeks_for_key
</code>
</a>
</p>
<a class="indexterm" name="idm46045273106240">
</a>
<a class="indexterm" name="idm46045273105200">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_seeks_for_key">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-seeks-for-key=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_seeks_for_key">
max_seeks_for_key
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value (Windows)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Default Value (Other, 64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Default Value (Other, 32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Windows)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Other, 64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Other, 32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Limit the assumed maximum number of seeks when looking up rows
based on a key. The MySQL optimizer assumes that no more than
this number of key seeks are required when searching for
matching rows in a table by scanning an index, regardless of
the actual cardinality of the index (see
<a class="xref" href="show-index.html" title="15.7.7.23 SHOW INDEX Statement">
Section 15.7.7.23, “SHOW INDEX Statement”
</a>
). By setting this to a low value
(say, 100), you can force MySQL to prefer indexes instead of
table scans.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_sort_length">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_sort_length">
<code class="literal">
max_sort_length
</code>
</a>
</p>
<a class="indexterm" name="idm46045273064944">
</a>
<a class="indexterm" name="idm46045273063856">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_sort_length">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-sort-length=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_sort_length">
max_sort_length
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
4
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
8388608
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of bytes to use when sorting string values which
use
<code class="literal">
PAD SPACE
</code>
collations. The server uses
only the first
<a class="link" href="server-system-variables.html#sysvar_max_sort_length">
<code class="literal">
max_sort_length
</code>
</a>
bytes of any
such value and ignores the rest. Consequently, such values
that differ only after the first
<a class="link" href="server-system-variables.html#sysvar_max_sort_length">
<code class="literal">
max_sort_length
</code>
</a>
bytes compare
as equal for
<code class="literal">
GROUP BY
</code>
,
<code class="literal">
ORDER
BY
</code>
, and
<code class="literal">
DISTINCT
</code>
operations.
(This behavior differs from previous versions of MySQL, where
this setting was applied to all values used in comparisons.)
</p>
<p>
Increasing the value of
<a class="link" href="server-system-variables.html#sysvar_max_sort_length">
<code class="literal">
max_sort_length
</code>
</a>
may require
increasing the value of
<a class="link" href="server-system-variables.html#sysvar_sort_buffer_size">
<code class="literal">
sort_buffer_size
</code>
</a>
as well. For
details, see
<a class="xref" href="order-by-optimization.html" title="10.2.1.16 ORDER BY Optimization">
Section 10.2.1.16, “ORDER BY Optimization”
</a>
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_sp_recursion_depth">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_sp_recursion_depth">
<code class="literal">
max_sp_recursion_depth
</code>
</a>
</p>
<a class="indexterm" name="idm46045273022896">
</a>
<a class="indexterm" name="idm46045273021856">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_sp_recursion_depth">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-sp-recursion-depth[=#]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_sp_recursion_depth">
max_sp_recursion_depth
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
255
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of times that any given stored procedure may be
called recursively. The default value for this option is 0,
which completely disables recursion in stored procedures. The
maximum value is 255.
</p>
<p>
Stored procedure recursion increases the demand on thread
stack space. If you increase the value of
<a class="link" href="server-system-variables.html#sysvar_max_sp_recursion_depth">
<code class="literal">
max_sp_recursion_depth
</code>
</a>
, it
may be necessary to increase thread stack size by increasing
the value of
<a class="link" href="server-system-variables.html#sysvar_thread_stack">
<code class="literal">
thread_stack
</code>
</a>
at
server startup.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_user_connections">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_user_connections">
<code class="literal">
max_user_connections
</code>
</a>
</p>
<a class="indexterm" name="idm46045272989104">
</a>
<a class="indexterm" name="idm46045272988064">
</a>
<a class="indexterm" name="idm46045272986576">
</a>
<a class="indexterm" name="idm46045272985088">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_user_connections">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-user-connections=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_user_connections">
max_user_connections
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum number of simultaneous connections permitted to
any given MySQL user account. A value of 0 (the default) means
<span class="quote">
“
<span class="quote">
no limit.
</span>
”
</span>
</p>
<p>
This variable has a global value that can be set at server
startup or runtime. It also has a read-only session value that
indicates the effective simultaneous-connection limit that
applies to the account associated with the current session.
The session value is initialized as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If the user account has a nonzero
<code class="literal">
MAX_USER_CONNECTIONS
</code>
resource limit,
the session
<a class="link" href="server-system-variables.html#sysvar_max_user_connections">
<code class="literal">
max_user_connections
</code>
</a>
value is set to that limit.
</p>
</li>
<li class="listitem">
<p>
Otherwise, the session
<a class="link" href="server-system-variables.html#sysvar_max_user_connections">
<code class="literal">
max_user_connections
</code>
</a>
value is set to the global value.
</p>
</li>
</ul>
</div>
<p>
Account resource limits are specified using the
<a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
<code class="literal">
CREATE USER
</code>
</a>
or
<a class="link" href="alter-user.html" title="15.7.1.1 ALTER USER Statement">
<code class="literal">
ALTER USER
</code>
</a>
statement. See
<a class="xref" href="user-resources.html" title="8.2.21 Setting Account Resource Limits">
Section 8.2.21, “Setting Account Resource Limits”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_max_write_lock_count">
</a>
<a class="link" href="server-system-variables.html#sysvar_max_write_lock_count">
<code class="literal">
max_write_lock_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045272945120">
</a>
<a class="indexterm" name="idm46045272944080">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for max_write_lock_count">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--max-write-lock-count=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_max_write_lock_count">
max_write_lock_count
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value (Windows)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Default Value (Other, 64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Default Value (Other, 32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Windows)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Other, 64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Other, 32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
After this many write locks, permit some pending read lock
requests to be processed in between. Write lock requests have
higher priority than read lock requests. However, if
<a class="link" href="server-system-variables.html#sysvar_max_write_lock_count">
<code class="literal">
max_write_lock_count
</code>
</a>
is set
to some low value (say, 10), read lock requests may be
preferred over pending write lock requests if the read lock
requests have already been passed over in favor of 10 write
lock requests. Normally this behavior does not occur because
<a class="link" href="server-system-variables.html#sysvar_max_write_lock_count">
<code class="literal">
max_write_lock_count
</code>
</a>
by
default has a very large value.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_mecab_rc_file">
</a>
<a class="link" href="server-system-variables.html#sysvar_mecab_rc_file">
<code class="literal">
mecab_rc_file
</code>
</a>
</p>
<a class="indexterm" name="idm46045272901856">
</a>
<a class="indexterm" name="idm46045272900768">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for mecab_rc_file">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--mecab-rc-file=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_mecab_rc_file">
mecab_rc_file
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<code class="literal">
mecab_rc_file
</code>
option is used when
setting up the MeCab full-text parser.
</p>
<p>
The
<code class="literal">
mecab_rc_file
</code>
option defines the path
to the
<code class="filename">
mecabrc
</code>
configuration file, which
is the configuration file for MeCab. The option is read-only
and can only be set at startup. The
<code class="filename">
mecabrc
</code>
configuration file is required to
initialize MeCab.
</p>
<p>
For information about the MeCab full-text parser, see
<a class="xref" href="fulltext-search-mecab.html" title="14.9.9 MeCab Full-Text Parser Plugin">
Section 14.9.9, “MeCab Full-Text Parser Plugin”
</a>
.
</p>
<p>
For information about options that can be specified in the
MeCab
<code class="filename">
mecabrc
</code>
configuration file, refer
to the
<a class="ulink" href="http://mecab.googlecode.com/svn/trunk/mecab/doc/index.html" target="_blank">
MeCab
Documentation
</a>
on the
<a class="ulink" href="https://code.google.com/" target="_blank">
Google
Developers
</a>
site.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_min_examined_row_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_min_examined_row_limit">
<code class="literal">
min_examined_row_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045272871152">
</a>
<a class="indexterm" name="idm46045272870112">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for min_examined_row_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--min-examined-row-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_min_examined_row_limit">
min_examined_row_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Queries that examine fewer than this number of rows are not
logged to the slow query log.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_myisam_data_pointer_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_myisam_data_pointer_size">
<code class="literal">
myisam_data_pointer_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045272836832">
</a>
<a class="indexterm" name="idm46045272835728">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for myisam_data_pointer_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--myisam-data-pointer-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_myisam_data_pointer_size">
myisam_data_pointer_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
6
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
2
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
7
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The default pointer size in bytes, to be used by
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
</code>
</a>
for
<code class="literal">
MyISAM
</code>
tables when no
<code class="literal">
MAX_ROWS
</code>
option is specified. This variable
cannot be less than 2 or larger than 7. The default value is
6. See
<a class="xref" href="full-table.html" title="B.3.2.10 The table is full">
Section B.3.2.10, “The table is full”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_myisam_max_sort_file_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_myisam_max_sort_file_size">
<code class="literal">
myisam_max_sort_file_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045272800592">
</a>
<a class="indexterm" name="idm46045272799488">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for myisam_max_sort_file_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--myisam-max-sort-file-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_myisam_max_sort_file_size">
myisam_max_sort_file_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value (Windows)
</th>
<td>
<code class="literal">
2146435072
</code>
</td>
</tr>
<tr>
<th>
Default Value (Other, 64-bit platforms)
</th>
<td>
<code class="literal">
9223372036853727232
</code>
</td>
</tr>
<tr>
<th>
Default Value (Other, 32-bit platforms)
</th>
<td>
<code class="literal">
2147483648
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Windows)
</th>
<td>
<code class="literal">
2146435072
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Other, 64-bit platforms)
</th>
<td>
<code class="literal">
9223372036853727232
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Other, 32-bit platforms)
</th>
<td>
<code class="literal">
2147483648
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum size of the temporary file that MySQL is permitted
to use while re-creating a
<code class="literal">
MyISAM
</code>
index
(during
<a class="link" href="repair-table.html" title="15.7.3.5 REPAIR TABLE Statement">
<code class="literal">
REPAIR TABLE
</code>
</a>
,
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
, or
<a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
<code class="literal">
LOAD DATA
</code>
</a>
). If the file size
would be larger than this value, the index is created using
the key cache instead, which is slower. The value is given in
bytes.
</p>
<p>
If
<code class="literal">
MyISAM
</code>
index files exceed this size and
disk space is available, increasing the value may help
performance. The space must be available in the file system
containing the directory where the original index file is
located.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_myisam_mmap_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_myisam_mmap_size">
<code class="literal">
myisam_mmap_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045272752096">
</a>
<a class="indexterm" name="idm46045272751008">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for myisam_mmap_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--myisam-mmap-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_myisam_mmap_size">
myisam_mmap_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Default Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
7
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum amount of memory to use for memory mapping
compressed
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
files. If many
compressed
<code class="literal">
MyISAM
</code>
tables are used, the
value can be decreased to reduce the likelihood of
memory-swapping problems.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_myisam_recover_options">
</a>
<a class="link" href="server-system-variables.html#sysvar_myisam_recover_options">
<code class="literal">
myisam_recover_options
</code>
</a>
</p>
<a class="indexterm" name="idm46045272712512">
</a>
<a class="indexterm" name="idm46045272711472">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for myisam_recover_options">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--myisam-recover-options[=list]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_myisam_recover_options">
myisam_recover_options
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
OFF
</code>
</p>
<p class="valid-value">
<code class="literal">
DEFAULT
</code>
</p>
<p class="valid-value">
<code class="literal">
BACKUP
</code>
</p>
<p class="valid-value">
<code class="literal">
FORCE
</code>
</p>
<p class="valid-value">
<code class="literal">
QUICK
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Set the
<code class="literal">
MyISAM
</code>
storage engine recovery
mode. The variable value is any combination of the values of
<code class="literal">
OFF
</code>
,
<code class="literal">
DEFAULT
</code>
,
<code class="literal">
BACKUP
</code>
,
<code class="literal">
FORCE
</code>
, or
<code class="literal">
QUICK
</code>
. If you specify multiple values,
separate them by commas. Specifying the variable with no value
at server startup is the same as specifying
<code class="literal">
DEFAULT
</code>
, and specifying with an explicit
value of
<code class="literal">
""
</code>
disables recovery (same as a
value of
<code class="literal">
OFF
</code>
). If recovery is enabled, each
time
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
opens a
<code class="literal">
MyISAM
</code>
table, it checks whether the table
is marked as crashed or was not closed properly. (The last
option works only if you are running with external locking
disabled.) If this is the case,
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
runs
a check on the table. If the table was corrupted,
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
attempts to repair it.
</p>
<p>
The following options affect how the repair works.
</p>
<div class="informaltable">
<table summary="myisam_recover_options system variable values.">
<colgroup>
<col style="width: 15%"/>
<col style="width: 70%"/>
</colgroup>
<thead>
<tr>
<th>
Option
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="literal">
OFF
</code>
</td>
<td>
No recovery.
</td>
</tr>
<tr>
<td>
<code class="literal">
DEFAULT
</code>
</td>
<td>
Recovery without backup, forcing, or quick checking.
</td>
</tr>
<tr>
<td>
<code class="literal">
BACKUP
</code>
</td>
<td>
If the data file was changed during recovery, save a backup of the
<code class="filename">
<em class="replaceable">
<code>
tbl_name
</code>
</em>
.MYD
</code>
file as
<code class="filename">
<em class="replaceable">
<code>
tbl_name-datetime
</code>
</em>
.BAK
</code>
.
</td>
</tr>
<tr>
<td>
<code class="literal">
FORCE
</code>
</td>
<td>
Run recovery even if we would lose more than one row from the
<code class="filename">
.MYD
</code>
file.
</td>
</tr>
<tr>
<td>
<code class="literal">
QUICK
</code>
</td>
<td>
Do not check the rows in the table if there are not any delete blocks.
</td>
</tr>
</tbody>
</table>
</div>
<p>
Before the server automatically repairs a table, it writes a
note about the repair to the error log. If you want to be able
to recover from most problems without user intervention, you
should use the options
<code class="literal">
BACKUP,FORCE
</code>
. This
forces a repair of a table even if some rows would be deleted,
but it keeps the old data file as a backup so that you can
later examine what happened.
</p>
<p>
See
<a class="xref" href="myisam-start.html" title="18.2.1 MyISAM Startup Options">
Section 18.2.1, “MyISAM Startup Options”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_myisam_sort_buffer_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_myisam_sort_buffer_size">
<code class="literal">
myisam_sort_buffer_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045272644880">
</a>
<a class="indexterm" name="idm46045272643840">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for myisam_sort_buffer_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--myisam-sort-buffer-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_myisam_sort_buffer_size">
myisam_sort_buffer_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
8388608
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
4096
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The size of the buffer that is allocated when sorting
<code class="literal">
MyISAM
</code>
indexes during a
<a class="link" href="repair-table.html" title="15.7.3.5 REPAIR TABLE Statement">
<code class="literal">
REPAIR TABLE
</code>
</a>
or when creating
indexes with
<a class="link" href="create-index.html" title="15.1.15 CREATE INDEX Statement">
<code class="literal">
CREATE INDEX
</code>
</a>
or
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_myisam_stats_method">
</a>
<a class="link" href="server-system-variables.html#sysvar_myisam_stats_method">
<code class="literal">
myisam_stats_method
</code>
</a>
</p>
<a class="indexterm" name="idm46045272605360">
</a>
<a class="indexterm" name="idm46045272604320">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for myisam_stats_method">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--myisam-stats-method=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_myisam_stats_method">
myisam_stats_method
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
nulls_unequal
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
nulls_unequal
</code>
</p>
<p class="valid-value">
<code class="literal">
nulls_equal
</code>
</p>
<p class="valid-value">
<code class="literal">
nulls_ignored
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
How the server treats
<code class="literal">
NULL
</code>
values when
collecting statistics about the distribution of index values
for
<code class="literal">
MyISAM
</code>
tables. This variable has three
possible values,
<code class="literal">
nulls_equal
</code>
,
<code class="literal">
nulls_unequal
</code>
, and
<code class="literal">
nulls_ignored
</code>
. For
<code class="literal">
nulls_equal
</code>
, all
<code class="literal">
NULL
</code>
index values are considered equal and form a single value
group that has a size equal to the number of
<code class="literal">
NULL
</code>
values. For
<code class="literal">
nulls_unequal
</code>
,
<code class="literal">
NULL
</code>
values are considered unequal, and each
<code class="literal">
NULL
</code>
forms a distinct value group of size
1. For
<code class="literal">
nulls_ignored
</code>
,
<code class="literal">
NULL
</code>
values are ignored.
</p>
<p>
The method that is used for generating table statistics
influences how the optimizer chooses indexes for query
execution, as described in
<a class="xref" href="index-statistics.html" title="10.3.8 InnoDB and MyISAM Index Statistics Collection">
Section 10.3.8, “InnoDB and MyISAM Index Statistics Collection”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_myisam_use_mmap">
</a>
<a class="link" href="server-system-variables.html#sysvar_myisam_use_mmap">
<code class="literal">
myisam_use_mmap
</code>
</a>
</p>
<a class="indexterm" name="idm46045272564208">
</a>
<a class="indexterm" name="idm46045272563120">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for myisam_use_mmap">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--myisam-use-mmap[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_myisam_use_mmap">
myisam_use_mmap
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Use memory mapping for reading and writing
<code class="literal">
MyISAM
</code>
tables.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_mysql_native_password_proxy_users">
</a>
<a class="link" href="server-system-variables.html#sysvar_mysql_native_password_proxy_users">
<code class="literal">
mysql_native_password_proxy_users
</code>
</a>
</p>
<a class="indexterm" name="idm46045272537728">
</a>
<a class="indexterm" name="idm46045272536688">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for mysql_native_password_proxy_users">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--mysql-native-password-proxy-users[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_mysql_native_password_proxy_users">
mysql_native_password_proxy_users
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls whether the
<a class="link" href="native-pluggable-authentication.html" title="8.4.1.1 Native Pluggable Authentication">
<code class="literal">
mysql_native_password
</code>
</a>
built-in authentication plugin (deprecated) supports proxy
users. It has no effect unless the
<a class="link" href="server-system-variables.html#sysvar_check_proxy_users">
<code class="literal">
check_proxy_users
</code>
</a>
system
variable and the
<code class="literal">
mysql_native_password
</code>
plugin are enabled. For information about user proxying, see
<a class="xref" href="proxy-users.html" title="8.2.19 Proxy Users">
Section 8.2.19, “Proxy Users”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_named_pipe">
</a>
<a class="link" href="server-system-variables.html#sysvar_named_pipe">
<code class="literal">
named_pipe
</code>
</a>
</p>
<a class="indexterm" name="idm46045272505968">
</a>
<a class="indexterm" name="idm46045272504880">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for named_pipe">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--named-pipe[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_named_pipe">
named_pipe
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Platform Specific
</th>
<td>
Windows
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
(Windows only.) Indicates whether the server supports
connections over named pipes.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_named_pipe_full_access_group">
</a>
<a class="link" href="server-system-variables.html#sysvar_named_pipe_full_access_group">
<code class="literal">
named_pipe_full_access_group
</code>
</a>
</p>
<a class="indexterm" name="idm46045272478256">
</a>
<a class="indexterm" name="idm46045272477152">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for named_pipe_full_access_group">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--named-pipe-full-access-group=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_named_pipe_full_access_group">
named_pipe_full_access_group
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Platform Specific
</th>
<td>
Windows
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
empty string
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
empty string
</code>
</p>
<p class="valid-value">
<code class="literal">
valid Windows local group name
</code>
</p>
<p class="valid-value">
<code class="literal">
*everyone*
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
(Windows only.) The access control granted to clients on the
named pipe created by the MySQL server is set to the minimum
necessary for successful communication when the
<a class="link" href="server-system-variables.html#sysvar_named_pipe">
<code class="literal">
named_pipe
</code>
</a>
system variable is
enabled to support named-pipe connections. Some MySQL client
software can open named pipe connections without any
additional configuration; however, other client software may
still require full access to open a named pipe connection.
</p>
<p>
This variable sets the name of a Windows local group whose
members are granted sufficient access by the MySQL server to
use named-pipe clients. The default value is an empty string,
which means that no Windows user is granted full access to the
named pipe.
</p>
<p>
A new Windows local group name (for example,
<code class="literal">
mysql_access_client_users
</code>
) can be created
in Windows and then used to replace the default value when
access is absolutely necessary. In this case, limit the
membership of the group to as few users as possible, removing
users from the group when their client software is upgraded. A
non-member of the group who attempts to open a connection to
MySQL with the affected named-pipe client is denied access
until a Windows administrator adds the user to the group.
Newly added users must log out and log in again to join the
group (required by Windows).
</p>
<p>
Setting the value to
<code class="literal">
'*everyone*'
</code>
provides
a language-independent way of referring to the Everyone group
on Windows. The Everyone group is not secure by default.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_net_buffer_length">
</a>
<a class="link" href="server-system-variables.html#sysvar_net_buffer_length">
<code class="literal">
net_buffer_length
</code>
</a>
</p>
<a class="indexterm" name="idm46045272440144">
</a>
<a class="indexterm" name="idm46045272439104">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for net_buffer_length">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--net-buffer-length=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_net_buffer_length">
net_buffer_length
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
16384
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
1048576
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Each client thread is associated with a connection buffer and
result buffer. Both begin with a size given by
<a class="link" href="server-system-variables.html#sysvar_net_buffer_length">
<code class="literal">
net_buffer_length
</code>
</a>
but are
dynamically enlarged up to
<a class="link" href="server-system-variables.html#sysvar_max_allowed_packet">
<code class="literal">
max_allowed_packet
</code>
</a>
bytes as
needed. The result buffer shrinks to
<a class="link" href="server-system-variables.html#sysvar_net_buffer_length">
<code class="literal">
net_buffer_length
</code>
</a>
after each
SQL statement.
</p>
<p>
This variable should not normally be changed, but if you have
very little memory, you can set it to the expected length of
statements sent by clients. If statements exceed this length,
the connection buffer is automatically enlarged. The maximum
value to which
<a class="link" href="server-system-variables.html#sysvar_net_buffer_length">
<code class="literal">
net_buffer_length
</code>
</a>
can be set
is 1MB.
</p>
<p>
The session value of this variable is read only.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_net_read_timeout">
</a>
<a class="link" href="server-system-variables.html#sysvar_net_read_timeout">
<code class="literal">
net_read_timeout
</code>
</a>
</p>
<a class="indexterm" name="idm46045272398192">
</a>
<a class="indexterm" name="idm46045272397104">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for net_read_timeout">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--net-read-timeout=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_net_read_timeout">
net_read_timeout
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
30
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of seconds to wait for more data from a connection
before aborting the read. When the server is reading from the
client,
<a class="link" href="server-system-variables.html#sysvar_net_read_timeout">
<code class="literal">
net_read_timeout
</code>
</a>
is
the timeout value controlling when to abort. When the server
is writing to the client,
<a class="link" href="server-system-variables.html#sysvar_net_write_timeout">
<code class="literal">
net_write_timeout
</code>
</a>
is the
timeout value controlling when to abort. See also
<a class="link" href="replication-options-replica.html#sysvar_replica_net_timeout">
<code class="literal">
replica_net_timeout
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_net_retry_count">
</a>
<a class="link" href="server-system-variables.html#sysvar_net_retry_count">
<code class="literal">
net_retry_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045272361712">
</a>
<a class="indexterm" name="idm46045272360624">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for net_retry_count">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--net-retry-count=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_net_retry_count">
net_retry_count
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
10
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If a read or write on a communication port is interrupted,
retry this many times before giving up. This value should be
set quite high on FreeBSD because internal interrupts are sent
to all threads.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_net_write_timeout">
</a>
<a class="link" href="server-system-variables.html#sysvar_net_write_timeout">
<code class="literal">
net_write_timeout
</code>
</a>
</p>
<a class="indexterm" name="idm46045272328528">
</a>
<a class="indexterm" name="idm46045272327488">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for net_write_timeout">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--net-write-timeout=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_net_write_timeout">
net_write_timeout
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
60
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of seconds to wait for a block to be written to a
connection before aborting the write. See also
<a class="link" href="server-system-variables.html#sysvar_net_read_timeout">
<code class="literal">
net_read_timeout
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ngram_token_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_ngram_token_size">
<code class="literal">
ngram_token_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045272294784">
</a>
<a class="indexterm" name="idm46045272293696">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ngram_token_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ngram-token-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ngram_token_size">
ngram_token_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
2
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
10
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Defines the n-gram token size for the n-gram full-text parser.
The
<code class="literal">
ngram_token_size
</code>
option is read-only
and can only be modified at startup. The default value is 2
(bigram). The maximum value is 10.
</p>
<p>
For more information about how to configure this variable, see
<a class="xref" href="fulltext-search-ngram.html" title="14.9.8 ngram Full-Text Parser">
Section 14.9.8, “ngram Full-Text Parser”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_offline_mode">
</a>
<a class="link" href="server-system-variables.html#sysvar_offline_mode">
<code class="literal">
offline_mode
</code>
</a>
</p>
<a class="indexterm" name="idm46045272262256">
</a>
<a class="indexterm" name="idm46045272261168">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for offline_mode">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--offline-mode[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_offline_mode">
offline_mode
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
In offline mode, the MySQL instance disconnects client users
unless they have relevant privileges, and does not allow them
to initiate new connections. Clients that are refused access
receive an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_server_offline_mode" target="_top">
<code class="literal">
ER_SERVER_OFFLINE_MODE
</code>
</a>
error.
</p>
<p>
To put a server in offline mode, change the value of the
<a class="link" href="server-system-variables.html#sysvar_offline_mode">
<code class="literal">
offline_mode
</code>
</a>
system variable
from
<code class="literal">
OFF
</code>
to
<code class="literal">
ON
</code>
. To
resume normal operations, change
<a class="link" href="server-system-variables.html#sysvar_offline_mode">
<code class="literal">
offline_mode
</code>
</a>
from
<code class="literal">
ON
</code>
to
<code class="literal">
OFF
</code>
. To control
offline mode, an administrator account must have the
<a class="link" href="privileges-provided.html#priv_system-variables-admin">
<code class="literal">
SYSTEM_VARIABLES_ADMIN
</code>
</a>
privilege and the
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
privilege (or
the deprecated
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege,
which covers both these privileges).
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
is required,
to prevent accidental lockout.
</p>
<p>
Offline mode has these characteristics:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
Connected client users who do not have the
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
privilege
(or the deprecated
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege) are disconnected on the next request, with an
appropriate error. Disconnection includes terminating
running statements and releasing locks. Such clients also
cannot initiate new connections, and receive an
appropriate error.
</p>
</li>
<li class="listitem">
<p>
Connected client users who have the
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
or
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege are not
disconnected, and can initiate new connections to manage
the server.
</p>
</li>
<li class="listitem">
<p>
If the user that puts a server in offline mode does not
have the
<a class="link" href="privileges-provided.html#priv_system-user">
<code class="literal">
SYSTEM_USER
</code>
</a>
privilege, connected client users who have the
<a class="link" href="privileges-provided.html#priv_system-user">
<code class="literal">
SYSTEM_USER
</code>
</a>
privilege are
also not disconnected. However, these users cannot
initiate new connections to the server while it is in
offline mode, unless they have the
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
or
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege as well. It
is only their existing connection that cannot be
terminated, because the
<a class="link" href="privileges-provided.html#priv_system-user">
<code class="literal">
SYSTEM_USER
</code>
</a>
privilege is
required to kill a session or statement that is executing
with the
<a class="link" href="privileges-provided.html#priv_system-user">
<code class="literal">
SYSTEM_USER
</code>
</a>
privilege.
</p>
</li>
<li class="listitem">
<p>
Replication threads are permitted to keep applying data to
the server.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_old_alter_table">
</a>
<a class="link" href="server-system-variables.html#sysvar_old_alter_table">
<code class="literal">
old_alter_table
</code>
</a>
</p>
<a class="indexterm" name="idm46045272206800">
</a>
<a class="indexterm" name="idm46045272205712">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for old_alter_table">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--old-alter-table[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_old_alter_table">
old_alter_table
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
When this variable is enabled, the server does not use the
optimized method of processing an
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER
TABLE
</code>
</a>
operation. It reverts to using a temporary
table, copying over the data, and then renaming the temporary
table to the original, as used by MySQL 5.0 and earlier. For
more information on the operation of
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
, see
<a class="xref" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
Section 15.1.9, “ALTER TABLE Statement”
</a>
.
</p>
<p>
<code class="literal">
ALTER TABLE ... DROP PARTITION
</code>
with
<a class="link" href="server-system-variables.html#sysvar_old_alter_table">
<code class="literal">
old_alter_table=ON
</code>
</a>
rebuilds
the partitioned table and attempts to move data from the
dropped partition to another partition with a compatible
<code class="literal">
PARTITION ... VALUES
</code>
definition. Data that
cannot be moved to another partition is deleted. In earlier
releases,
<code class="literal">
ALTER TABLE ... DROP PARTITION
</code>
with
<a class="link" href="server-system-variables.html#sysvar_old_alter_table">
<code class="literal">
old_alter_table=ON
</code>
</a>
deletes data stored in the partition and drops the partition.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_open_files_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_open_files_limit">
<code class="literal">
open_files_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045272172560">
</a>
<a class="indexterm" name="idm46045272171472">
</a>
<a class="indexterm" name="idm46045272169984">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for open_files_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--open-files-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_open_files_limit">
open_files_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
5000, with possible adjustment
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
platform dependent
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of file descriptors available to
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
from the operating system:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
At startup,
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
reserves descriptors
with
<code class="function">
setrlimit()
</code>
, using the value
requested at by setting this variable directly or by using
the
<a class="link" href="mysqld-safe.html#option_mysqld_safe_open-files-limit">
<code class="option">
--open-files-limit
</code>
</a>
option to
<a class="link" href="mysqld-safe.html" title="6.3.2 mysqld_safe — MySQL Server Startup Script">
<span class="command">
<strong>
mysqld_safe
</strong>
</span>
</a>
. If
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
produces the error
<code class="literal">
Too
many open files
</code>
, try increasing the
<a class="link" href="server-system-variables.html#sysvar_open_files_limit">
<code class="literal">
open_files_limit
</code>
</a>
value.
Internally, the maximum value for this variable is the
maximum unsigned integer value, but the actual maximum is
platform dependent.
</p>
</li>
<li class="listitem">
<p>
At runtime, the value of
<a class="link" href="server-system-variables.html#sysvar_open_files_limit">
<code class="literal">
open_files_limit
</code>
</a>
indicates the number of file descriptors actually
permitted to
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
by the operating
system, which might differ from the value requested at
startup. If the number of file descriptors requested
during startup cannot be allocated,
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
writes a warning to the error
log.
</p>
</li>
</ul>
</div>
<p>
The effective
<a class="link" href="server-system-variables.html#sysvar_open_files_limit">
<code class="literal">
open_files_limit
</code>
</a>
value is
based on the value specified at system startup (if any) and
the values of
<a class="link" href="server-system-variables.html#sysvar_max_connections">
<code class="literal">
max_connections
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_table_open_cache">
<code class="literal">
table_open_cache
</code>
</a>
, using
these formulas:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
10 + max_connections + (table_open_cache *
2)
</code>
. Using the defaults for these variables
yields 8161.
</p>
<p>
On Windows only, 2048 (the value of the C Run-Time Library
file descriptor maximum) is added to this number. This
totals 10209, again using the default values for the
indicated system variables.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
max_connections * 5
</code>
</p>
</li>
<li class="listitem">
<p>
The operating system limit.
</p>
</li>
</ul>
</div>
<p>
The server attempts to obtain the number of file descriptors
using the maximum of those values, capped to the maximum
unsigned integer value. If that many descriptors cannot be
obtained, the server attempts to obtain as many as the system
permits.
</p>
<p>
The effective value is 0 on systems where MySQL cannot change
the number of open files.
</p>
<p>
On Unix, the value cannot be set greater than the value
displayed by the
<span class="command">
<strong>
ulimit -n
</strong>
</span>
command. On
Linux systems using
<code class="literal">
systemd
</code>
, the value
cannot be set greater than
<code class="literal">
LimitNOFILE
</code>
(this is
<code class="literal">
DefaultLimitNOFILE
</code>
, if
<code class="literal">
LimitNOFILE
</code>
is not set); otherwise, on
Linux, the value of
<code class="literal">
open_files_limit
</code>
cannot
exceed
<span class="command">
<strong>
ulimit -n
</strong>
</span>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_optimizer_prune_level">
</a>
<a class="link" href="server-system-variables.html#sysvar_optimizer_prune_level">
<code class="literal">
optimizer_prune_level
</code>
</a>
</p>
<a class="indexterm" name="idm46045272109408">
</a>
<a class="indexterm" name="idm46045272108368">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for optimizer_prune_level">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--optimizer-prune-level=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_optimizer_prune_level">
optimizer_prune_level
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Controls the heuristics applied during query optimization to
prune less-promising partial plans from the optimizer search
space. A value of 0 disables heuristics so that the optimizer
performs an exhaustive search. A value of 1 causes the
optimizer to prune plans based on the number of rows retrieved
by intermediate plans.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_optimizer_search_depth">
</a>
<a class="link" href="server-system-variables.html#sysvar_optimizer_search_depth">
<code class="literal">
optimizer_search_depth
</code>
</a>
</p>
<a class="indexterm" name="idm46045272078592">
</a>
<a class="indexterm" name="idm46045272077552">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for optimizer_search_depth">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--optimizer-search-depth=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_optimizer_search_depth">
optimizer_search_depth
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
62
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
62
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum depth of search performed by the query optimizer.
Values larger than the number of relations in a query result
in better query plans, but take longer to generate an
execution plan for a query. Values smaller than the number of
relations in a query return an execution plan quicker, but the
resulting plan may be far from being optimal. If set to 0, the
system automatically picks a reasonable value.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_optimizer_switch">
</a>
<a class="link" href="server-system-variables.html#sysvar_optimizer_switch">
<code class="literal">
optimizer_switch
</code>
</a>
</p>
<a class="indexterm" name="idm46045272047856">
</a>
<a class="indexterm" name="idm46045272046768">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for optimizer_switch">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--optimizer-switch=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_optimizer_switch">
optimizer_switch
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Set
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
batched_key_access={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
block_nested_loop={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
condition_fanout_filter={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
derived_condition_pushdown={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
derived_merge={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
duplicateweedout={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
engine_condition_pushdown={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
firstmatch={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
hash_join={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
index_condition_pushdown={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
index_merge={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
index_merge_intersection={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
index_merge_sort_union={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
index_merge_union={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
loosescan={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
materialization={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
mrr={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
mrr_cost_based={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
prefer_ordering_index={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
semijoin={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
skip_scan={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
subquery_materialization_cost_based={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
subquery_to_derived={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
use_index_extensions={on|off}
</code>
</p>
<p class="valid-value">
<code class="literal">
use_invisible_indexes={on|off}
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_optimizer_switch">
<code class="literal">
optimizer_switch
</code>
</a>
system
variable enables control over optimizer behavior. The value of
this variable is a set of flags, each of which has a value of
<code class="literal">
on
</code>
or
<code class="literal">
off
</code>
to indicate
whether the corresponding optimizer behavior is enabled or
disabled. This variable has global and session values and can
be changed at runtime. The global default can be set at server
startup.
</p>
<p>
To see the current set of optimizer flags, select the variable
value:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa3805627"><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></span> <span class="token keyword">SELECT</span> <span class="token variable">@@optimizer_switch</span>\G
<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> 1. row <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>
@@optimizer_switch<span class="token punctuation">:</span> index_merge=on,index_merge_union=on,
index_merge_sort_union=on,index_merge_intersection=on,
engine_condition_pushdown=on,index_condition_pushdown=on,
mrr=on,mrr_cost_based=on,block_nested_loop=on,
batched_key_access=off,materialization=on,semijoin=on,
loosescan=on,firstmatch=on,duplicateweedout=on,
subquery_materialization_cost_based=on,
use_index_extensions=on,condition_fanout_filter=on,
derived_merge=on,use_invisible_indexes=off,skip_scan=on,
hash_join=on,subquery_to_derived=off,
prefer_ordering_index=on,hypergraph_optimizer=off,
derived_condition_pushdown=on,hash_set_operations=on
</span><span class="token output">1 row in set (0.00 sec)</span></code></pre>
</div>
<p>
For more information about the syntax of this variable and the
optimizer behaviors that it controls, see
<a class="xref" href="switchable-optimizations.html" title="10.9.2 Switchable Optimizations">
Section 10.9.2, “Switchable Optimizations”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_optimizer_trace">
</a>
<a class="link" href="server-system-variables.html#sysvar_optimizer_trace">
<code class="literal">
optimizer_trace
</code>
</a>
</p>
<a class="indexterm" name="idm46045271991776">
</a>
<a class="indexterm" name="idm46045271990688">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for optimizer_trace">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--optimizer-trace=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_optimizer_trace">
optimizer_trace
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls optimizer tracing. For details, see
<a class="xref" href="optimizer-tracing.html" title="10.15 Tracing the Optimizer">
Section 10.15, “Tracing the Optimizer”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_optimizer_trace_features">
</a>
<a class="link" href="server-system-variables.html#sysvar_optimizer_trace_features">
<code class="literal">
optimizer_trace_features
</code>
</a>
</p>
<a class="indexterm" name="idm46045271967888">
</a>
<a class="indexterm" name="idm46045271966784">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for optimizer_trace_features">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--optimizer-trace-features=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_optimizer_trace_features">
optimizer_trace_features
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable enables or disables selected optimizer tracing
features. For details, see
<a class="xref" href="optimizer-tracing.html" title="10.15 Tracing the Optimizer">
Section 10.15, “Tracing the Optimizer”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_optimizer_trace_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_optimizer_trace_limit">
<code class="literal">
optimizer_trace_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045271943840">
</a>
<a class="indexterm" name="idm46045271942800">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for optimizer_trace_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--optimizer-trace-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_optimizer_trace_limit">
optimizer_trace_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2147483647
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum number of optimizer traces to display. For
details, see
<a class="xref" href="optimizer-tracing.html" title="10.15 Tracing the Optimizer">
Section 10.15, “Tracing the Optimizer”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_optimizer_trace_max_mem_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_optimizer_trace_max_mem_size">
<code class="literal">
optimizer_trace_max_mem_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045271912656">
</a>
<a class="indexterm" name="idm46045271911552">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for optimizer_trace_max_mem_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--optimizer-trace-max-mem-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_optimizer_trace_max_mem_size">
optimizer_trace_max_mem_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1048576
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum cumulative size of stored optimizer traces. For
details, see
<a class="xref" href="optimizer-tracing.html" title="10.15 Tracing the Optimizer">
Section 10.15, “Tracing the Optimizer”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_optimizer_trace_offset">
</a>
<a class="link" href="server-system-variables.html#sysvar_optimizer_trace_offset">
<code class="literal">
optimizer_trace_offset
</code>
</a>
</p>
<a class="indexterm" name="idm46045271879248">
</a>
<a class="indexterm" name="idm46045271878208">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for optimizer_trace_offset">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--optimizer-trace-offset=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_optimizer_trace_offset">
optimizer_trace_offset
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
-1
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
-2147483647
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2147483647
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The offset of optimizer traces to display. For details, see
<a class="xref" href="optimizer-tracing.html" title="10.15 Tracing the Optimizer">
Section 10.15, “Tracing the Optimizer”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
performance_schema_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
</p>
<p>
Performance Schema system variables are listed in
<a class="xref" href="performance-schema-system-variables.html" title="29.15 Performance Schema System Variables">
Section 29.15, “Performance Schema System Variables”
</a>
. These
variables may be used to configure Performance Schema
operation.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_parser_max_mem_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_parser_max_mem_size">
<code class="literal">
parser_max_mem_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045271845008">
</a>
<a class="indexterm" name="idm46045271843968">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for parser_max_mem_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--parser-max-mem-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_parser_max_mem_size">
parser_max_mem_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Default Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
10000000
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum amount of memory available to the parser. The
default value places no limit on memory available. The value
can be reduced to protect against out-of-memory situations
caused by parsing long or complex SQL statements.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_partial_revokes">
</a>
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
<code class="literal">
partial_revokes
</code>
</a>
</p>
<a class="indexterm" name="idm46045271807408">
</a>
<a class="indexterm" name="idm46045271806320">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for partial_revokes">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--partial-revokes[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
partial_revokes
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<p class="valid-value">
<code class="literal">
OFF
</code>
(if partial revokes do not exist)
</p>
<p class="valid-value">
<code class="literal">
ON
</code>
(if partial revokes exist)
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Enabling this variable makes it possible to revoke privileges
partially. Specifically, for users who have privileges at the
global level,
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
<code class="literal">
partial_revokes
</code>
</a>
enables privileges for specific schemas to be revoked while
leaving the privileges in place for other schemas. For
example, a user who has the global
<a class="link" href="privileges-provided.html#priv_update">
<code class="literal">
UPDATE
</code>
</a>
privilege can be
restricted from exercising this privilege on the
<code class="literal">
mysql
</code>
system schema. (Or, stated another
way, the user is enabled to exercise the
<a class="link" href="privileges-provided.html#priv_update">
<code class="literal">
UPDATE
</code>
</a>
privilege on all schemas
except the
<code class="literal">
mysql
</code>
schema.) In this sense,
the user's global
<a class="link" href="privileges-provided.html#priv_update">
<code class="literal">
UPDATE
</code>
</a>
privilege is partially revoked.
</p>
<p>
Once enabled,
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
<code class="literal">
partial_revokes
</code>
</a>
cannot be disabled if any account has privilege restrictions.
If any such account exists, disabling
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
<code class="literal">
partial_revokes
</code>
</a>
fails:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
For attempts to disable
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
<code class="literal">
partial_revokes
</code>
</a>
at
startup, the server logs an error message and enables
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
<code class="literal">
partial_revokes
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
For attempts to disable
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
<code class="literal">
partial_revokes
</code>
</a>
at
runtime, an error occurs and the
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
<code class="literal">
partial_revokes
</code>
</a>
value
remains unchanged.
</p>
</li>
</ul>
</div>
<p>
To disable
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
<code class="literal">
partial_revokes
</code>
</a>
in
this case, first modify each account that has partially
revoked privileges, either by re-granting the privileges or by
removing the account.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
In privilege assignments, enabling
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
<code class="literal">
partial_revokes
</code>
</a>
causes
MySQL to interpret occurrences of unescaped
<code class="literal">
_
</code>
and
<code class="literal">
%
</code>
SQL wildcard
characters in schema names as literal characters, just as if
they had been escaped as
<code class="literal">
\_
</code>
and
<code class="literal">
\%
</code>
. Because this changes how MySQL
interprets privileges, it may be advisable to avoid
unescaped wildcard characters in privilege assignments for
installations where
<a class="link" href="server-system-variables.html#sysvar_partial_revokes">
<code class="literal">
partial_revokes
</code>
</a>
may be
enabled.
</p>
<p>
In addition, use of
<code class="literal">
_
</code>
and
<code class="literal">
%
</code>
as wildcard characters in grants is
deprecated, and you should expect support for them to be
removed in a future version of MySQL.
</p>
</div>
<p>
For more information, including instructions for removing
partial revokes, see
<a class="xref" href="partial-revokes.html" title="8.2.12 Privilege Restriction Using Partial Revokes">
Section 8.2.12, “Privilege Restriction Using Partial Revokes”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_password_history">
</a>
<a class="link" href="server-system-variables.html#sysvar_password_history">
<code class="literal">
password_history
</code>
</a>
</p>
<a class="indexterm" name="idm46045271751488">
</a>
<a class="indexterm" name="idm46045271750400">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for password_history">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--password-history=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_password_history">
password_history
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable defines the global policy for controlling reuse
of previous passwords based on required minimum number of
password changes. For an account password used previously,
this variable indicates the number of subsequent account
password changes that must occur before the password can be
reused. If the value is 0 (the default), there is no reuse
restriction based on number of password changes.
</p>
<p>
Changes to this variable apply immediately to all accounts
defined with the
<code class="literal">
PASSWORD HISTORY DEFAULT
</code>
option.
</p>
<p>
The global number-of-changes password reuse policy can be
overridden as desired for individual accounts using the
<code class="literal">
PASSWORD HISTORY
</code>
option of the
<a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
<code class="literal">
CREATE USER
</code>
</a>
and
<a class="link" href="alter-user.html" title="15.7.1.1 ALTER USER Statement">
<code class="literal">
ALTER USER
</code>
</a>
statements. See
<a class="xref" href="password-management.html" title="8.2.15 Password Management">
Section 8.2.15, “Password Management”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_password_require_current">
</a>
<a class="link" href="server-system-variables.html#sysvar_password_require_current">
<code class="literal">
password_require_current
</code>
</a>
</p>
<a class="indexterm" name="idm46045271714976">
</a>
<a class="indexterm" name="idm46045271713872">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for password_require_current">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--password-require-current[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_password_require_current">
password_require_current
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable defines the global policy for controlling
whether attempts to change an account password must specify
the current password to be replaced.
</p>
<p>
Changes to this variable apply immediately to all accounts
defined with the
<code class="literal">
PASSWORD REQUIRE CURRENT
DEFAULT
</code>
option.
</p>
<p>
The global verification-required policy can be overridden as
desired for individual accounts using the
<code class="literal">
PASSWORD
REQUIRE
</code>
option of the
<a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
<code class="literal">
CREATE
USER
</code>
</a>
and
<a class="link" href="alter-user.html" title="15.7.1.1 ALTER USER Statement">
<code class="literal">
ALTER USER
</code>
</a>
statements. See
<a class="xref" href="password-management.html" title="8.2.15 Password Management">
Section 8.2.15, “Password Management”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_password_reuse_interval">
</a>
<a class="link" href="server-system-variables.html#sysvar_password_reuse_interval">
<code class="literal">
password_reuse_interval
</code>
</a>
</p>
<a class="indexterm" name="idm46045271683504">
</a>
<a class="indexterm" name="idm46045271682464">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for password_reuse_interval">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--password-reuse-interval=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_password_reuse_interval">
password_reuse_interval
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
days
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable defines the global policy for controlling reuse
of previous passwords based on time elapsed. For an account
password used previously, this variable indicates the number
of days that must pass before the password can be reused. If
the value is 0 (the default), there is no reuse restriction
based on time elapsed.
</p>
<p>
Changes to this variable apply immediately to all accounts
defined with the
<code class="literal">
PASSWORD REUSE INTERVAL
DEFAULT
</code>
option.
</p>
<p>
The global time-elapsed password reuse policy can be
overridden as desired for individual accounts using the
<code class="literal">
PASSWORD REUSE INTERVAL
</code>
option of the
<a class="link" href="create-user.html" title="15.7.1.3 CREATE USER Statement">
<code class="literal">
CREATE USER
</code>
</a>
and
<a class="link" href="alter-user.html" title="15.7.1.1 ALTER USER Statement">
<code class="literal">
ALTER USER
</code>
</a>
statements. See
<a class="xref" href="password-management.html" title="8.2.15 Password Management">
Section 8.2.15, “Password Management”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_persisted_globals_load">
</a>
<a class="link" href="server-system-variables.html#sysvar_persisted_globals_load">
<code class="literal">
persisted_globals_load
</code>
</a>
</p>
<a class="indexterm" name="idm46045271644928">
</a>
<a class="indexterm" name="idm46045271643888">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for persisted_globals_load">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--persisted-globals-load[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_persisted_globals_load">
persisted_globals_load
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether to load persisted configuration settings from the
<code class="filename">
mysqld-auto.cnf
</code>
file in the data
directory. The server normally processes this file at startup
after all other option files (see
<a class="xref" href="option-files.html" title="6.2.2.2 Using Option Files">
Section 6.2.2.2, “Using Option Files”
</a>
). Disabling
<a class="link" href="server-system-variables.html#sysvar_persisted_globals_load">
<code class="literal">
persisted_globals_load
</code>
</a>
causes
the server startup sequence to skip
<code class="literal">
mysqld-auto.cnf
</code>
.
</p>
<a class="indexterm" name="idm46045271618176">
</a>
<a class="indexterm" name="idm46045271617136">
</a>
<p>
To modify the contents of
<code class="filename">
mysqld-auto.cnf
</code>
, use the
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
PERSIST
</code>
</a>
,
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
PERSIST_ONLY
</code>
</a>
, and
<a class="link" href="reset-persist.html" title="15.7.8.7 RESET PERSIST Statement">
<code class="literal">
RESET
PERSIST
</code>
</a>
statements. See
<a class="xref" href="persisted-system-variables.html" title="7.1.9.3 Persisted System Variables">
Section 7.1.9.3, “Persisted System Variables”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_persist_only_admin_x509_subject">
</a>
<a class="link" href="server-system-variables.html#sysvar_persist_only_admin_x509_subject">
<code class="literal">
persist_only_admin_x509_subject
</code>
</a>
</p>
<a class="indexterm" name="idm46045271607392">
</a>
<a class="indexterm" name="idm46045271606288">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for persist_only_admin_x509_subject">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--persist-only-admin-x509-subject=string
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_persist_only_admin_x509_subject">
persist_only_admin_x509_subject
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
empty string
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
PERSIST
</code>
</a>
and
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
PERSIST_ONLY
</code>
</a>
enable system variables to be persisted
to the
<code class="filename">
mysqld-auto.cnf
</code>
option file in the
data directory (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>
).
Persisting system variables enables runtime configuration
changes that affect subsequent server restarts, which is
convenient for remote administration not requiring direct
access to MySQL server host option files. However, some system
variables are nonpersistible or can be persisted only under
certain restrictive conditions.
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_persist_only_admin_x509_subject">
<code class="literal">
persist_only_admin_x509_subject
</code>
</a>
system variable specifies the SSL certificate X.509 Subject
value that users must have to be able to persist system
variables that are persist-restricted. The default value is
the empty string, which disables the Subject check so that
persist-restricted system variables cannot be persisted by any
user.
</p>
<p>
If
<a class="link" href="server-system-variables.html#sysvar_persist_only_admin_x509_subject">
<code class="literal">
persist_only_admin_x509_subject
</code>
</a>
is nonempty, users who connect to the server using an
encrypted connection and supply an SSL certificate with the
designated Subject value then can use
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
PERSIST_ONLY
</code>
</a>
to persist persist-restricted system
variables. For information about persist-restricted system
variables and instructions for configuring MySQL to enable
<a class="link" href="server-system-variables.html#sysvar_persist_only_admin_x509_subject">
<code class="literal">
persist_only_admin_x509_subject
</code>
</a>
,
see
<a class="xref" href="nonpersistible-system-variables.html" title="7.1.9.4 Nonpersistible and Persist-Restricted System Variables">
Section 7.1.9.4, “Nonpersistible and Persist-Restricted System Variables”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_persist_sensitive_variables_in_plaintext">
</a>
<a class="link" href="server-system-variables.html#sysvar_persist_sensitive_variables_in_plaintext">
<code class="literal">
persist_sensitive_variables_in_plaintext
</code>
</a>
</p>
<a class="indexterm" name="idm46045271569744">
</a>
<a class="indexterm" name="idm46045271568624">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for persist_sensitive_variables_in_plaintext">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--persist_sensitive_variables_in_plaintext[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_persist_sensitive_variables_in_plaintext">
persist_sensitive_variables_in_plaintext
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
<code class="literal">
persist_sensitive_variables_in_plaintext
</code>
controls whether the server is permitted to store the values
of sensitive system variables in an unencrypted format, if
keyring component support is not available at the time when
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
PERSIST
</code>
</a>
is used to set the value of the system
variable. It also controls whether or not the server can start
if the encrypted values cannot be decrypted. Note that keyring
plugins do not support secure storage of sensitive system
variables; a keyring component (see
<a class="xref" href="keyring.html" title="8.4.4 The MySQL Keyring">
Section 8.4.4, “The MySQL Keyring”
</a>
)
must be enabled on the MySQL Server instance to support secure
storage.
</p>
<p>
The default setting,
<code class="literal">
ON
</code>
, encrypts the
values if keyring component support is available, and persists
them unencrypted (with a warning) if it is not. The next time
any persisted system variable is set, if keyring support is
available at that time, the server encrypts the values of any
unencrypted sensitive system variables. The
<code class="literal">
ON
</code>
setting also allows the server to start
if encrypted system variable values cannot be decrypted, in
which case a warning is issued and the default values for the
system variables are used. In that situation, their values
cannot be changed until they can be decrypted.
</p>
<p>
The most secure setting,
<code class="literal">
OFF
</code>
, means
sensitive system variable values cannot be persisted if
keyring component support is unavailable. The
<code class="literal">
OFF
</code>
setting also means the server does not
start if encrypted system variable values cannot be decrypted.
</p>
<p>
For more information, see
<a class="xref" href="persisted-system-variables.html#persisted-system-variables-sensitive" title="Persisting Sensitive System Variables">
Persisting Sensitive System Variables
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_pid_file">
</a>
<a class="link" href="server-system-variables.html#sysvar_pid_file">
<code class="literal">
pid_file
</code>
</a>
</p>
<a class="indexterm" name="idm46045271534528">
</a>
<a class="indexterm" name="idm46045271533440">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for pid_file">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--pid-file=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_pid_file">
pid_file
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
</tbody>
</table>
</div>
<p>
The path name of the file in which the server writes its
process ID. The server creates the file in the data directory
unless an absolute path name is given to specify a different
directory. If you specify this variable, you must specify a
value. If you do not specify this variable, MySQL uses a
default value of
<code class="filename">
<em class="replaceable">
<code>
host_name
</code>
</em>
.pid
</code>
,
where
<em class="replaceable">
<code>
host_name
</code>
</em>
is the name of the
host machine.
</p>
<p>
The process ID file is used by other programs such as
<a class="link" href="mysqld-safe.html" title="6.3.2 mysqld_safe — MySQL Server Startup Script">
<span class="command">
<strong>
mysqld_safe
</strong>
</span>
</a>
to determine the server's
process ID. On Windows, this variable also affects the default
error log file name. See
<a class="xref" href="error-log.html" title="7.4.2 The Error Log">
Section 7.4.2, “The Error Log”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_plugin_dir">
</a>
<a class="link" href="server-system-variables.html#sysvar_plugin_dir">
<code class="literal">
plugin_dir
</code>
</a>
</p>
<a class="indexterm" name="idm46045271507184">
</a>
<a class="indexterm" name="idm46045271506096">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for plugin_dir">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--plugin-dir=dir_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_plugin_dir">
plugin_dir
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Directory name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
BASEDIR/lib/plugin
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The path name of the plugin directory.
</p>
<p>
If the plugin directory is writable by the server, it may be
possible for a user to write executable code to a file in the
directory using
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
... INTO DUMPFILE
</code>
</a>
. This can be prevented by making
<a class="link" href="server-system-variables.html#sysvar_plugin_dir">
<code class="literal">
plugin_dir
</code>
</a>
read only to the
server or by setting
<a class="link" href="server-system-variables.html#sysvar_secure_file_priv">
<code class="literal">
secure_file_priv
</code>
</a>
to a
directory where
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
writes
can be made safely.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_port">
</a>
<a class="link" href="server-system-variables.html#sysvar_port">
<code class="literal">
port
</code>
</a>
</p>
<a class="indexterm" name="idm46045271475968">
</a>
<a class="indexterm" name="idm46045271474896">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for port">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--port=port_num
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_port">
port
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
3306
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
65535
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of the port on which the server listens for TCP/IP
connections. This variable can be set with the
<a class="link" href="server-options.html#option_mysqld_port">
<code class="option">
--port
</code>
</a>
option.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_preload_buffer_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_preload_buffer_size">
<code class="literal">
preload_buffer_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045271444416">
</a>
<a class="indexterm" name="idm46045271443376">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for preload_buffer_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--preload-buffer-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_preload_buffer_size">
preload_buffer_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
32768
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
1073741824
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The size of the buffer that is allocated when preloading
indexes.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_print_identified_with_as_hex">
</a>
<a class="link" href="server-system-variables.html#sysvar_print_identified_with_as_hex">
<code class="literal">
print_identified_with_as_hex
</code>
</a>
</p>
<a class="indexterm" name="idm46045271410496">
</a>
<a class="indexterm" name="idm46045271409392">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for print_identified_with_as_hex">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--print-identified-with-as-hex[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_print_identified_with_as_hex">
print_identified_with_as_hex
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Password hash values displayed in the
<code class="literal">
IDENTIFIED
WITH
</code>
clause of output from
<a class="link" href="show-create-user.html" title="15.7.7.13 SHOW CREATE USER Statement">
<code class="literal">
SHOW
CREATE USER
</code>
</a>
may contain unprintable characters that
have adverse effects on terminal displays and in other
environments. Enabling
<a class="link" href="server-system-variables.html#sysvar_print_identified_with_as_hex">
<code class="literal">
print_identified_with_as_hex
</code>
</a>
causes
<a class="link" href="show-create-user.html" title="15.7.7.13 SHOW CREATE USER Statement">
<code class="literal">
SHOW CREATE USER
</code>
</a>
to
display such hash values as hexadecimal strings rather than as
regular string literals. Hash values that do not contain
unprintable characters still display as regular string
literals, even with this variable enabled.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_profiling">
</a>
<a class="link" href="server-system-variables.html#sysvar_profiling">
<code class="literal">
profiling
</code>
</a>
</p>
<a class="indexterm" name="idm46045271379856">
</a>
<a class="indexterm" name="idm46045271378768">
</a>
<p>
If set to 0 or
<code class="literal">
OFF
</code>
(the default), statement
profiling is disabled. If set to 1 or
<code class="literal">
ON
</code>
,
statement profiling is enabled and the
<a class="link" href="show-profile.html" title="15.7.7.32 SHOW PROFILE Statement">
<code class="literal">
SHOW PROFILE
</code>
</a>
and
<a class="link" href="show-profiles.html" title="15.7.7.33 SHOW PROFILES Statement">
<code class="literal">
SHOW PROFILES
</code>
</a>
statements
provide access to profiling information. See
<a class="xref" href="show-profiles.html" title="15.7.7.33 SHOW PROFILES Statement">
Section 15.7.7.33, “SHOW PROFILES Statement”
</a>
.
</p>
<p>
This variable is deprecated; expect it to be removed in a
future MySQL release.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_profiling_history_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_profiling_history_size">
<code class="literal">
profiling_history_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045271369136">
</a>
<a class="indexterm" name="idm46045271368096">
</a>
<p>
The number of statements for which to maintain profiling
information if
<a class="link" href="server-system-variables.html#sysvar_profiling">
<code class="literal">
profiling
</code>
</a>
is
enabled. The default value is 15. The maximum value is 100.
Setting the value to 0 effectively disables profiling. See
<a class="xref" href="show-profiles.html" title="15.7.7.33 SHOW PROFILES Statement">
Section 15.7.7.33, “SHOW PROFILES Statement”
</a>
.
</p>
<p>
This variable is deprecated; expect it to be removed in a
future MySQL release.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_protocol_compression_algorithms">
</a>
<a class="link" href="server-system-variables.html#sysvar_protocol_compression_algorithms">
<code class="literal">
protocol_compression_algorithms
</code>
</a>
</p>
<a class="indexterm" name="idm46045271361072">
</a>
<a class="indexterm" name="idm46045271359968">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for protocol_compression_algorithms">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--protocol-compression-algorithms=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_protocol_compression_algorithms">
protocol_compression_algorithms
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Set
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
zlib,zstd,uncompressed
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
zlib
</code>
</p>
<p class="valid-value">
<code class="literal">
zstd
</code>
</p>
<p class="valid-value">
<code class="literal">
uncompressed
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The compression algorithms that the server permits for
incoming connections. These include connections by client
programs and by servers participating in source/replica
replication or Group Replication. Compression does not apply
to connections for
<code class="literal">
FEDERATED
</code>
tables.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_protocol_compression_algorithms">
<code class="literal">
protocol_compression_algorithms
</code>
</a>
does not control connection compression for X Protocol. See
<a class="xref" href="x-plugin-connection-compression.html" title="22.5.5 Connection Compression with X Plugin">
Section 22.5.5, “Connection Compression with X Plugin”
</a>
for
information on how this operates.
</p>
<p>
The variable value is a list of one or more comma-separated
compression algorithm names, in any order, chosen from the
following items (not case-sensitive):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
zlib
</code>
: Permit connections that use the
<code class="literal">
zlib
</code>
compression algorithm.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
zstd
</code>
: Permit connections that use the
<code class="literal">
zstd
</code>
compression algorithm.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
uncompressed
</code>
: Permit uncompressed
connections. If this algorithm name is not included in the
<a class="link" href="server-system-variables.html#sysvar_protocol_compression_algorithms">
<code class="literal">
protocol_compression_algorithms
</code>
</a>
value, the server does not permit uncompressed
connections. It permits only compressed connections that
use whichever other algorithms are specified in the value,
and there is no fallback to uncompressed connections.
</p>
</li>
</ul>
</div>
<p>
The default value of
<code class="literal">
zlib,zstd,uncompressed
</code>
indicates that the server permits all compression algorithms.
</p>
<p>
For more information, see
<a class="xref" href="connection-compression-control.html" title="6.2.8 Connection Compression Control">
Section 6.2.8, “Connection Compression Control”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_protocol_version">
</a>
<a class="link" href="server-system-variables.html#sysvar_protocol_version">
<code class="literal">
protocol_version
</code>
</a>
</p>
<a class="indexterm" name="idm46045271316224">
</a>
<a class="indexterm" name="idm46045271315136">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for protocol_version">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_protocol_version">
protocol_version
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
10
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The version of the client/server protocol used by the MySQL
server.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_proxy_user">
</a>
<a class="link" href="server-system-variables.html#sysvar_proxy_user">
<code class="literal">
proxy_user
</code>
</a>
</p>
<a class="indexterm" name="idm46045271288240">
</a>
<a class="indexterm" name="idm46045271287152">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for proxy_user">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_proxy_user">
proxy_user
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
If the current client is a proxy for another user, this
variable is the proxy user account name. Otherwise, this
variable is
<code class="literal">
NULL
</code>
. See
<a class="xref" href="proxy-users.html" title="8.2.19 Proxy Users">
Section 8.2.19, “Proxy Users”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_pseudo_replica_mode">
</a>
<a class="link" href="server-system-variables.html#sysvar_pseudo_replica_mode">
<code class="literal">
pseudo_replica_mode
</code>
</a>
</p>
<a class="indexterm" name="idm46045271266032">
</a>
<a class="indexterm" name="idm46045271264992">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for pseudo_replica_mode">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_pseudo_replica_mode">
pseudo_replica_mode
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
</tbody>
</table>
</div>
<p>
<a class="link" href="server-system-variables.html#sysvar_pseudo_replica_mode">
<code class="literal">
pseudo_replica_mode
</code>
</a>
is for
internal server use. It assists with the correct handling of
transactions that originated on older or newer servers than
the server currently processing them.
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
sets the value of
<a class="link" href="server-system-variables.html#sysvar_pseudo_replica_mode">
<code class="literal">
pseudo_replica_mode
</code>
</a>
to true
before executing any SQL statements.
</p>
<p>
Setting the session value of
<a class="link" href="server-system-variables.html#sysvar_pseudo_replica_mode">
<code class="literal">
pseudo_replica_mode
</code>
</a>
is a
restricted operation. The session user must have either the
<a class="link" href="privileges-provided.html#priv_replication-applier">
<code class="literal">
REPLICATION_APPLIER
</code>
</a>
privilege
(see
<a class="xref" href="replication-privilege-checks.html" title="19.3.3 Replication Privilege Checks">
Section 19.3.3, “Replication Privilege Checks”
</a>
), or
privileges sufficient to set restricted session 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>
). However, note
that the variable is not intended for users to set; it is set
automatically by the replication infrastructure.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_pseudo_replica_mode">
<code class="literal">
pseudo_replica_mode
</code>
</a>
has the
following effects on the handling of prepared XA transactions,
which can be attached to or detached from the handling session
(by default, the session that issues
<a class="link" href="xa.html" title="15.3.8 XA Transactions">
<code class="literal">
XA START
</code>
</a>
):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If true, and the handling session has executed an
internal-use
<a class="link" href="binlog.html" title="15.7.8.1 BINLOG Statement">
<code class="literal">
BINLOG
</code>
</a>
statement, XA transactions are automatically detached from
the session as soon as the first part of the transaction
up to
<a class="link" href="xa.html" title="15.3.8 XA Transactions">
<code class="literal">
XA
PREPARE
</code>
</a>
finishes, so they can be committed or
rolled back by any session that has the
<a class="link" href="privileges-provided.html#priv_xa-recover-admin">
<code class="literal">
XA_RECOVER_ADMIN
</code>
</a>
privilege.
</p>
</li>
<li class="listitem">
<p>
If false, XA transactions remain attached to the handling
session as long as that session is alive, during which
time no other session can commit the transaction. The
prepared transaction is only detached if the session
disconnects or the server restarts.
</p>
</li>
</ul>
</div>
<p>
<a class="link" href="server-system-variables.html#sysvar_pseudo_replica_mode">
<code class="literal">
pseudo_replica_mode
</code>
</a>
has the
following effects on the
<code class="literal">
original_commit_timestamp
</code>
replication delay
timestamp and the
<a class="link" href="replication-options-source.html#sysvar_original_server_version">
<code class="literal">
original_server_version
</code>
</a>
system variable:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If true, transactions that do not explicitly set
<code class="literal">
original_commit_timestamp
</code>
or
<a class="link" href="replication-options-source.html#sysvar_original_server_version">
<code class="literal">
original_server_version
</code>
</a>
are assumed to originate on another, unknown server, so
the value 0, meaning unknown, is assigned to both the
timestamp and the system variable.
</p>
</li>
<li class="listitem">
<p>
If false, transactions that do not explicitly set
<code class="literal">
original_commit_timestamp
</code>
or
<a class="link" href="replication-options-source.html#sysvar_original_server_version">
<code class="literal">
original_server_version
</code>
</a>
are assumed to originate on the current server, so the
current timestamp and the current server's version are
assigned to the timestamp and the system variable.
</p>
</li>
</ul>
</div>
<p>
<a class="link" href="server-system-variables.html#sysvar_pseudo_replica_mode">
<code class="literal">
pseudo_replica_mode
</code>
</a>
has the
following effects on the handling of a statement that sets one
or more unsupported (removed or unknown) SQL modes:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If true, the server ignores the unsupported mode and
raises a warning.
</p>
</li>
<li class="listitem">
<p>
If false, the server rejects the statement with
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_unsupported_sql_mode" target="_top">
<code class="literal">
ER_UNSUPPORTED_SQL_MODE
</code>
</a>
.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_pseudo_slave_mode">
</a>
<a class="link" href="server-system-variables.html#sysvar_pseudo_slave_mode">
<code class="literal">
pseudo_slave_mode
</code>
</a>
</p>
<a class="indexterm" name="idm46045271211472">
</a>
<a class="indexterm" name="idm46045271210432">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for pseudo_slave_mode">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_pseudo_slave_mode">
pseudo_slave_mode
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
</tbody>
</table>
</div>
<p>
Deprecated alias for
<a class="link" href="server-system-variables.html#sysvar_pseudo_replica_mode">
<code class="literal">
pseudo_replica_mode
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_pseudo_thread_id">
</a>
<a class="link" href="server-system-variables.html#sysvar_pseudo_thread_id">
<code class="literal">
pseudo_thread_id
</code>
</a>
</p>
<a class="indexterm" name="idm46045271187616">
</a>
<a class="indexterm" name="idm46045271186528">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for pseudo_thread_id">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_pseudo_thread_id">
pseudo_thread_id
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
2147483647
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2147483647
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable is for internal server use.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Warning
</div>
<p>
Changing the session value of the
<a class="link" href="server-system-variables.html#sysvar_pseudo_thread_id">
<code class="literal">
pseudo_thread_id
</code>
</a>
system
variable changes the value returned by the
<a class="link" href="information-functions.html#function_connection-id">
<code class="literal">
CONNECTION_ID()
</code>
</a>
function.
</p>
</div>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_query_alloc_block_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_query_alloc_block_size">
<code class="literal">
query_alloc_block_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045271154832">
</a>
<a class="indexterm" name="idm46045271153792">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for query_alloc_block_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--query-alloc-block-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_query_alloc_block_size">
query_alloc_block_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
8192
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294966272
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The allocation size in bytes of memory blocks that are
allocated for objects created during statement parsing and
execution. If you have problems with memory fragmentation, it
might help to increase this parameter.
</p>
<p>
The block size for the byte number is 1024. A value that is
not an exact multiple of the block size is rounded down to the
next lower multiple of the block size by MySQL Server before
storing the value for the system variable. The parser allows
values up to the maximum unsigned integer value for the
platform (4294967295 or 2
<sup>
32
</sup>
−1
for a 32-bit system, 18446744073709551615 or
2
<sup>
64
</sup>
−1 for a 64-bit system)
but the actual maximum is a block size lower.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_query_prealloc_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_query_prealloc_size">
<code class="literal">
query_prealloc_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045271117328">
</a>
<a class="indexterm" name="idm46045271116288">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for query_prealloc_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--query-prealloc-size=#
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_query_prealloc_size">
query_prealloc_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
8192
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
8192
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709550592
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294966272
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
<code class="literal">
query_prealloc_size
</code>
is deprecated, and
setting it has no effect; you should expect its removal in a
future release of MySQL.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_rand_seed1">
</a>
<a class="link" href="server-system-variables.html#sysvar_rand_seed1">
<code class="literal">
rand_seed1
</code>
</a>
</p>
<a class="indexterm" name="idm46045271075856">
</a>
<a class="indexterm" name="idm46045271074768">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for rand_seed1">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_rand_seed1">
rand_seed1
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
N/A
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_rand_seed1">
<code class="literal">
rand_seed1
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_rand_seed2">
<code class="literal">
rand_seed2
</code>
</a>
variables exist as
session variables only, and can be set but not read. The
variables—but not their values—are shown in the
output of
<a class="link" href="show-variables.html" title="15.7.7.41 SHOW VARIABLES Statement">
<code class="literal">
SHOW VARIABLES
</code>
</a>
.
</p>
<p>
The purpose of these variables is to support replication of
the
<a class="link" href="mathematical-functions.html#function_rand">
<code class="literal">
RAND()
</code>
</a>
function. For
statements that invoke
<a class="link" href="mathematical-functions.html#function_rand">
<code class="literal">
RAND()
</code>
</a>
,
the source passes two values to the replica, where they are
used to seed the random number generator. The replica uses
these values to set the session variables
<a class="link" href="server-system-variables.html#sysvar_rand_seed1">
<code class="literal">
rand_seed1
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_rand_seed2">
<code class="literal">
rand_seed2
</code>
</a>
so that
<a class="link" href="mathematical-functions.html#function_rand">
<code class="literal">
RAND()
</code>
</a>
on the replica generates
the same value as on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_rand_seed2">
</a>
<a class="link" href="server-system-variables.html#sysvar_rand_seed2">
<code class="literal">
rand_seed2
</code>
</a>
</p>
<a class="indexterm" name="idm46045271036848">
</a>
<a class="indexterm" name="idm46045271035760">
</a>
<p>
See the description for
<a class="link" href="server-system-variables.html#sysvar_rand_seed1">
<code class="literal">
rand_seed1
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_range_alloc_block_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_range_alloc_block_size">
<code class="literal">
range_alloc_block_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045271030080">
</a>
<a class="indexterm" name="idm46045271029040">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for range_alloc_block_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--range-alloc-block-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_range_alloc_block_size">
range_alloc_block_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
4096
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
4096
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709550592
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294966272
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The size in bytes of blocks that are allocated when doing
range optimization.
</p>
<p>
The block size for the byte number is 1024. A value that is
not an exact multiple of the block size is rounded down to the
next lower multiple of the block size by MySQL Server before
storing the value for the system variable. The parser allows
values up to the maximum unsigned integer value for the
platform (4294967295 or 2
<sup>
32
</sup>
−1
for a 32-bit system, 18446744073709551615 or
2
<sup>
64
</sup>
−1 for a 64-bit system)
but the actual maximum is a block size lower.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_range_optimizer_max_mem_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_range_optimizer_max_mem_size">
<code class="literal">
range_optimizer_max_mem_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045270990240">
</a>
<a class="indexterm" name="idm46045270989136">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for range_optimizer_max_mem_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--range-optimizer-max-mem-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_range_optimizer_max_mem_size">
range_optimizer_max_mem_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
8388608
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The limit on memory consumption for the range optimizer. A
value of 0 means
<span class="quote">
“
<span class="quote">
no limit.
</span>
”
</span>
If an execution plan
considered by the optimizer uses the range access method but
the optimizer estimates that the amount of memory needed for
this method would exceed the limit, it abandons the plan and
considers other plans. For more information, see
<a class="xref" href="range-optimization.html#range-optimization-memory-use" title="Limiting Memory Use for Range Optimization">
Limiting Memory Use for Range Optimization
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_rbr_exec_mode">
</a>
<a class="link" href="server-system-variables.html#sysvar_rbr_exec_mode">
<code class="literal">
rbr_exec_mode
</code>
</a>
</p>
<a class="indexterm" name="idm46045270956240">
</a>
<a class="indexterm" name="idm46045270955152">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for rbr_exec_mode">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_rbr_exec_mode">
rbr_exec_mode
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
STRICT
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
STRICT
</code>
</p>
<p class="valid-value">
<code class="literal">
IDEMPOTENT
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
For internal use by
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
. This
variable switches the server between
<code class="literal">
IDEMPOTENT
</code>
mode and
<code class="literal">
STRICT
</code>
mode.
<code class="literal">
IDEMPOTENT
</code>
mode causes suppression of duplicate-key and no-key-found
errors in
<a class="link" href="binlog.html" title="15.7.8.1 BINLOG Statement">
<code class="literal">
BINLOG
</code>
</a>
statements
generated by
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
. This mode is
useful when replaying a row-based binary log on a server that
causes conflicts with existing data.
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
sets this mode when you specify
the
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_idempotent">
<code class="option">
--idempotent
</code>
</a>
option by
writing the following to the output:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa39869036"><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> RBR_EXEC_MODE<span class="token operator">=</span>IDEMPOTENT<span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_read_buffer_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_read_buffer_size">
<code class="literal">
read_buffer_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045270920032">
</a>
<a class="indexterm" name="idm46045270918944">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for read_buffer_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--read-buffer-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_read_buffer_size">
read_buffer_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
131072
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
8192
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2147479552
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
4096
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Each thread that does a sequential scan for a
<code class="literal">
MyISAM
</code>
table allocates a buffer of this
size (in bytes) for each table it scans. If you do many
sequential scans, you might want to increase this value, which
defaults to 131072. The value of this variable should be a
multiple of 4KB. If it is set to a value that is not a
multiple of 4KB, its value is rounded down to the nearest
multiple of 4KB.
</p>
<p>
This option is also used in the following context for all
other storage engines with the exception of
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
For caching the indexes in a temporary file (not a
temporary table), when sorting rows for
<code class="literal">
ORDER
BY
</code>
.
</p>
</li>
<li class="listitem">
<p>
For bulk insert into partitions.
</p>
</li>
<li class="listitem">
<p>
For caching results of nested queries.
</p>
</li>
</ul>
</div>
<p>
<a class="link" href="server-system-variables.html#sysvar_read_buffer_size">
<code class="literal">
read_buffer_size
</code>
</a>
is also used
in one other storage engine-specific way: to determine the
memory block size for
<a class="link" href="memory-storage-engine.html" title="18.3 The MEMORY Storage Engine">
<code class="literal">
MEMORY
</code>
</a>
tables.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_select_into_buffer_size">
<code class="literal">
select_into_buffer_size
</code>
</a>
is
used for the I/O cache buffer for
<a class="link" href="select-into.html" title="15.2.13.1 SELECT ... INTO Statement">
<code class="literal">
SELECT INTO
DUMPFILE
</code>
</a>
and
<code class="literal">
SELECT INTO OUTFILE
</code>
statements. (
<a class="link" href="server-system-variables.html#sysvar_read_buffer_size">
<code class="literal">
read_buffer_size
</code>
</a>
is used for the I/O cache buffer size in all other cases.)
</p>
<p>
For more information about memory use during different
operations, see
<a class="xref" href="memory-use.html" title="10.12.3.1 How MySQL Uses Memory">
Section 10.12.3.1, “How MySQL Uses Memory”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_read_only">
</a>
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
</p>
<a class="indexterm" name="idm46045270868656">
</a>
<a class="indexterm" name="idm46045270867568">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for read_only">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--read-only[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_read_only">
read_only
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If the
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
system
variable is enabled, the server permits no client updates
except from users who have the
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
privilege (or
the deprecated
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege). This variable is disabled by default.
</p>
<p>
The server also supports a
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
system
variable (disabled by default), which has these effects:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
is
enabled, the server prohibits client updates, even from
users who have the
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
or
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege.
</p>
</li>
<li class="listitem">
<p>
Setting
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
to
<code class="literal">
ON
</code>
implicitly forces
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
to
<code class="literal">
ON
</code>
.
</p>
</li>
<li class="listitem">
<p>
Setting
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
to
<code class="literal">
OFF
</code>
implicitly forces
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
to
<code class="literal">
OFF
</code>
.
</p>
</li>
</ul>
</div>
<p>
When
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
is enabled and
when
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
is
enabled, the server still permits these operations:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
Updates performed by replication threads, if the server is
a replica. In replication setups, it can be useful to
enable
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
on
replica servers to ensure that replicas accept updates
only from the source server and not from clients.
</p>
</li>
<li class="listitem">
<p>
Writes to the system table
<code class="literal">
mysql.gtid_executed
</code>
, which stores GTIDs
for executed transactions that are not present in the
current binary log file.
</p>
</li>
<li class="listitem">
<p>
Use of
<a class="link" href="analyze-table.html" title="15.7.3.1 ANALYZE TABLE Statement">
<code class="literal">
ANALYZE TABLE
</code>
</a>
or
<a class="link" href="optimize-table.html" title="15.7.3.4 OPTIMIZE TABLE Statement">
<code class="literal">
OPTIMIZE TABLE
</code>
</a>
statements.
The purpose of read-only mode is to prevent changes to
table structure or contents. Analysis and optimization do
not qualify as such changes. This means, for example, that
consistency checks on read-only replicas can be performed
with
<a class="link" href="mysqlcheck.html" title="6.5.3 mysqlcheck — A Table Maintenance Program">
<span class="command">
<strong>
mysqlcheck
</strong>
</span>
</a>
<a class="link" href="mysqlcheck.html#option_mysqlcheck_all-databases">
<code class="option">
--all-databases
</code>
</a>
<a class="link" href="mysqlcheck.html#option_mysqlcheck_analyze">
<code class="option">
--analyze
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
Use of
<a class="link" href="flush.html#flush-status">
<code class="literal">
FLUSH STATUS
</code>
</a>
statements, which are always written to the binary log.
</p>
</li>
<li class="listitem">
<p>
Operations on
<code class="literal">
TEMPORARY
</code>
tables.
</p>
</li>
<li class="listitem">
<p>
Inserts into the log tables
(
<code class="literal">
mysql.general_log
</code>
and
<code class="literal">
mysql.slow_log
</code>
); see
<a class="xref" href="log-destinations.html" title="7.4.1 Selecting General Query Log and Slow Query Log Output Destinations">
Section 7.4.1, “Selecting General Query Log and Slow Query Log Output Destinations”
</a>
.
</p>
</li>
<li class="listitem">
<p>
Updates to Performance Schema tables, such as
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
or
<a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
<code class="literal">
TRUNCATE TABLE
</code>
</a>
operations.
</p>
</li>
</ul>
</div>
<p>
Changes to
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
on a
replication source server are not replicated to replica
servers. The value can be set on a replica independent of the
setting on the source.
</p>
<p>
The following conditions apply to attempts to enable
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
(including implicit
attempts resulting from enabling
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
The attempt fails and an error occurs if you have any
explicit locks (acquired with
<a class="link" href="lock-tables.html" title="15.3.6 LOCK TABLES and UNLOCK TABLES Statements">
<code class="literal">
LOCK
TABLES
</code>
</a>
) or have a pending transaction.
</p>
</li>
<li class="listitem">
<p>
The attempt blocks while other clients have any ongoing
statement, active
<code class="literal">
LOCK TABLES WRITE
</code>
, or
ongoing commit, until the locks are released and the
statements and transactions end. While the attempt to
enable
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
is
pending, requests by other clients for table locks or to
begin transactions also block until
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
has been set.
</p>
</li>
<li class="listitem">
<p>
The attempt blocks if there are active transactions that
hold metadata locks, until those transactions end.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
can be enabled
while you hold a global read lock (acquired with
<a class="link" href="flush.html#flush-tables-with-read-lock">
<code class="literal">
FLUSH TABLES WITH READ
LOCK
</code>
</a>
) because that does not involve table locks.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_read_rnd_buffer_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_read_rnd_buffer_size">
<code class="literal">
read_rnd_buffer_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045270782832">
</a>
<a class="indexterm" name="idm46045270781792">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for read_rnd_buffer_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--read-rnd-buffer-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_read_rnd_buffer_size">
read_rnd_buffer_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
262144
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2147483647
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable is used for reads from
<code class="literal">
MyISAM
</code>
tables, and, for any storage engine, for Multi-Range Read
optimization.
</p>
<p>
When reading rows from a
<code class="literal">
MyISAM
</code>
table in
sorted order following a key-sorting operation, the rows are
read through this buffer to avoid disk seeks. See
<a class="xref" href="order-by-optimization.html" title="10.2.1.16 ORDER BY Optimization">
Section 10.2.1.16, “ORDER BY Optimization”
</a>
. Setting the variable
to a large value can improve
<code class="literal">
ORDER BY
</code>
performance by a lot. However, this is a buffer allocated for
each client, so you should not set the global variable to a
large value. Instead, change the session variable only from
within those clients that need to run large queries.
</p>
<p>
For more information about memory use during different
operations, see
<a class="xref" href="memory-use.html" title="10.12.3.1 How MySQL Uses Memory">
Section 10.12.3.1, “How MySQL Uses Memory”
</a>
. For information
about Multi-Range Read optimization, see
<a class="xref" href="mrr-optimization.html" title="10.2.1.11 Multi-Range Read Optimization">
Section 10.2.1.11, “Multi-Range Read Optimization”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_regexp_stack_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_regexp_stack_limit">
<code class="literal">
regexp_stack_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045270744384">
</a>
<a class="indexterm" name="idm46045270743344">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for regexp_stack_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--regexp-stack-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_regexp_stack_limit">
regexp_stack_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
8000000
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2147483647
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum available memory in bytes for the internal stack
used for regular expression matching operations performed by
<a class="link" href="regexp.html#function_regexp-like">
<code class="literal">
REGEXP_LIKE()
</code>
</a>
and similar
functions (see
<a class="xref" href="regexp.html" title="14.8.2 Regular Expressions">
Section 14.8.2, “Regular Expressions”
</a>
).
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_regexp_time_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_regexp_time_limit">
<code class="literal">
regexp_time_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045270709792">
</a>
<a class="indexterm" name="idm46045270708752">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for regexp_time_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--regexp-time-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_regexp_time_limit">
regexp_time_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
32
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2147483647
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The time limit for regular expression matching operations
performed by
<a class="link" href="regexp.html#function_regexp-like">
<code class="literal">
REGEXP_LIKE()
</code>
</a>
and
similar functions (see
<a class="xref" href="regexp.html" title="14.8.2 Regular Expressions">
Section 14.8.2, “Regular Expressions”
</a>
). This limit
is expressed as the maximum permitted number of steps
performed by the match engine, and thus affects execution time
only indirectly. Typically, it is on the order of
milliseconds.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_require_row_format">
</a>
<a class="link" href="server-system-variables.html#sysvar_require_row_format">
<code class="literal">
require_row_format
</code>
</a>
</p>
<a class="indexterm" name="idm46045270677120">
</a>
<a class="indexterm" name="idm46045270676080">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for require_row_format">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_require_row_format">
require_row_format
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable is for internal server use by replication and
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
. It restricts DML events
executed in the session to events encoded in row-based binary
logging format only, and temporary tables cannot be created.
Queries that do not respect the restrictions fail.
</p>
<p>
Setting the session value of this system variable to
<code class="literal">
ON
</code>
requires no privileges. Setting the
session value of this system variable to
<code class="literal">
OFF
</code>
is a restricted operation, and the
session user must have privileges sufficient to set restricted
session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_require_secure_transport">
</a>
<a class="link" href="server-system-variables.html#sysvar_require_secure_transport">
<code class="literal">
require_secure_transport
</code>
</a>
</p>
<a class="indexterm" name="idm46045270649712">
</a>
<a class="indexterm" name="idm46045270648608">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for require_secure_transport">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--require-secure-transport[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_require_secure_transport">
require_secure_transport
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether client connections to the server are required to use
some form of secure transport. When this variable is enabled,
the server permits only TCP/IP connections encrypted using
TLS/SSL, or connections that use a socket file (on Unix) or
shared memory (on Windows). The server rejects nonsecure
connection attempts, which fail with an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_secure_transport_required" target="_top">
<code class="literal">
ER_SECURE_TRANSPORT_REQUIRED
</code>
</a>
error.
</p>
<p>
This capability supplements per-account SSL requirements,
which take precedence. For example, if an account is defined
with
<code class="literal">
REQUIRE SSL
</code>
, enabling
<a class="link" href="server-system-variables.html#sysvar_require_secure_transport">
<code class="literal">
require_secure_transport
</code>
</a>
does
not make it possible to use the account to connect using a
Unix socket file.
</p>
<p>
It is possible for a server to have no secure transports
available. For example, a server on Windows supports no secure
transports if started without specifying any SSL certificate
or key files and with the
<a class="link" href="server-system-variables.html#sysvar_shared_memory">
<code class="literal">
shared_memory
</code>
</a>
system variable
disabled. Under these conditions, attempts to enable
<a class="link" href="server-system-variables.html#sysvar_require_secure_transport">
<code class="literal">
require_secure_transport
</code>
</a>
at
startup cause the server to write a message to the error log
and exit. Attempts to enable the variable at runtime fail with
an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_no_secure_transports_configured" target="_top">
<code class="literal">
ER_NO_SECURE_TRANSPORTS_CONFIGURED
</code>
</a>
error.
</p>
<p>
See also
<a class="xref" href="using-encrypted-connections.html#mandatory-encrypted-connections" title="Configuring Encrypted Connections as Mandatory">
Configuring Encrypted Connections as Mandatory
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_restrict_fk_on_non_standard_key">
</a>
<a class="link" href="server-system-variables.html#sysvar_restrict_fk_on_non_standard_key">
<code class="literal">
restrict_fk_on_non_standard_key
</code>
</a>
</p>
<a class="indexterm" name="idm46045270614032">
</a>
<a class="indexterm" name="idm46045270612928">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for restrict_fk_on_non_standard_key">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--restrict-fk-on-non-standard-key
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_restrict_fk_on_non_standard_key">
restrict_fk_on_non_standard_key
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable, when
<code class="literal">
ON
</code>
(the default),
prevents the use of non-unique keys or partial keys as foreign
keys. To allow such keys to be used as foreign keys in the
current session, use
<code class="literal">
SET
@@session.restrict_fk_on_non_standard_key=OFF
</code>
; to
allow them to be used globally, set the global variable or
start the server with
<code class="option">
--skip-restrict-fk-on-non-standard-key
</code>
.
</p>
<p>
Using non-unique or partial keys as foreign keys in a
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
</code>
</a>
or
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
statement is
deprecated, and you should expect support for it to be removed
in a future version of MySQL. When
<code class="literal">
restrict_fk_on_non_standard_key
</code>
is
<code class="literal">
ON
</code>
, attempts to do so are rejected with
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_fk_no_index_parent" target="_top">
<code class="literal">
ER_FK_NO_INDEX_PARENT
</code>
</a>
; when it
is
<code class="literal">
OFF
</code>
, this usage is permitted but still
raises
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_warn_deprecated_non_standard_key" target="_top">
<code class="literal">
ER_WARN_DEPRECATED_NON_STANDARD_KEY
</code>
</a>
as a warning.
</p>
<p>
<code class="literal">
restrict_fk_on_non_standard_key
</code>
is
deprecated, and subject to removal in a future version of
MySQL. Setting it raises a deprecation warning.
</p>
<p>
<b>
Implication for MySQL Replication.
</b>
When a foreign key is created on a nonstandard key on the
primary because
<code class="literal">
restrict_fk_on_non_standard_key
</code>
is
<code class="literal">
OFF
</code>
, the statement succeeds on the
replica regardless of any setting on the replica for this
variable.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_resultset_metadata">
</a>
<a class="link" href="server-system-variables.html#sysvar_resultset_metadata">
<code class="literal">
resultset_metadata
</code>
</a>
</p>
<a class="indexterm" name="idm46045270572272">
</a>
<a class="indexterm" name="idm46045270571232">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for resultset_metadata">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_resultset_metadata">
resultset_metadata
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
FULL
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
FULL
</code>
</p>
<p class="valid-value">
<code class="literal">
NONE
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
For connections for which metadata transfer is optional, the
client sets the
<a class="link" href="server-system-variables.html#sysvar_resultset_metadata">
<code class="literal">
resultset_metadata
</code>
</a>
system
variable to control whether the server returns result set
metadata. Permitted values are
<code class="literal">
FULL
</code>
(return
all metadata; this is the default) and
<code class="literal">
NONE
</code>
(return no metadata).
</p>
<p>
For connections that are not metadata-optional, setting
<a class="link" href="server-system-variables.html#sysvar_resultset_metadata">
<code class="literal">
resultset_metadata
</code>
</a>
to
<code class="literal">
NONE
</code>
produces an error.
</p>
<p>
For details about managing result set metadata transfer, see
<a class="ulink" href="/doc/c-api/8.4/en/c-api-optional-metadata.html" target="_top">
Optional Result Set Metadata
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_secondary_engine_cost_threshold">
</a>
<a class="link" href="server-system-variables.html#sysvar_secondary_engine_cost_threshold">
<code class="literal">
secondary_engine_cost_threshold
</code>
</a>
</p>
<a class="indexterm" name="idm46045270538608">
</a>
<a class="indexterm" name="idm46045270537504">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for secondary_engine_cost_threshold">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_secondary_engine_cost_threshold">
secondary_engine_cost_threshold
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Numeric
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
100000.000000
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
DBL_MAX (maximum double value)
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The optimizer cost threshold for query offload to a secondary
engine.
</p>
<p>
For use with HeatWave. See
<a class="ulink" href="/doc/heatwave/en/" target="_top">
HeatWave User Guide
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_schema_definition_cache">
</a>
<a class="link" href="server-system-variables.html#sysvar_schema_definition_cache">
<code class="literal">
schema_definition_cache
</code>
</a>
</p>
<a class="indexterm" name="idm46045270509200">
</a>
<a class="indexterm" name="idm46045270508160">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for schema_definition_cache">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--schema-definition-cache=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_schema_definition_cache">
schema_definition_cache
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
256
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
256
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
524288
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Defines a limit for the number of schema definition objects,
both used and unused, that can be kept in the dictionary
object cache.
</p>
<p>
Unused schema definition objects are only kept in the
dictionary object cache when the number in use is less than
the capacity defined by
<code class="literal">
schema_definition_cache
</code>
.
</p>
<p>
A setting of
<code class="literal">
0
</code>
means that schema definition
objects are only kept in the dictionary object cache while
they are in use.
</p>
<p>
For more information, see
<a class="xref" href="data-dictionary-object-cache.html" title="16.4 Dictionary Object Cache">
Section 16.4, “Dictionary Object Cache”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_secure_file_priv">
</a>
<a class="link" href="server-system-variables.html#sysvar_secure_file_priv">
<code class="literal">
secure_file_priv
</code>
</a>
</p>
<a class="indexterm" name="idm46045270474960">
</a>
<a class="indexterm" name="idm46045270473872">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for secure_file_priv">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--secure-file-priv=dir_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_secure_file_priv">
secure_file_priv
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
platform specific
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
empty string
</code>
</p>
<p class="valid-value">
<code class="literal">
dirname
</code>
</p>
<p class="valid-value">
<code class="literal">
NULL
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable is used to limit the effect of data import and
export operations, such as those performed by the
<a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
<code class="literal">
LOAD DATA
</code>
</a>
and
<a class="link" href="select-into.html" title="15.2.13.1 SELECT ... INTO Statement">
<code class="literal">
SELECT ... INTO
OUTFILE
</code>
</a>
statements and the
<a class="link" href="string-functions.html#function_load-file">
<code class="literal">
LOAD_FILE()
</code>
</a>
function. These
operations are permitted only to users who have the
<a class="link" href="privileges-provided.html#priv_file">
<code class="literal">
FILE
</code>
</a>
privilege.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_secure_file_priv">
<code class="literal">
secure_file_priv
</code>
</a>
may be set
as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If empty, the variable has no effect. This is not a secure
setting.
</p>
</li>
<li class="listitem">
<p>
If set to the name of a directory, the server limits
import and export operations to work only with files in
that directory. The directory must exist; the server does
not create it.
</p>
</li>
<li class="listitem">
<p>
If set to
<code class="literal">
NULL
</code>
, the server disables
import and export operations.
</p>
</li>
</ul>
</div>
<p>
The default value is platform specific and depends on the
value of the
<a class="link" href="source-configuration-options.html#option_cmake_install_layout">
<code class="option">
INSTALL_LAYOUT
</code>
</a>
<span class="command">
<strong>
CMake
</strong>
</span>
option, as shown in the following
table. To specify the default
<a class="link" href="server-system-variables.html#sysvar_secure_file_priv">
<code class="literal">
secure_file_priv
</code>
</a>
value
explicitly if you are building from source, use the
<a class="link" href="source-configuration-options.html#option_cmake_install_secure_file_privdir">
<code class="option">
INSTALL_SECURE_FILE_PRIVDIR
</code>
</a>
<span class="command">
<strong>
CMake
</strong>
</span>
option.
</p>
<div class="informaltable">
<table summary="The default secure_file_priv value for different INSTALL_LAYOUT values.">
<colgroup>
<col style="width: 35%"/>
<col style="width: 65%"/>
</colgroup>
<thead>
<tr>
<th>
<code class="literal">
INSTALL_LAYOUT
</code>
Value
</th>
<th>
Default
<code class="literal">
secure_file_priv
</code>
Value
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="literal">
STANDALONE
</code>
</td>
<td>
empty
</td>
</tr>
<tr>
<td>
<code class="literal">
DEB
</code>
,
<code class="literal">
RPM
</code>
,
<code class="literal">
SVR4
</code>
</td>
<td>
<code class="filename">
/var/lib/mysql-files
</code>
</td>
</tr>
<tr>
<td>
Otherwise
</td>
<td>
<code class="filename">
mysql-files
</code>
under the
<a class="link" href="source-configuration-options.html#option_cmake_cmake_install_prefix">
<code class="option">
CMAKE_INSTALL_PREFIX
</code>
</a>
value
</td>
</tr>
</tbody>
</table>
</div>
<p>
The server checks the value of
<a class="link" href="server-system-variables.html#sysvar_secure_file_priv">
<code class="literal">
secure_file_priv
</code>
</a>
at startup
and writes a warning to the error log if the value is
insecure. A non-
<code class="literal">
NULL
</code>
value is considered
insecure if it is empty, or the value is the data directory or
a subdirectory of it, or a directory that is accessible by all
users. If
<a class="link" href="server-system-variables.html#sysvar_secure_file_priv">
<code class="literal">
secure_file_priv
</code>
</a>
is
set to a nonexistent path, the server writes an error message
to the error log and exits.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_select_into_buffer_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_select_into_buffer_size">
<code class="literal">
select_into_buffer_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045270407472">
</a>
<a class="indexterm" name="idm46045270406400">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for select_into_buffer_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--select-into-buffer-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_select_into_buffer_size">
select_into_buffer_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
131072
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
8192
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2147479552
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
4096
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
When using
<a class="link" href="select-into.html" title="15.2.13.1 SELECT ... INTO Statement">
<code class="literal">
SELECT
INTO OUTFILE
</code>
</a>
or
<code class="literal">
SELECT INTO
DUMPFILE
</code>
to dump data into one or more files for
backup creation, data migration, or other purposes, writes can
often be buffered and then trigger a large burst of write I/O
activity to the disk or other storage device and stall other
queries that are more sensitive to latency. You can use this
variable to control the size of the buffer used to write data
to the storage device to determine when buffer synchronization
should occur, and thus to prevent write stalls of the kind
just described from occurring.
</p>
<p>
<code class="literal">
select_into_buffer_size
</code>
overrides any value
set for
<a class="link" href="server-system-variables.html#sysvar_read_buffer_size">
<code class="literal">
read_buffer_size
</code>
</a>
.
(
<code class="literal">
select_into_buffer_size
</code>
and
<code class="literal">
read_buffer_size
</code>
have the same default,
maximum, and minimum values.) You can also use
<a class="link" href="server-system-variables.html#sysvar_select_into_disk_sync_delay">
<code class="literal">
select_into_disk_sync_delay
</code>
</a>
to set a timeout to be observed afterwards, each time
synchronization takes place.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_select_into_disk_sync">
</a>
<a class="link" href="server-system-variables.html#sysvar_select_into_disk_sync">
<code class="literal">
select_into_disk_sync
</code>
</a>
</p>
<a class="indexterm" name="idm46045270362800">
</a>
<a class="indexterm" name="idm46045270361728">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for select_into_disk_sync">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--select-into-disk-sync={ON|OFF}
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_select_into_disk_sync">
select_into_disk_sync
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
OFF
</code>
</p>
<p class="valid-value">
<code class="literal">
ON
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
When set on
<code class="literal">
ON
</code>
, enables buffer
synchronization of writes to an output file by a long-running
<a class="link" href="select-into.html" title="15.2.13.1 SELECT ... INTO Statement">
<code class="literal">
SELECT INTO
OUTFILE
</code>
</a>
or
<code class="literal">
SELECT INTO DUMPFILE
</code>
statement using
<a class="link" href="server-system-variables.html#sysvar_select_into_buffer_size">
<code class="literal">
select_into_buffer_size
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_select_into_disk_sync_delay">
</a>
<a class="link" href="server-system-variables.html#sysvar_select_into_disk_sync_delay">
<code class="literal">
select_into_disk_sync_delay
</code>
</a>
</p>
<a class="indexterm" name="idm46045270329488">
</a>
<a class="indexterm" name="idm46045270328400">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for select_into_disk_sync_delay">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--select-into-disk-sync-delay=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_select_into_disk_sync_delay">
select_into_disk_sync_delay
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
milliseconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
When buffer synchronization of writes to an output file by a
long-running
<a class="link" href="select-into.html" title="15.2.13.1 SELECT ... INTO Statement">
<code class="literal">
SELECT INTO
OUTFILE
</code>
</a>
or
<code class="literal">
SELECT INTO DUMPFILE
</code>
statement is enabled by
<a class="link" href="server-system-variables.html#sysvar_select_into_disk_sync">
<code class="literal">
select_into_disk_sync
</code>
</a>
, this
variable sets an optional delay (in milliseconds) following
synchronization.
<code class="literal">
0
</code>
(the default) means no
delay.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_session_track_gtids">
</a>
<a class="link" href="server-system-variables.html#sysvar_session_track_gtids">
<code class="literal">
session_track_gtids
</code>
</a>
</p>
<a class="indexterm" name="idm46045270291392">
</a>
<a class="indexterm" name="idm46045270290352">
</a>
<a class="indexterm" name="idm46045270288864">
</a>
<a class="indexterm" name="idm46045270287776">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for session_track_gtids">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--session-track-gtids=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_session_track_gtids">
session_track_gtids
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
OFF
</code>
</p>
<p class="valid-value">
<code class="literal">
OWN_GTID
</code>
</p>
<p class="valid-value">
<code class="literal">
ALL_GTIDS
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Controls whether the server returns GTIDs to the client,
enabling the client to use them to track the server state.
Depending on the variable value, at the end of executing each
transaction, the server’s GTIDs are captured and returned to
the client as part of the acknowledgement. The possible values
for
<a class="link" href="server-system-variables.html#sysvar_session_track_gtids">
<code class="literal">
session_track_gtids
</code>
</a>
are
as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
OFF
</code>
: The server does not return GTIDs
to the client. This is the default.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
OWN_GTID
</code>
: The server returns the GTIDs
for all transactions that were successfully committed by
this client in its current session since the last
acknowledgement. Typically, this is the single GTID for
the last transaction committed, but if a single client
request resulted in multiple transactions, the server
returns a GTID set containing all the relevant GTIDs.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ALL_GTIDS
</code>
: The server returns the
global value of its
<a class="link" href="replication-options-gtids.html#sysvar_gtid_executed">
<code class="literal">
gtid_executed
</code>
</a>
system
variable, which it reads at a point after the transaction
is successfully committed. As well as the GTID for the
transaction just committed, this GTID set includes all
transactions committed on the server by any client, and
can include transactions committed after the point when
the transaction currently being acknowledged was
committed.
</p>
</li>
</ul>
</div>
<p>
<a class="link" href="server-system-variables.html#sysvar_session_track_gtids">
<code class="literal">
session_track_gtids
</code>
</a>
cannot be
set within transactional context.
</p>
<p>
For more information about session state tracking, see
<a class="xref" href="session-state-tracking.html" title="7.1.18 Server Tracking of Client Session State">
Section 7.1.18, “Server Tracking of Client Session State”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_session_track_schema">
</a>
<a class="link" href="server-system-variables.html#sysvar_session_track_schema">
<code class="literal">
session_track_schema
</code>
</a>
</p>
<a class="indexterm" name="idm46045270246336">
</a>
<a class="indexterm" name="idm46045270245296">
</a>
<a class="indexterm" name="idm46045270243808">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for session_track_schema">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--session-track-schema[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_session_track_schema">
session_track_schema
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Controls whether the server tracks when the default schema
(database) is set within the current session and notifies the
client to make the schema name available.
</p>
<p>
If the schema name tracker is enabled, name notification
occurs each time the default schema is set, even if the new
schema name is the same as the old.
</p>
<p>
For more information about session state tracking, see
<a class="xref" href="session-state-tracking.html" title="7.1.18 Server Tracking of Client Session State">
Section 7.1.18, “Server Tracking of Client Session State”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_session_track_state_change">
</a>
<a class="link" href="server-system-variables.html#sysvar_session_track_state_change">
<code class="literal">
session_track_state_change
</code>
</a>
</p>
<a class="indexterm" name="idm46045270217808">
</a>
<a class="indexterm" name="idm46045270216704">
</a>
<a class="indexterm" name="idm46045270215200">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for session_track_state_change">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--session-track-state-change[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_session_track_state_change">
session_track_state_change
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Controls whether the server tracks changes to the state of the
current session and notifies the client when state changes
occur. Changes can be reported for these attributes of client
session state:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
The default schema (database).
</p>
</li>
<li class="listitem">
<p>
Session-specific values for system variables.
</p>
</li>
<li class="listitem">
<p>
User-defined variables.
</p>
</li>
<li class="listitem">
<p>
Temporary tables.
</p>
</li>
<li class="listitem">
<p>
Prepared statements.
</p>
</li>
</ul>
</div>
<p>
If the session state tracker is enabled, notification occurs
for each change that involves tracked session attributes, even
if the new attribute values are the same as the old. For
example, setting a user-defined variable to its current value
results in a notification.
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_session_track_state_change">
<code class="literal">
session_track_state_change
</code>
</a>
variable controls only notification of when changes occur, not
what the changes are. For example, state-change notifications
occur when the default schema is set or tracked session system
variables are assigned, but the notification does not include
the schema name or variable values. To receive notification of
the schema name or session system variable values, use the
<a class="link" href="server-system-variables.html#sysvar_session_track_schema">
<code class="literal">
session_track_schema
</code>
</a>
or
<a class="link" href="server-system-variables.html#sysvar_session_track_system_variables">
<code class="literal">
session_track_system_variables
</code>
</a>
system variable, respectively.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Assigning a value to
<a class="link" href="server-system-variables.html#sysvar_session_track_state_change">
<code class="literal">
session_track_state_change
</code>
</a>
itself is not considered a state change and is not reported
as such. However, if its name listed in the value of
<a class="link" href="server-system-variables.html#sysvar_session_track_system_variables">
<code class="literal">
session_track_system_variables
</code>
</a>
,
any assignments to it do result in notification of the new
value.
</p>
</div>
<p>
For more information about session state tracking, see
<a class="xref" href="session-state-tracking.html" title="7.1.18 Server Tracking of Client Session State">
Section 7.1.18, “Server Tracking of Client Session State”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_session_track_system_variables">
</a>
<a class="link" href="server-system-variables.html#sysvar_session_track_system_variables">
<code class="literal">
session_track_system_variables
</code>
</a>
</p>
<a class="indexterm" name="idm46045270176064">
</a>
<a class="indexterm" name="idm46045270174960">
</a>
<a class="indexterm" name="idm46045270173456">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for session_track_system_variables">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--session-track-system-variables=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_session_track_system_variables">
session_track_system_variables
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
time_zone, autocommit, character_set_client, character_set_results, character_set_connection
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Controls whether the server tracks assignments to session
system variables and notifies the client of the name and value
of each assigned variable. The variable value is a
comma-separated list of variables for which to track
assignments. By default, notification is enabled for
<a class="link" href="server-system-variables.html#sysvar_time_zone">
<code class="literal">
time_zone
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_autocommit">
<code class="literal">
autocommit
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_character_set_client">
<code class="literal">
character_set_client
</code>
</a>
,
<a class="link" href="server-system-variables.html#sysvar_character_set_results">
<code class="literal">
character_set_results
</code>
</a>
, and
<a class="link" href="server-system-variables.html#sysvar_character_set_connection">
<code class="literal">
character_set_connection
</code>
</a>
.
(The latter three variables are those affected by
<a class="link" href="set-names.html" title="15.7.6.3 SET NAMES Statement">
<code class="literal">
SET NAMES
</code>
</a>
.)
</p>
<p>
To enable display of the Statement ID for each statement
processed, use the
<code class="literal">
statement_id
</code>
variable.
For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa91062243"><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></span> <span class="token keyword">SET</span> <span class="token variable">@@SESSION.session_track_system_variables</span><span class="token operator">=</span><span class="token string">'statement_id'</span>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token number">1</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>
<span class="token output"><span class="token punctuation">|</span> 1 <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>
<span class="token output"><span class="token punctuation">|</span> 1 <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>
<span class="token output">1 row in set (0.0006 sec)</span>
Statement ID: <span class="token number">603835</span></code></pre>
</div>
<p>
The special value
<code class="literal">
*
</code>
(asterisk) causes the
server to track assignments to all session variables. If
given, this value must be specified by itself without specific
system variable names. This value also enables display of the
Statement ID for each successful statement processed.
</p>
<p>
To disable notification of session variable assignments, set
<a class="link" href="server-system-variables.html#sysvar_session_track_system_variables">
<code class="literal">
session_track_system_variables
</code>
</a>
to the empty string.
</p>
<p>
If session system variable tracking is enabled, notification
occurs for all assignments to tracked session variables, even
if the new values are the same as the old.
</p>
<p>
For more information about session state tracking, see
<a class="xref" href="session-state-tracking.html" title="7.1.18 Server Tracking of Client Session State">
Section 7.1.18, “Server Tracking of Client Session State”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_session_track_transaction_info">
</a>
<a class="link" href="server-system-variables.html#sysvar_session_track_transaction_info">
<code class="literal">
session_track_transaction_info
</code>
</a>
</p>
<a class="indexterm" name="idm46045270133664">
</a>
<a class="indexterm" name="idm46045270132560">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for session_track_transaction_info">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--session-track-transaction-info=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_session_track_transaction_info">
session_track_transaction_info
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
OFF
</code>
</p>
<p class="valid-value">
<code class="literal">
STATE
</code>
</p>
<p class="valid-value">
<code class="literal">
CHARACTERISTICS
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Controls whether the server tracks the state and
characteristics of transactions within the current session and
notifies the client to make this information available. These
<a class="link" href="server-system-variables.html#sysvar_session_track_transaction_info">
<code class="literal">
session_track_transaction_info
</code>
</a>
values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
OFF
</code>
: Disable transaction state
tracking. This is the default.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
STATE
</code>
: Enable transaction state
tracking without characteristics tracking. State tracking
enables the client to determine whether a transaction is
in progress and whether it could be moved to a different
session without being rolled back.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
CHARACTERISTICS
</code>
: Enable transaction
state tracking, including characteristics tracking.
Characteristics tracking enables the client to determine
how to restart a transaction in another session so that it
has the same characteristics as in the original session.
The following characteristics are relevant for this
purpose:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-simple"><div class="docs-select-all right" id="sa53872801"><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-simple">ISOLATION LEVEL
READ ONLY
READ WRITE
WITH CONSISTENT SNAPSHOT</code></pre>
</div>
</li>
</ul>
</div>
<p>
For a client to safely relocate a transaction to another
session, it must track not only transaction state but also
transaction characteristics. In addition, the client must
track the
<a class="link" href="server-system-variables.html#sysvar_transaction_isolation">
<code class="literal">
transaction_isolation
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_transaction_read_only">
<code class="literal">
transaction_read_only
</code>
</a>
system
variables to correctly determine the session defaults. (To
track these variables, list them in the value of the
<a class="link" href="server-system-variables.html#sysvar_session_track_system_variables">
<code class="literal">
session_track_system_variables
</code>
</a>
system variable.)
</p>
<p>
For more information about session state tracking, see
<a class="xref" href="session-state-tracking.html" title="7.1.18 Server Tracking of Client Session State">
Section 7.1.18, “Server Tracking of Client Session State”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_set_operations_buffer_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_set_operations_buffer_size">
<code class="literal">
set_operations_buffer_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045270089440">
</a>
<a class="indexterm" name="idm46045270088336">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for set_operations_buffer_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--set-operations-buffer-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_set_operations_buffer_size">
set_operations_buffer_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
256K
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
16K
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
1 GB
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Sets the buffer size for
<a class="link" href="intersect.html" title="15.2.8 INTERSECT Clause">
<code class="literal">
INTERSECT
</code>
</a>
and
<a class="link" href="except.html" title="15.2.4 EXCEPT Clause">
<code class="literal">
EXCEPT
</code>
</a>
operations that use hash
tables when the
<a class="link" href="switchable-optimizations.html#optflag_hash-set-operations">
<code class="literal">
hash_set_operations
</code>
</a>
optimizer switch is
<code class="literal">
ON
</code>
. In general,
increasing the size of this buffer improves performance of
these operations when the hashing optimization is enabled.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sha256_password_auto_generate_rsa_keys">
</a>
<a class="link" href="server-system-variables.html#sysvar_sha256_password_auto_generate_rsa_keys">
<code class="literal">
sha256_password_auto_generate_rsa_keys
</code>
</a>
</p>
<a class="indexterm" name="idm46045270054144">
</a>
<a class="indexterm" name="idm46045270053104">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sha256_password_auto_generate_rsa_keys">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--sha256-password-auto-generate-rsa-keys[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sha256_password_auto_generate_rsa_keys">
sha256_password_auto_generate_rsa_keys
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The server uses this variable to determine whether to
autogenerate RSA private/public key-pair files in the data
directory if they do not already exist.
</p>
<p>
At startup, the server automatically generates RSA
private/public key-pair files in the data directory if all of
these conditions are true: The
<a class="link" href="server-system-variables.html#sysvar_sha256_password_auto_generate_rsa_keys">
<code class="literal">
sha256_password_auto_generate_rsa_keys
</code>
</a>
or
<a class="link" href="server-system-variables.html#sysvar_caching_sha2_password_auto_generate_rsa_keys">
<code class="literal">
caching_sha2_password_auto_generate_rsa_keys
</code>
</a>
system variable is enabled; no RSA options are specified; the
RSA files are missing from the data directory. These key-pair
files enable secure password exchange using RSA over
unencrypted connections for accounts authenticated by the
<code class="literal">
sha256_password
</code>
(deprecated) or
<code class="literal">
caching_sha2_password
</code>
plugin; see
<a class="xref" href="sha256-pluggable-authentication.html" title="8.4.1.3 SHA-256 Pluggable Authentication">
Section 8.4.1.3, “SHA-256 Pluggable Authentication”
</a>
, and
<a class="xref" href="caching-sha2-pluggable-authentication.html" title="8.4.1.2 Caching SHA-2 Pluggable Authentication">
Section 8.4.1.2, “Caching SHA-2 Pluggable Authentication”
</a>
.
</p>
<p>
For more information about RSA file autogeneration, including
file names and characteristics, see
<a class="xref" href="creating-ssl-rsa-files-using-mysql.html" title="8.3.3.1 Creating SSL and RSA Certificates and Keys using MySQL">
Section 8.3.3.1, “Creating SSL and RSA Certificates and Keys using MySQL”
</a>
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_auto_generate_certs">
<code class="literal">
auto_generate_certs
</code>
</a>
system variable is related but controls autogeneration of SSL
certificate and key files needed for secure connections using
SSL.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sha256_password_private_key_path">
</a>
<a class="link" href="server-system-variables.html#sysvar_sha256_password_private_key_path">
<code class="literal">
sha256_password_private_key_path
</code>
</a>
</p>
<a class="indexterm" name="idm46045270016928">
</a>
<a class="indexterm" name="idm46045270015824">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sha256_password_private_key_path">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--sha256-password-private-key-path=file_name
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sha256_password_private_key_path">
sha256_password_private_key_path
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
private_key.pem
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The value of this variable is the path name of the RSA private
key file for the
<code class="literal">
sha256_password
</code>
(deprecated) authentication plugin. If the file is named as a
relative path, it is interpreted relative to the server data
directory. The file must be in PEM format.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
Because this file stores a private key, its access mode
should be restricted so that only the MySQL server can read
it.
</p>
</div>
<p>
For information about
<code class="literal">
sha256_password
</code>
, see
<a class="xref" href="sha256-pluggable-authentication.html" title="8.4.1.3 SHA-256 Pluggable Authentication">
Section 8.4.1.3, “SHA-256 Pluggable Authentication”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sha256_password_proxy_users">
</a>
<a class="link" href="server-system-variables.html#sysvar_sha256_password_proxy_users">
<code class="literal">
sha256_password_proxy_users
</code>
</a>
</p>
<a class="indexterm" name="idm46045269985456">
</a>
<a class="indexterm" name="idm46045269984352">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sha256_password_proxy_users">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--sha256-password-proxy-users[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sha256_password_proxy_users">
sha256_password_proxy_users
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls whether the
<code class="literal">
sha256_password
</code>
(deprecated) built-in
authentication plugin supports proxy users. It has no effect
unless the
<a class="link" href="server-system-variables.html#sysvar_check_proxy_users">
<code class="literal">
check_proxy_users
</code>
</a>
system variable is enabled. For information about user
proxying, see
<a class="xref" href="proxy-users.html" title="8.2.19 Proxy Users">
Section 8.2.19, “Proxy Users”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sha256_password_public_key_path">
</a>
<a class="link" href="server-system-variables.html#sysvar_sha256_password_public_key_path">
<code class="literal">
sha256_password_public_key_path
</code>
</a>
</p>
<a class="indexterm" name="idm46045269954928">
</a>
<a class="indexterm" name="idm46045269953824">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sha256_password_public_key_path">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--sha256-password-public-key-path=file_name
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sha256_password_public_key_path">
sha256_password_public_key_path
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
public_key.pem
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The value of this variable is the path name of the RSA public
key file for the
<code class="literal">
sha256_password
</code>
(deprecated) authentication plugin. If the file is named as a
relative path, it is interpreted relative to the server data
directory. The file must be in PEM format. Because this file
stores a public key, copies can be freely distributed to
client users. (Clients that explicitly specify a public key
when connecting to the server using RSA password encryption
must use the same public key as that used by the server.)
</p>
<p>
For information about
<code class="literal">
sha256_password
</code>
(deprecated), including information about how clients specify
the RSA public key, see
<a class="xref" href="sha256-pluggable-authentication.html" title="8.4.1.3 SHA-256 Pluggable Authentication">
Section 8.4.1.3, “SHA-256 Pluggable Authentication”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_shared_memory">
</a>
<a class="link" href="server-system-variables.html#sysvar_shared_memory">
<code class="literal">
shared_memory
</code>
</a>
</p>
<a class="indexterm" name="idm46045269924032">
</a>
<a class="indexterm" name="idm46045269922944">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for shared_memory">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--shared-memory[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_shared_memory">
shared_memory
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Platform Specific
</th>
<td>
Windows
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
(Windows only.) Whether the server permits shared-memory
connections.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_shared_memory_base_name">
</a>
<a class="link" href="server-system-variables.html#sysvar_shared_memory_base_name">
<code class="literal">
shared_memory_base_name
</code>
</a>
</p>
<a class="indexterm" name="idm46045269896288">
</a>
<a class="indexterm" name="idm46045269895248">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for shared_memory_base_name">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--shared-memory-base-name=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_shared_memory_base_name">
shared_memory_base_name
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Platform Specific
</th>
<td>
Windows
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
MYSQL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
(Windows only.) The name of shared memory to use for
shared-memory connections. This is useful when running
multiple MySQL instances on a single physical machine. The
default name is
<code class="literal">
MYSQL
</code>
. The name is
case-sensitive.
</p>
<p>
This variable applies only if the server is started with the
<a class="link" href="server-system-variables.html#sysvar_shared_memory">
<code class="literal">
shared_memory
</code>
</a>
system variable
enabled to support shared-memory connections.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_show_create_table_skip_secondary_engine">
</a>
<a class="link" href="server-system-variables.html#sysvar_show_create_table_skip_secondary_engine">
<code class="literal">
show_create_table_skip_secondary_engine
</code>
</a>
</p>
<a class="indexterm" name="idm46045269865776">
</a>
<a class="indexterm" name="idm46045269864736">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for show_create_table_skip_secondary_engine">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--show-create-table-skip-secondary-engine[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_show_create_table_skip_secondary_engine">
show_create_table_skip_secondary_engine
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Enabling
<a class="link" href="server-system-variables.html#sysvar_show_create_table_skip_secondary_engine">
<code class="literal">
show_create_table_skip_secondary_engine
</code>
</a>
causes the
<code class="literal">
SECONDARY ENGINE
</code>
clause to be
excluded from
<a class="link" href="show-create-table.html" title="15.7.7.11 SHOW CREATE TABLE Statement">
<code class="literal">
SHOW CREATE TABLE
</code>
</a>
output, and from
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
</code>
</a>
statements dumped by the
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
utility.
</p>
<p>
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
provides the
<a class="link" href="mysqldump.html#option_mysqldump_show-create-skip-secondary-engine">
<code class="option">
--show-create-skip-secondary-engine
</code>
</a>
option. When specified, it enables the
<a class="link" href="server-system-variables.html#sysvar_show_create_table_skip_secondary_engine">
<code class="literal">
show_create_table_skip_secondary_engine
</code>
</a>
system variable for the duration of the dump operation.
</p>
<p>
For use with HeatWave. See
<a class="ulink" href="/doc/heatwave/en/" target="_top">
HeatWave User Guide
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_show_create_table_verbosity">
</a>
<a class="link" href="server-system-variables.html#sysvar_show_create_table_verbosity">
<code class="literal">
show_create_table_verbosity
</code>
</a>
</p>
<a class="indexterm" name="idm46045269829120">
</a>
<a class="indexterm" name="idm46045269828016">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for show_create_table_verbosity">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--show-create-table-verbosity[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_show_create_table_verbosity">
show_create_table_verbosity
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
<a class="link" href="show-create-table.html" title="15.7.7.11 SHOW CREATE TABLE Statement">
<code class="literal">
SHOW CREATE TABLE
</code>
</a>
normally does
not show the
<code class="literal">
ROW_FORMAT
</code>
table option if the
row format is the default format. Enabling this variable
causes
<a class="link" href="show-create-table.html" title="15.7.7.11 SHOW CREATE TABLE Statement">
<code class="literal">
SHOW CREATE TABLE
</code>
</a>
to
display
<code class="literal">
ROW_FORMAT
</code>
regardless of whether it
is the default format.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_show_gipk_in_create_table_and_information_schema">
</a>
<a class="link" href="server-system-variables.html#sysvar_show_gipk_in_create_table_and_information_schema">
<code class="literal">
show_gipk_in_create_table_and_information_schema
</code>
</a>
</p>
<a class="indexterm" name="idm46045269799312">
</a>
<a class="indexterm" name="idm46045269798192">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for show_gipk_in_create_table_and_information_schema">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--show-gipk-in-create-table-and-information-schema[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_show_gipk_in_create_table_and_information_schema">
show_gipk_in_create_table_and_information_schema
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether generated invisible primary keys are visible in the
output of
<a class="link" href="show.html" title="15.7.7 SHOW Statements">
<code class="literal">
SHOW
</code>
</a>
statements and
in Information Schema tables. When this variable is set to
<code class="literal">
OFF
</code>
, such keys are not shown.
</p>
<p>
This variable is not replicated.
</p>
<p>
For more information, see
<a class="xref" href="create-table-gipks.html" title="15.1.20.11 Generated Invisible Primary Keys">
Section 15.1.20.11, “Generated Invisible Primary Keys”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_skip_external_locking">
</a>
<a class="link" href="server-system-variables.html#sysvar_skip_external_locking">
<code class="literal">
skip_external_locking
</code>
</a>
</p>
<a class="indexterm" name="idm46045269769872">
</a>
<a class="indexterm" name="idm46045269768800">
</a>
<a class="indexterm" name="idm46045269767312">
</a>
<a class="indexterm" name="idm46045269766272">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for skip_external_locking">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--skip-external-locking[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_skip_external_locking">
skip_external_locking
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This is
<code class="literal">
OFF
</code>
if
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
uses external locking (system locking),
<code class="literal">
ON
</code>
if external locking is disabled. This affects only
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
table access.
</p>
<p>
This variable is set by the
<a class="link" href="server-options.html#option_mysqld_external-locking">
<code class="option">
--external-locking
</code>
</a>
or
<a class="link" href="server-options.html#option_mysqld_external-locking">
<code class="option">
--skip-external-locking
</code>
</a>
option. External locking is disabled by default.
</p>
<p>
External locking affects only
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
table access. For more
information, including conditions under which it can and
cannot be used, see
<a class="xref" href="external-locking.html" title="10.11.5 External Locking">
Section 10.11.5, “External Locking”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_skip_name_resolve">
</a>
<a class="link" href="server-system-variables.html#sysvar_skip_name_resolve">
<code class="literal">
skip_name_resolve
</code>
</a>
</p>
<a class="indexterm" name="idm46045269732896">
</a>
<a class="indexterm" name="idm46045269731856">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for skip_name_resolve">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--skip-name-resolve[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_skip_name_resolve">
skip_name_resolve
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether to resolve host names when checking client
connections. If this variable is
<code class="literal">
OFF
</code>
,
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
resolves host names when checking
client connections. If it is
<code class="literal">
ON
</code>
,
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
uses only IP numbers; in this case,
all
<code class="literal">
Host
</code>
column values in the grant tables
must be IP addresses. See
<a class="xref" href="host-cache.html" title="7.1.12.3 DNS Lookups and the Host Cache">
Section 7.1.12.3, “DNS Lookups and the Host Cache”
</a>
.
</p>
<p>
Depending on the network configuration of your system and the
<code class="literal">
Host
</code>
values for your accounts, clients may
need to connect using an explicit
<a class="link" href="connection-options.html#option_general_host">
<code class="option">
--host
</code>
</a>
option, such as
<a class="link" href="connection-options.html#option_general_host">
<code class="option">
--host=127.0.0.1
</code>
</a>
or
<a class="link" href="connection-options.html#option_general_host">
<code class="option">
--host=::1
</code>
</a>
.
</p>
<a class="indexterm" name="idm46045269700160">
</a>
<p>
An attempt to connect to the host
<code class="literal">
127.0.0.1
</code>
normally resolves to the
<code class="literal">
localhost
</code>
account.
However, this fails if the server is run with
<a class="link" href="server-system-variables.html#sysvar_skip_name_resolve">
<code class="literal">
skip_name_resolve
</code>
</a>
enabled. If
you plan to do that, make sure an account exists that can
accept a connection. For example, to be able to connect as
<code class="literal">
root
</code>
using
<a class="link" href="connection-options.html#option_general_host">
<code class="option">
--host=127.0.0.1
</code>
</a>
or
<a class="link" href="connection-options.html#option_general_host">
<code class="option">
--host=::1
</code>
</a>
, create these
accounts:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa50995778"><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">CREATE</span> <span class="token keyword">USER</span> <span class="token string">'root'</span>@<span class="token string">'127.0.0.1'</span> <span class="token keyword">IDENTIFIED</span> <span class="token keyword">BY</span> <span class="token string">'<em class="replaceable">root-password</em>'</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">USER</span> <span class="token string">'root'</span>@<span class="token string">'::1'</span> <span class="token keyword">IDENTIFIED</span> <span class="token keyword">BY</span> <span class="token string">'<em class="replaceable">root-password</em>'</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_skip_networking">
</a>
<a class="link" href="server-system-variables.html#sysvar_skip_networking">
<code class="literal">
skip_networking
</code>
</a>
</p>
<a class="indexterm" name="idm46045269688784">
</a>
<a class="indexterm" name="idm46045269687696">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for skip_networking">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--skip-networking[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_skip_networking">
skip_networking
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls whether the server permits TCP/IP
connections. By default, it is disabled (permit TCP
connections). If enabled, the server permits only local
(non-TCP/IP) connections and all interaction with
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
must be made using named pipes or
shared memory (on Windows) or Unix socket files (on Unix).
This option is highly recommended for systems where only local
clients are permitted. See
<a class="xref" href="host-cache.html" title="7.1.12.3 DNS Lookups and the Host Cache">
Section 7.1.12.3, “DNS Lookups and the Host Cache”
</a>
.
</p>
<p>
Because starting the server with
<a class="link" href="server-options.html#option_mysqld_skip-grant-tables">
<code class="option">
--skip-grant-tables
</code>
</a>
disables
authentication checks, the server also disables remote
connections in that case by enabling
<a class="link" href="server-system-variables.html#sysvar_skip_networking">
<code class="literal">
skip_networking
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_skip_show_database">
</a>
<a class="link" href="server-system-variables.html#sysvar_skip_show_database">
<code class="literal">
skip_show_database
</code>
</a>
</p>
<a class="indexterm" name="idm46045269658096">
</a>
<a class="indexterm" name="idm46045269657056">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for skip-show-database">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--skip-show-database
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_skip_show_database">
skip_show_database
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This prevents people from using the
<a class="link" href="show-databases.html" title="15.7.7.15 SHOW DATABASES Statement">
<code class="literal">
SHOW
DATABASES
</code>
</a>
statement if they do not have the
<a class="link" href="privileges-provided.html#priv_show-databases">
<code class="literal">
SHOW DATABASES
</code>
</a>
privilege. This
can improve security if you have concerns about users being
able to see databases belonging to other users. Its effect
depends on the
<a class="link" href="privileges-provided.html#priv_show-databases">
<code class="literal">
SHOW DATABASES
</code>
</a>
privilege: If the variable value is
<code class="literal">
ON
</code>
, the
<a class="link" href="show-databases.html" title="15.7.7.15 SHOW DATABASES Statement">
<code class="literal">
SHOW DATABASES
</code>
</a>
statement is
permitted only to users who have the
<a class="link" href="privileges-provided.html#priv_show-databases">
<code class="literal">
SHOW
DATABASES
</code>
</a>
privilege, and the statement displays all
database names. If the value is
<code class="literal">
OFF
</code>
,
<a class="link" href="show-databases.html" title="15.7.7.15 SHOW DATABASES Statement">
<code class="literal">
SHOW DATABASES
</code>
</a>
is permitted to
all users, but displays the names of only those databases for
which the user has the
<a class="link" href="privileges-provided.html#priv_show-databases">
<code class="literal">
SHOW
DATABASES
</code>
</a>
or other privilege.
</p>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Caution
</div>
<p>
Because any static global privilege is considered a
privilege for all databases, any static global privilege
enables a user to see all database names with
<a class="link" href="show-databases.html" title="15.7.7.15 SHOW DATABASES Statement">
<code class="literal">
SHOW DATABASES
</code>
</a>
or by
examining the
<a class="link" href="information-schema-schemata-table.html" title="28.3.31 The INFORMATION_SCHEMA SCHEMATA Table">
<code class="literal">
SCHEMATA
</code>
</a>
table of
<code class="literal">
INFORMATION_SCHEMA
</code>
, except databases that
have been restricted at the database level by partial
revokes.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_slow_launch_time">
</a>
<a class="link" href="server-system-variables.html#sysvar_slow_launch_time">
<code class="literal">
slow_launch_time
</code>
</a>
</p>
<a class="indexterm" name="idm46045269617456">
</a>
<a class="indexterm" name="idm46045269616368">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for slow_launch_time">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--slow-launch-time=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_slow_launch_time">
slow_launch_time
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
2
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
If creating a thread takes longer than this many seconds, the
server increments the
<a class="link" href="server-status-variables.html#statvar_Slow_launch_threads">
<code class="literal">
Slow_launch_threads
</code>
</a>
status
variable.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_slow_query_log">
</a>
<a class="link" href="server-system-variables.html#sysvar_slow_query_log">
<code class="literal">
slow_query_log
</code>
</a>
</p>
<a class="indexterm" name="idm46045269583680">
</a>
<a class="indexterm" name="idm46045269582592">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for slow_query_log">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--slow-query-log[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_slow_query_log">
slow_query_log
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether the slow query log is enabled. The value can be 0 (or
<code class="literal">
OFF
</code>
) to disable the log or 1 (or
<code class="literal">
ON
</code>
) to enable the log. The destination for
log output is controlled by the
<a class="link" href="server-system-variables.html#sysvar_log_output">
<code class="literal">
log_output
</code>
</a>
system variable;
if that value is
<code class="literal">
NONE
</code>
, no log entries are
written even if the log is enabled.
</p>
<p>
<span class="quote">
“
<span class="quote">
Slow
</span>
”
</span>
is determined by the value of the
<a class="link" href="server-system-variables.html#sysvar_long_query_time">
<code class="literal">
long_query_time
</code>
</a>
variable. See
<a class="xref" href="slow-query-log.html" title="7.4.5 The Slow Query Log">
Section 7.4.5, “The Slow Query Log”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_slow_query_log_file">
</a>
<a class="link" href="server-system-variables.html#sysvar_slow_query_log_file">
<code class="literal">
slow_query_log_file
</code>
</a>
</p>
<a class="indexterm" name="idm46045269551744">
</a>
<a class="indexterm" name="idm46045269550704">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for slow_query_log_file">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--slow-query-log-file=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_slow_query_log_file">
slow_query_log_file
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
host_name-slow.log
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The name of the slow query log file. The default value is
<code class="filename">
<em class="replaceable">
<code>
host_name
</code>
</em>
-slow.log
</code>
,
but the initial value can be changed with the
<code class="literal">
--slow_query_log_file
</code>
option.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_socket">
</a>
<a class="link" href="server-system-variables.html#sysvar_socket">
<code class="literal">
socket
</code>
</a>
</p>
<a class="indexterm" name="idm46045269524448">
</a>
<a class="indexterm" name="idm46045269523376">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for socket">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--socket={file_name|pipe_name}
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_socket">
socket
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value (Windows)
</th>
<td>
<code class="literal">
MySQL
</code>
</td>
</tr>
<tr>
<th>
Default Value (Other)
</th>
<td>
<code class="literal">
/tmp/mysql.sock
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
On Unix platforms, this variable is the name of the socket
file that is used for local client connections. The default is
<code class="filename">
/tmp/mysql.sock
</code>
. (For some distribution
formats, the directory might be different, such as
<code class="filename">
/var/lib/mysql
</code>
for RPMs.)
</p>
<p>
On Windows, this variable is the name of the named pipe that
is used for local client connections. The default value is
<code class="literal">
MySQL
</code>
(not case-sensitive).
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sort_buffer_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_sort_buffer_size">
<code class="literal">
sort_buffer_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045269493552">
</a>
<a class="indexterm" name="idm46045269492464">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sort_buffer_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--sort-buffer-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sort_buffer_size">
sort_buffer_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
262144
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
32768
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Windows)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Other, 64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Other, 32-bit platforms)
</th>
<td>
<code class="literal">
4294967295
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
Each session that must perform a sort allocates a buffer of
this size.
<a class="link" href="server-system-variables.html#sysvar_sort_buffer_size">
<code class="literal">
sort_buffer_size
</code>
</a>
is not specific to any storage engine and applies in a general
manner for optimization. At minimum the
<a class="link" href="server-system-variables.html#sysvar_sort_buffer_size">
<code class="literal">
sort_buffer_size
</code>
</a>
value must
be large enough to accommodate fifteen tuples in the sort
buffer. Also, increasing the value of
<a class="link" href="server-system-variables.html#sysvar_max_sort_length">
<code class="literal">
max_sort_length
</code>
</a>
may require
increasing the value of
<a class="link" href="server-system-variables.html#sysvar_sort_buffer_size">
<code class="literal">
sort_buffer_size
</code>
</a>
. For more
information, see
<a class="xref" href="order-by-optimization.html" title="10.2.1.16 ORDER BY Optimization">
Section 10.2.1.16, “ORDER BY Optimization”
</a>
</p>
<p>
If you see many
<a class="link" href="server-status-variables.html#statvar_Sort_merge_passes">
<code class="literal">
Sort_merge_passes
</code>
</a>
per second
in
<a class="link" href="show-status.html" title="15.7.7.37 SHOW STATUS Statement">
<code class="literal">
SHOW GLOBAL
STATUS
</code>
</a>
output, you can consider increasing the
<a class="link" href="server-system-variables.html#sysvar_sort_buffer_size">
<code class="literal">
sort_buffer_size
</code>
</a>
value to
speed up
<code class="literal">
ORDER BY
</code>
or
<code class="literal">
GROUP
BY
</code>
operations that cannot be improved with query
optimization or improved indexing.
</p>
<p>
The optimizer tries to work out how much space is needed but
can allocate more, up to the limit. Setting it larger than
required globally slows down most queries that perform sorts.
It is best to increase it as a session setting, and only for
the sessions that need a larger size. On Linux, there are
thresholds of 256KB and 2MB where larger values may
significantly slow down memory allocation, so you should
consider staying below one of those values. Experiment to find
the best value for your workload. See
<a class="xref" href="temporary-files.html" title="B.3.3.5 Where MySQL Stores Temporary Files">
Section B.3.3.5, “Where MySQL Stores Temporary Files”
</a>
.
</p>
<p>
The maximum permissible setting for
<a class="link" href="server-system-variables.html#sysvar_sort_buffer_size">
<code class="literal">
sort_buffer_size
</code>
</a>
is
4GB−1. Larger values are permitted for 64-bit platforms
(except 64-bit Windows, for which large values are truncated
to 4GB−1 with a warning).
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_auto_is_null">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_auto_is_null">
<code class="literal">
sql_auto_is_null
</code>
</a>
</p>
<a class="indexterm" name="idm46045269440704">
</a>
<a class="indexterm" name="idm46045269439616">
</a>
<a class="indexterm" name="idm46045269438128">
</a>
<a class="indexterm" name="idm46045269437056">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql_auto_is_null">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_auto_is_null">
sql_auto_is_null
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If this variable is enabled, then after a statement that
successfully inserts an automatically generated
<code class="literal">
AUTO_INCREMENT
</code>
value, you can find that
value by issuing a statement of the following form:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa2798368"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> <em class="replaceable">tbl_name</em> <span class="token keyword">WHERE</span> <em class="replaceable">auto_col</em> <span class="token operator">IS</span> <span class="token boolean">NULL</span></code></pre>
</div>
<p>
If the statement returns a row, the value returned is the same
as if you invoked the
<a class="link" href="information-functions.html#function_last-insert-id">
<code class="literal">
LAST_INSERT_ID()
</code>
</a>
function. For
details, including the return value after a multiple-row
insert, see
<a class="xref" href="information-functions.html" title="14.15 Information Functions">
Section 14.15, “Information Functions”
</a>
. If no
<code class="literal">
AUTO_INCREMENT
</code>
value was successfully
inserted, the
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statement
returns no row.
</p>
<p>
The behavior of retrieving an
<code class="literal">
AUTO_INCREMENT
</code>
value by using an
<a class="link" href="comparison-operators.html#operator_is-null">
<code class="literal">
IS NULL
</code>
</a>
comparison is used by
some ODBC programs, such as Access. See
<a class="ulink" href="/doc/connector-odbc/en/connector-odbc-usagenotes-functionality-last-insert-id.html" target="_top">
Obtaining Auto-Increment Values
</a>
.
This behavior can be disabled by setting
<a class="link" href="server-system-variables.html#sysvar_sql_auto_is_null">
<code class="literal">
sql_auto_is_null
</code>
</a>
to
<code class="literal">
OFF
</code>
.
</p>
<p>
The default value of
<a class="link" href="server-system-variables.html#sysvar_sql_auto_is_null">
<code class="literal">
sql_auto_is_null
</code>
</a>
is
<code class="literal">
OFF
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_big_selects">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_big_selects">
<code class="literal">
sql_big_selects
</code>
</a>
</p>
<a class="indexterm" name="idm46045269400256">
</a>
<a class="indexterm" name="idm46045269399168">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql_big_selects">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_big_selects">
sql_big_selects
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If set to
<code class="literal">
OFF
</code>
, MySQL aborts
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements that are
likely to take a very long time to execute (that is,
statements for which the optimizer estimates that the number
of examined rows exceeds the value of
<a class="link" href="server-system-variables.html#sysvar_max_join_size">
<code class="literal">
max_join_size
</code>
</a>
). This is
useful when an inadvisable
<code class="literal">
WHERE
</code>
statement
has been issued. The default value for a new connection is
<code class="literal">
ON
</code>
, which permits all
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements.
</p>
<p>
If you set the
<a class="link" href="server-system-variables.html#sysvar_max_join_size">
<code class="literal">
max_join_size
</code>
</a>
system variable to a value other than
<code class="literal">
DEFAULT
</code>
,
<a class="link" href="server-system-variables.html#sysvar_sql_big_selects">
<code class="literal">
sql_big_selects
</code>
</a>
is set to
<code class="literal">
OFF
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_buffer_result">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_buffer_result">
<code class="literal">
sql_buffer_result
</code>
</a>
</p>
<a class="indexterm" name="idm46045269366688">
</a>
<a class="indexterm" name="idm46045269365648">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql_buffer_result">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_buffer_result">
sql_buffer_result
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If enabled,
<a class="link" href="server-system-variables.html#sysvar_sql_buffer_result">
<code class="literal">
sql_buffer_result
</code>
</a>
forces results from
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements to be put into temporary tables. This helps MySQL
free the table locks early and can be beneficial in cases
where it takes a long time to send results to the client. The
default value is
<code class="literal">
OFF
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_generate_invisible_primary_key">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_generate_invisible_primary_key">
<code class="literal">
sql_generate_invisible_primary_key
</code>
</a>
</p>
<a class="indexterm" name="idm46045269340096">
</a>
<a class="indexterm" name="idm46045269339008">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql_generate_invisible_primary_key">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--sql-generate-invisible-primary-key[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_generate_invisible_primary_key">
sql_generate_invisible_primary_key
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether this server adds a generated invisible primary key to
any
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
table that is created
without one.
</p>
<p>
This variable is not replicated. In addition, even if set on
the replica, it is ignored by replication applier threads;
this means that, by default, a replica does not generate a
primary key for any replicated table which, on the source, was
created without one. You can cause the replica to generate
invisible primary keys for such tables by setting
<code class="literal">
REQUIRE_TABLE_PRIMARY_KEY_CHECK = GENERATE
</code>
as part of a
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE
TO
</code>
</a>
statement, optionally specifying a replication
channel.
</p>
<p>
For more information and examples, see
<a class="xref" href="create-table-gipks.html" title="15.1.20.11 Generated Invisible Primary Keys">
Section 15.1.20.11, “Generated Invisible Primary Keys”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_log_off">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_log_off">
<code class="literal">
sql_log_off
</code>
</a>
</p>
<a class="indexterm" name="idm46045269309136">
</a>
<a class="indexterm" name="idm46045269308048">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql_log_off">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_log_off">
sql_log_off
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
OFF
</code>
(enable logging)
</p>
<p class="valid-value">
<code class="literal">
ON
</code>
(disable logging)
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls whether logging to the general query
log is disabled for the current session (assuming that the
general query log itself is enabled). The default value is
<code class="literal">
OFF
</code>
(that is, enable logging). To disable
or enable general query logging for the current session, set
the session
<a class="link" href="server-system-variables.html#sysvar_sql_log_off">
<code class="literal">
sql_log_off
</code>
</a>
variable to
<code class="literal">
ON
</code>
or
<code class="literal">
OFF
</code>
.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_mode">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_mode">
<code class="literal">
sql_mode
</code>
</a>
</p>
<a class="indexterm" name="idm46045269277104">
</a>
<a class="indexterm" name="idm46045269276016">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql-mode">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--sql-mode=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_mode">
sql_mode
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Set
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ONLY_FULL_GROUP_BY STRICT_TRANS_TABLES NO_ZERO_IN_DATE NO_ZERO_DATE ERROR_FOR_DIVISION_BY_ZERO NO_ENGINE_SUBSTITUTION
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
ALLOW_INVALID_DATES
</code>
</p>
<p class="valid-value">
<code class="literal">
ANSI_QUOTES
</code>
</p>
<p class="valid-value">
<code class="literal">
ERROR_FOR_DIVISION_BY_ZERO
</code>
</p>
<p class="valid-value">
<code class="literal">
HIGH_NOT_PRECEDENCE
</code>
</p>
<p class="valid-value">
<code class="literal">
IGNORE_SPACE
</code>
</p>
<p class="valid-value">
<code class="literal">
NO_AUTO_VALUE_ON_ZERO
</code>
</p>
<p class="valid-value">
<code class="literal">
NO_BACKSLASH_ESCAPES
</code>
</p>
<p class="valid-value">
<code class="literal">
NO_DIR_IN_CREATE
</code>
</p>
<p class="valid-value">
<code class="literal">
NO_ENGINE_SUBSTITUTION
</code>
</p>
<p class="valid-value">
<code class="literal">
NO_UNSIGNED_SUBTRACTION
</code>
</p>
<p class="valid-value">
<code class="literal">
NO_ZERO_DATE
</code>
</p>
<p class="valid-value">
<code class="literal">
NO_ZERO_IN_DATE
</code>
</p>
<p class="valid-value">
<code class="literal">
ONLY_FULL_GROUP_BY
</code>
</p>
<p class="valid-value">
<code class="literal">
PAD_CHAR_TO_FULL_LENGTH
</code>
</p>
<p class="valid-value">
<code class="literal">
PIPES_AS_CONCAT
</code>
</p>
<p class="valid-value">
<code class="literal">
REAL_AS_FLOAT
</code>
</p>
<p class="valid-value">
<code class="literal">
STRICT_ALL_TABLES
</code>
</p>
<p class="valid-value">
<code class="literal">
STRICT_TRANS_TABLES
</code>
</p>
<p class="valid-value">
<code class="literal">
TIME_TRUNCATE_FRACTIONAL
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The current server SQL mode, which can be set dynamically. For
details, see
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
MySQL installation programs may configure the SQL mode
during the installation process.
</p>
<p>
If the SQL mode differs from the default or from what you
expect, check for a setting in an option file that the
server reads at startup.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_notes">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_notes">
<code class="literal">
sql_notes
</code>
</a>
</p>
<a class="indexterm" name="idm46045269229184">
</a>
<a class="indexterm" name="idm46045269228096">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql_notes">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_notes">
sql_notes
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If enabled (the default), diagnostics of
<code class="literal">
Note
</code>
level increment
<code class="literal">
warning_count
</code>
and the server records them.
If disabled,
<code class="literal">
Note
</code>
diagnostics do not
increment
<a class="link" href="server-system-variables.html#sysvar_warning_count">
<code class="literal">
warning_count
</code>
</a>
and
the server does not record them.
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
includes output to disable this variable so that reloading the
dump file does not produce warnings for events that do not
affect the integrity of the reload operation.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_quote_show_create">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_quote_show_create">
<code class="literal">
sql_quote_show_create
</code>
</a>
</p>
<a class="indexterm" name="idm46045269201120">
</a>
<a class="indexterm" name="idm46045269200080">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql_quote_show_create">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_quote_show_create">
sql_quote_show_create
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If enabled (the default), the server quotes identifiers for
<a class="link" href="show-create-table.html" title="15.7.7.11 SHOW CREATE TABLE Statement">
<code class="literal">
SHOW CREATE TABLE
</code>
</a>
and
<a class="link" href="show-create-database.html" title="15.7.7.7 SHOW CREATE DATABASE Statement">
<code class="literal">
SHOW CREATE DATABASE
</code>
</a>
statements. If disabled, quoting is disabled. This option is
enabled by default so that replication works for identifiers
that require quoting. See
<a class="xref" href="show-create-table.html" title="15.7.7.11 SHOW CREATE TABLE Statement">
Section 15.7.7.11, “SHOW CREATE TABLE Statement”
</a>
,
and
<a class="xref" href="show-create-database.html" title="15.7.7.7 SHOW CREATE DATABASE Statement">
Section 15.7.7.7, “SHOW CREATE DATABASE Statement”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_require_primary_key">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_require_primary_key">
<code class="literal">
sql_require_primary_key
</code>
</a>
</p>
<a class="indexterm" name="idm46045269173776">
</a>
<a class="indexterm" name="idm46045269172736">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql_require_primary_key">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--sql-require-primary-key[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_require_primary_key">
sql_require_primary_key
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether statements that create new tables or alter the
structure of existing tables enforce the requirement that
tables have a primary key.
</p>
<p>
Setting the session value of this system variable is a
restricted operation. The session user must have privileges
sufficient to set restricted session 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>
Enabling this variable helps avoid performance problems in
row-based replication that can occur when tables have no
primary key. Suppose that a table has no primary key and an
update or delete modifies multiple rows. On the replication
source server, this operation can be performed using a single
table scan but, when replicated using row-based replication,
results in a table scan for each row to be modified on the
replica. With a primary key, these table scans do not occur.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_sql_require_primary_key">
<code class="literal">
sql_require_primary_key
</code>
</a>
applies to both base tables and
<code class="literal">
TEMPORARY
</code>
tables, and changes to its value are replicated to replica
servers. The table must use MySQL storage engines that can
participate in replication.
</p>
<p>
When enabled,
<a class="link" href="server-system-variables.html#sysvar_sql_require_primary_key">
<code class="literal">
sql_require_primary_key
</code>
</a>
has
these effects:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
Attempts to create a new table with no primary key fail
with an error. This includes
<code class="literal">
CREATE TABLE ...
LIKE
</code>
. It also includes
<code class="literal">
CREATE TABLE ...
SELECT
</code>
, unless the
<code class="literal">
CREATE
TABLE
</code>
part includes a primary key definition.
</p>
</li>
<li class="listitem">
<p>
Attempts to drop the primary key from an existing table
fail with an error, with the exception that dropping the
primary key and adding a primary key in the same
<code class="literal">
ALTER TABLE
</code>
statement is permitted.
</p>
<p>
Dropping the primary key fails even if the table also
contains a
<code class="literal">
UNIQUE NOT NULL
</code>
index.
</p>
</li>
<li class="listitem">
<p>
Attempts to import a table with no primary key fail with
an error.
</p>
</li>
</ul>
</div>
<p>
The
<code class="literal">
REQUIRE_TABLE_PRIMARY_KEY_CHECK
</code>
option
of the
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE
TO
</code>
</a>
statement enables a replica to select its own
policy for primary key checks. When the option is set to
<code class="literal">
ON
</code>
for a replication channel, the replica
always uses the value
<code class="literal">
ON
</code>
for the
<a class="link" href="server-system-variables.html#sysvar_sql_require_primary_key">
<code class="literal">
sql_require_primary_key
</code>
</a>
system variable in replication operations, requiring a primary
key. When the option is set to
<code class="literal">
OFF
</code>
, the
replica always uses the value
<code class="literal">
OFF
</code>
for the
<a class="link" href="server-system-variables.html#sysvar_sql_require_primary_key">
<code class="literal">
sql_require_primary_key
</code>
</a>
system variable in replication operations, so that a primary
key is never required, even if the source required one. When
the
<code class="literal">
REQUIRE_TABLE_PRIMARY_KEY_CHECK
</code>
option
is set to
<code class="literal">
STREAM
</code>
, which is the default, the
replica uses whatever value is replicated from the source for
each transaction. With the
<code class="literal">
STREAM
</code>
setting
for the
<code class="literal">
REQUIRE_TABLE_PRIMARY_KEY_CHECK
</code>
option, if privilege checks are in use for the replication
channel, the
<code class="literal">
PRIVILEGE_CHECKS_USER
</code>
account
needs privileges sufficient to set restricted session
variables, so that it can set the session value for the
<a class="link" href="server-system-variables.html#sysvar_sql_require_primary_key">
<code class="literal">
sql_require_primary_key
</code>
</a>
system variable. With the
<code class="literal">
ON
</code>
or
<code class="literal">
OFF
</code>
settings, the account does not need
these privileges. For more information, see
<a class="xref" href="replication-privilege-checks.html" title="19.3.3 Replication Privilege Checks">
Section 19.3.3, “Replication Privilege Checks”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_safe_updates">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_safe_updates">
<code class="literal">
sql_safe_updates
</code>
</a>
</p>
<a class="indexterm" name="idm46045269118560">
</a>
<a class="indexterm" name="idm46045269117472">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql_safe_updates">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_safe_updates">
sql_safe_updates
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If this variable is enabled,
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
and
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
statements that do not
use a key in the
<code class="literal">
WHERE
</code>
clause or a
<code class="literal">
LIMIT
</code>
clause produce an error. This makes
it possible to catch
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
and
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
statements where keys
are not used properly and that would probably change or delete
a large number of rows. The default value is
<code class="literal">
OFF
</code>
.
</p>
<p>
For the
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
client,
<a class="link" href="server-system-variables.html#sysvar_sql_safe_updates">
<code class="literal">
sql_safe_updates
</code>
</a>
can be
enabled by using the
<a class="link" href="mysql-command-options.html#option_mysql_safe-updates">
<code class="option">
--safe-updates
</code>
</a>
option. For more
information, see
<a class="xref" href="mysql-tips.html#safe-updates" title="Using Safe-Updates Mode (--safe-updates)">
Using Safe-Updates Mode (--safe-updates)
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_select_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_select_limit">
<code class="literal">
sql_select_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045269083664">
</a>
<a class="indexterm" name="idm46045269082576">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql_select_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_select_limit">
sql_select_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum number of rows to return from
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements. For more
information, see
<a class="xref" href="mysql-tips.html#safe-updates" title="Using Safe-Updates Mode (--safe-updates)">
Using Safe-Updates Mode (--safe-updates)
</a>
.
</p>
<p>
The default value for a new connection is the maximum number
of rows that the server permits per table. Typical default
values are (2
<sup>
32
</sup>
)−1 or
(2
<sup>
64
</sup>
)−1. If you have changed
the limit, the default value can be restored by assigning a
value of
<code class="literal">
DEFAULT
</code>
.
</p>
<p>
If a
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
has a
<code class="literal">
LIMIT
</code>
clause, the
<code class="literal">
LIMIT
</code>
takes precedence over the value of
<a class="link" href="server-system-variables.html#sysvar_sql_select_limit">
<code class="literal">
sql_select_limit
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_sql_warnings">
</a>
<a class="link" href="server-system-variables.html#sysvar_sql_warnings">
<code class="literal">
sql_warnings
</code>
</a>
</p>
<a class="indexterm" name="idm46045269047008">
</a>
<a class="indexterm" name="idm46045269045920">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for sql_warnings">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_sql_warnings">
sql_warnings
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls whether single-row
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
statements produce an
information string if warnings occur. The default is
<code class="literal">
OFF
</code>
. Set the value to
<code class="literal">
ON
</code>
to produce an information string.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ssl_ca">
</a>
<a class="link" href="server-system-variables.html#sysvar_ssl_ca">
<code class="literal">
ssl_ca
</code>
</a>
</p>
<a class="indexterm" name="idm46045269021200">
</a>
<a class="indexterm" name="idm46045269020128">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ssl_ca">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ssl-ca=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ssl_ca">
ssl_ca
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The path name of the Certificate Authority (CA) certificate
file in PEM format. The file contains a list of trusted SSL
Certificate Authorities.
</p>
<p>
This variable can be modified at runtime to affect the TLS
context the server uses for new connections established after
the execution of
<a class="link" href="alter-instance.html#alter-instance-reload-tls">
<code class="literal">
ALTER INSTANCE RELOAD
TLS
</code>
</a>
or after a restart if the variable value was
persisted. See
<a class="xref" href="using-encrypted-connections.html#using-encrypted-connections-server-side-runtime-configuration" title="Server-Side Runtime Configuration and Monitoring for Encrypted Connections">
Server-Side Runtime Configuration and Monitoring for Encrypted
Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ssl_capath">
</a>
<a class="link" href="server-system-variables.html#sysvar_ssl_capath">
<code class="literal">
ssl_capath
</code>
</a>
</p>
<a class="indexterm" name="idm46045268992656">
</a>
<a class="indexterm" name="idm46045268991568">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ssl_capath">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ssl-capath=dir_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ssl_capath">
ssl_capath
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Directory name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The path name of the directory that contains trusted SSL
Certificate Authority (CA) certificate files in PEM format.
</p>
<p>
This variable is can be modified at runtime to affect the TLS
context the server uses for new connections established after
the execution of
<a class="link" href="alter-instance.html#alter-instance-reload-tls">
<code class="literal">
ALTER INSTANCE RELOAD
TLS
</code>
</a>
or after a restart if the variable value was
persisted. See
<a class="xref" href="using-encrypted-connections.html#using-encrypted-connections-server-side-runtime-configuration" title="Server-Side Runtime Configuration and Monitoring for Encrypted Connections">
Server-Side Runtime Configuration and Monitoring for Encrypted
Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ssl_cert">
</a>
<a class="link" href="server-system-variables.html#sysvar_ssl_cert">
<code class="literal">
ssl_cert
</code>
</a>
</p>
<a class="indexterm" name="idm46045268964384">
</a>
<a class="indexterm" name="idm46045268963296">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ssl_cert">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ssl-cert=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ssl_cert">
ssl_cert
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The path name of the server SSL public key certificate file in
PEM format.
</p>
<p>
If the server is started with
<a class="link" href="server-system-variables.html#sysvar_ssl_cert">
<code class="literal">
ssl_cert
</code>
</a>
set to a certificate
that uses any restricted cipher or cipher category, the server
starts with support for encrypted connections disabled. For
information about cipher restrictions, see
<a class="xref" href="encrypted-connection-protocols-ciphers.html#encrypted-connection-cipher-configuration" title="Connection Cipher Configuration">
Connection Cipher Configuration
</a>
.
</p>
<p>
This variable can be modified at runtime to affect the TLS
context the server uses for new connections established after
the execution of
<a class="link" href="alter-instance.html#alter-instance-reload-tls">
<code class="literal">
ALTER INSTANCE RELOAD
TLS
</code>
</a>
or after a restart if the variable value was
persisted. See
<a class="xref" href="using-encrypted-connections.html#using-encrypted-connections-server-side-runtime-configuration" title="Server-Side Runtime Configuration and Monitoring for Encrypted Connections">
Server-Side Runtime Configuration and Monitoring for Encrypted
Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ssl_cipher">
</a>
<a class="link" href="server-system-variables.html#sysvar_ssl_cipher">
<code class="literal">
ssl_cipher
</code>
</a>
</p>
<a class="indexterm" name="idm46045268933360">
</a>
<a class="indexterm" name="idm46045268932272">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ssl_cipher">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ssl-cipher=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ssl_cipher">
ssl_cipher
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The list of permissible encryption ciphers for connections
that use TLSv1.2. If no cipher in the list is supported,
encrypted connections that use this TLS protocol do not work.
</p>
<p>
The list may include any of the following values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
ECDHE-ECDSA-AES128-GCM-SHA256
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-ECDSA-AES256-GCM-SHA384
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-RSA-AES128-GCM-SHA256
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-RSA-AES256-GCM-SHA384
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-ECDSA-CHACHA20-POLY1305
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-RSA-CHACHA20-POLY1305
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-ECDSA-AES256-CCM
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ECDHE-ECDSA-AES128-CCM
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DHE-RSA-AES128-GCM-SHA256
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DHE-RSA-AES256-GCM-SHA384
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DHE-RSA-AES256-CCM
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DHE-RSA-AES128-CCM
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
DHE-RSA-CHACHA20-POLY1305
</code>
</p>
</li>
</ul>
</div>
<p>
Trying to include any values in the cipher list that are not
shown here when setting this variable raises an error
(
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_blocked_cipher" target="_top">
<code class="literal">
ER_BLOCKED_CIPHER
</code>
</a>
).
</p>
<p>
For greatest portability, the cipher list should be a list of
one or more cipher names, separated by colons. The following
example shows two cipher names separated by a colon:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa78468210"><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 punctuation">[</span>mysqld<span class="token punctuation">]</span>
ssl_cipher=<span class="token atrule">"DHE-RSA-AES128-GCM-SHA256:AES128-SHA"</span></code></pre>
</div>
<p>
OpenSSL supports the syntax for specifying ciphers described
in the OpenSSL documentation at
<a class="ulink" href="https://www.openssl.org/docs/manmaster/man1/ciphers.html" target="_blank">
https://www.openssl.org/docs/manmaster/man1/ciphers.html
</a>
.
</p>
<p>
For information about which encryption ciphers MySQL supports,
see
<a class="xref" href="encrypted-connection-protocols-ciphers.html" title="8.3.2 Encrypted Connection TLS Protocols and Ciphers">
Section 8.3.2, “Encrypted Connection TLS Protocols and Ciphers”
</a>
.
</p>
<p>
This variable can be modified at runtime to affect the TLS
context the server uses for new connections established after
the execution of
<a class="link" href="alter-instance.html#alter-instance-reload-tls">
<code class="literal">
ALTER INSTANCE RELOAD
TLS
</code>
</a>
or after a restart if the variable value was
persisted. See
<a class="xref" href="using-encrypted-connections.html#using-encrypted-connections-server-side-runtime-configuration" title="Server-Side Runtime Configuration and Monitoring for Encrypted Connections">
Server-Side Runtime Configuration and Monitoring for Encrypted
Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ssl_crl">
</a>
<a class="link" href="server-system-variables.html#sysvar_ssl_crl">
<code class="literal">
ssl_crl
</code>
</a>
</p>
<a class="indexterm" name="idm46045268879328">
</a>
<a class="indexterm" name="idm46045268878256">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ssl_crl">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ssl-crl=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ssl_crl">
ssl_crl
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The path name of the file containing certificate revocation
lists in PEM format.
</p>
<p>
This variable can be modified at runtime to affect the TLS
context the server uses for new connections established after
the execution of
<a class="link" href="alter-instance.html#alter-instance-reload-tls">
<code class="literal">
ALTER INSTANCE RELOAD
TLS
</code>
</a>
or after a restart if the variable value was
persisted. See
<a class="xref" href="using-encrypted-connections.html#using-encrypted-connections-server-side-runtime-configuration" title="Server-Side Runtime Configuration and Monitoring for Encrypted Connections">
Server-Side Runtime Configuration and Monitoring for Encrypted
Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ssl_crlpath">
</a>
<a class="link" href="server-system-variables.html#sysvar_ssl_crlpath">
<code class="literal">
ssl_crlpath
</code>
</a>
</p>
<a class="indexterm" name="idm46045268851120">
</a>
<a class="indexterm" name="idm46045268850032">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ssl_crlpath">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ssl-crlpath=dir_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ssl_crlpath">
ssl_crlpath
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Directory name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The path of the directory that contains certificate
revocation-list files in PEM format.
</p>
<p>
This variable can be modified at runtime to affect the TLS
context the server uses for new connections established after
the execution of
<a class="link" href="alter-instance.html#alter-instance-reload-tls">
<code class="literal">
ALTER INSTANCE RELOAD
TLS
</code>
</a>
or after a restart if the variable value was
persisted. See
<a class="xref" href="using-encrypted-connections.html#using-encrypted-connections-server-side-runtime-configuration" title="Server-Side Runtime Configuration and Monitoring for Encrypted Connections">
Server-Side Runtime Configuration and Monitoring for Encrypted
Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ssl_fips_mode">
</a>
<a class="link" href="server-system-variables.html#sysvar_ssl_fips_mode">
<code class="literal">
ssl_fips_mode
</code>
</a>
</p>
<a class="indexterm" name="idm46045268822880">
</a>
<a class="indexterm" name="idm46045268821792">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ssl_fips_mode">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ssl-fips-mode={OFF|ON|STRICT}
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ssl_fips_mode">
ssl_fips_mode
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
OFF
</code>
(or 0)
</p>
<p class="valid-value">
<code class="literal">
ON
</code>
(or 1)
</p>
<p class="valid-value">
<code class="literal">
STRICT
</code>
(or 2)
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Controls whether to enable FIPS mode on the server side. The
<a class="link" href="server-system-variables.html#sysvar_ssl_fips_mode">
<code class="literal">
ssl_fips_mode
</code>
</a>
system variable
differs from other
<code class="literal">
ssl_
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
system
variables in that it is not used to control whether the server
permits encrypted connections, but rather to affect which
cryptographic operations are permitted. See
<a class="xref" href="fips-mode.html" title="8.8 FIPS Support">
Section 8.8, “FIPS Support”
</a>
.
</p>
<p>
These
<a class="link" href="server-system-variables.html#sysvar_ssl_fips_mode">
<code class="literal">
ssl_fips_mode
</code>
</a>
values
are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
OFF
</code>
(or 0): Disable FIPS mode.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ON
</code>
(or 1): Enable FIPS mode.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
STRICT
</code>
(or 2): Enable
<span class="quote">
“
<span class="quote">
strict
</span>
”
</span>
FIPS mode.
</p>
</li>
</ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
If the OpenSSL FIPS Object Module is not available, the only
permitted value for
<a class="link" href="server-system-variables.html#sysvar_ssl_fips_mode">
<code class="literal">
ssl_fips_mode
</code>
</a>
is
<code class="literal">
OFF
</code>
. In this case, setting
<a class="link" href="server-system-variables.html#sysvar_ssl_fips_mode">
<code class="literal">
ssl_fips_mode
</code>
</a>
to
<code class="literal">
ON
</code>
or
<code class="literal">
STRICT
</code>
at
startup causes the server to produce an error message and
exit.
</p>
</div>
<p>
This option is deprecated and made read-only. Expect it to be
removed in a future version of MySQL.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ssl_key">
</a>
<a class="link" href="server-system-variables.html#sysvar_ssl_key">
<code class="literal">
ssl_key
</code>
</a>
</p>
<a class="indexterm" name="idm46045268774000">
</a>
<a class="indexterm" name="idm46045268772928">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ssl_key">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ssl-key=file_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ssl_key">
ssl_key
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
File name
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The path name of the server SSL private key file in PEM
format. For better security, use a certificate with an RSA key
size of at least 2048 bits.
</p>
<p>
If the key file is protected by a passphrase, the server
prompts the user for the passphrase. The password must be
given interactively; it cannot be stored in a file. If the
passphrase is incorrect, the program continues as if it could
not read the key.
</p>
<p>
This variable can be modified at runtime to affect the TLS
context the server uses for new connections established after
the execution of
<a class="link" href="alter-instance.html#alter-instance-reload-tls">
<code class="literal">
ALTER INSTANCE RELOAD
TLS
</code>
</a>
or after a restart if the variable value was
persisted. See
<a class="xref" href="using-encrypted-connections.html#using-encrypted-connections-server-side-runtime-configuration" title="Server-Side Runtime Configuration and Monitoring for Encrypted Connections">
Server-Side Runtime Configuration and Monitoring for Encrypted
Connections
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ssl_session_cache_mode">
</a>
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_mode">
<code class="literal">
ssl_session_cache_mode
</code>
</a>
</p>
<a class="indexterm" name="idm46045268744736">
</a>
<a class="indexterm" name="idm46045268743696">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ssl_session_cache_mode">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ssl_session_cache_mode={ON|OFF}
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_mode">
ssl_session_cache_mode
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
ON
</code>
</p>
<p class="valid-value">
<code class="literal">
OFF
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Controls whether to enable the session cache in memory on the
server side and session-ticket generation by the server. The
default mode is
<code class="literal">
ON
</code>
(enable session cache
mode). A change to the
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_mode">
<code class="literal">
ssl_session_cache_mode
</code>
</a>
system
variable has an effect only after the
<a class="link" href="alter-instance.html#alter-instance-reload-tls">
<code class="literal">
ALTER INSTANCE RELOAD TLS
</code>
</a>
statement has been executed, or after a restart if the
variable value was persisted.
</p>
<p>
These
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_mode">
<code class="literal">
ssl_session_cache_mode
</code>
</a>
values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
ON
</code>
: Enable session cache mode.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
OFF
</code>
: Disable session cache mode.
</p>
</li>
</ul>
</div>
<p>
The server does not advertise its support for session
resumption if the value of this system variable is
<code class="literal">
OFF
</code>
. When running on OpenSSL
1.0.
<code class="literal">
x
</code>
the session tickets are always
generated, but the tickets are not usable when
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_mode">
<code class="literal">
ssl_session_cache_mode
</code>
</a>
is
enabled.
</p>
<p>
The current value in effect for
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_mode">
<code class="literal">
ssl_session_cache_mode
</code>
</a>
can be
observed with the
<a class="link" href="server-status-variables.html#statvar_Ssl_session_cache_mode">
<code class="literal">
Ssl_session_cache_mode
</code>
</a>
status variable.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_ssl_session_cache_timeout">
</a>
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_timeout">
<code class="literal">
ssl_session_cache_timeout
</code>
</a>
</p>
<a class="indexterm" name="idm46045268700512">
</a>
<a class="indexterm" name="idm46045268699408">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ssl_session_cache_timeout">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ssl_session_cache_timeout
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_timeout">
ssl_session_cache_timeout
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
300
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
84600
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
Sets a period of time during which prior session reuse is
permitted when establishing a new encrypted connection to the
server, provided the
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_mode">
<code class="literal">
ssl_session_cache_mode
</code>
</a>
system
variable is enabled and prior session data is available. If
the session timeout expires, a session can no longer be
reused.
</p>
<p>
The default value is 300 seconds and the maximum value is
84600 (or one day in seconds). A change to the
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_timeout">
<code class="literal">
ssl_session_cache_timeout
</code>
</a>
system variable has an effect only after the
<a class="link" href="alter-instance.html#alter-instance-reload-tls">
<code class="literal">
ALTER INSTANCE RELOAD TLS
</code>
</a>
statement has been executed, or after a restart if the
variable value was persisted. The current value in effect for
<a class="link" href="server-system-variables.html#sysvar_ssl_session_cache_timeout">
<code class="literal">
ssl_session_cache_timeout
</code>
</a>
can
be observed with the
<a class="link" href="server-status-variables.html#statvar_Ssl_session_cache_timeout">
<code class="literal">
Ssl_session_cache_timeout
</code>
</a>
status variable.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_statement_id">
</a>
<a class="link" href="server-system-variables.html#sysvar_statement_id">
<code class="literal">
statement_id
</code>
</a>
</p>
<a class="indexterm" name="idm46045268660528">
</a>
<a class="indexterm" name="idm46045268659440">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for statement_id">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_statement_id">
statement_id
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
</tbody>
</table>
</div>
<p>
Each statement executed in the current session is assigned a
sequence number. This can be used together with the
<a class="link" href="server-system-variables.html#sysvar_session_track_system_variables">
<code class="literal">
session_track_system_variables
</code>
</a>
system variable to identify this statement in Performance
Schema tables such as the
<a class="link" href="performance-schema-events-statements-history-table.html" title="29.12.6.2 The events_statements_history Table">
<code class="literal">
events_statements_history
</code>
</a>
table.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_stored_program_cache">
</a>
<a class="link" href="server-system-variables.html#sysvar_stored_program_cache">
<code class="literal">
stored_program_cache
</code>
</a>
</p>
<a class="indexterm" name="idm46045268636800">
</a>
<a class="indexterm" name="idm46045268635760">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for stored_program_cache">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--stored-program-cache=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_stored_program_cache">
stored_program_cache
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
256
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
16
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
524288
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Sets a soft upper limit for the number of cached stored
routines per connection. The value of this variable is
specified in terms of the number of stored routines held in
each of the two caches maintained by the MySQL Server for,
respectively, stored procedures and stored functions.
</p>
<p>
Whenever a stored routine is executed this cache size is
checked before the first or top-level statement in the routine
is parsed; if the number of routines of the same type (stored
procedures or stored functions according to which is being
executed) exceeds the limit specified by this variable, the
corresponding cache is flushed and memory previously allocated
for cached objects is freed. This allows the cache to be
flushed safely, even when there are dependencies between
stored routines.
</p>
<p>
The stored procedure and stored function caches exists in
parallel with the stored program definition cache partition of
the
<a class="link" href="glossary.html#glos_dictionary_object_cache" title="dictionary object cache">
dictionary
object cache
</a>
. The stored procedure and stored function
caches are per connection, while the stored program definition
cache is shared. The existence of objects in the stored
procedure and stored function caches have no dependence on the
existence of objects in the stored program definition cache,
and vice versa. For more information, see
<a class="xref" href="data-dictionary-object-cache.html" title="16.4 Dictionary Object Cache">
Section 16.4, “Dictionary Object Cache”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_stored_program_definition_cache">
</a>
<a class="link" href="server-system-variables.html#sysvar_stored_program_definition_cache">
<code class="literal">
stored_program_definition_cache
</code>
</a>
</p>
<a class="indexterm" name="idm46045268602480">
</a>
<a class="indexterm" name="idm46045268601376">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for stored_program_definition_cache">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--stored-program-definition-cache=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_stored_program_definition_cache">
stored_program_definition_cache
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
256
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
256
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
524288
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Defines a limit for the number of stored program definition
objects, both used and unused, that can be kept in the
dictionary object cache.
</p>
<p>
Unused stored program definition objects are only kept in the
dictionary object cache when the number in use is less than
the capacity defined by
<code class="literal">
stored_program_definition_cache
</code>
.
</p>
<p>
A setting of 0 means that stored program definition objects
are only kept in the dictionary object cache while they are in
use.
</p>
<p>
The stored program definition cache partition exists in
parallel with the stored procedure and stored function caches
that are configured using the
<a class="link" href="server-system-variables.html#sysvar_stored_program_cache">
<code class="literal">
stored_program_cache
</code>
</a>
option.
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_stored_program_cache">
<code class="literal">
stored_program_cache
</code>
</a>
option sets a soft upper limit for the number of cached stored
procedures or functions per connection, and the limit is
checked each time a connection executes a stored procedure or
function. The stored program definition cache partition, on
the other hand, is a shared cache that stores stored program
definition objects for other purposes. The existence of
objects in the stored program definition cache partition has
no dependence on the existence of objects in the stored
procedure cache or stored function cache, and vice versa.
</p>
<p>
For related information, see
<a class="xref" href="data-dictionary-object-cache.html" title="16.4 Dictionary Object Cache">
Section 16.4, “Dictionary Object Cache”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_super_read_only">
</a>
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
</p>
<a class="indexterm" name="idm46045268563840">
</a>
<a class="indexterm" name="idm46045268562752">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for super_read_only">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--super-read-only[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
super_read_only
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If the
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
system
variable is enabled, the server permits no client updates
except from users who have the
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
privilege (or
the deprecated
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege). If the
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
system
variable is also enabled, the server prohibits client updates
even from users who have
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
or
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
. See the description of
the
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
system variable
for a description of read-only mode and information about how
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
interact.
</p>
<p>
Client updates prevented when
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
is enabled
include operations that do not necessarily appear to be
updates, such as
<code class="literal">
CREATE FUNCTION
</code>
(to
install a loadable function),
<code class="literal">
INSTALL
PLUGIN
</code>
, and
<code class="literal">
INSTALL COMPONENT
</code>
.
These operations are prohibited because they involve changes
to tables in the
<code class="literal">
mysql
</code>
system schema.
</p>
<p>
Similarly, if the Event Scheduler is enabled, enabling the
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
system
variable prevents it from updating event
<span class="quote">
“
<span class="quote">
last
executed
</span>
”
</span>
timestamps in the
<code class="literal">
events
</code>
data dictionary table. This causes the Event Scheduler to stop
the next time it tries to execute a scheduled event, after
writing a message to the server error log. (In this situation
the
<a class="link" href="server-system-variables.html#sysvar_event_scheduler">
<code class="literal">
event_scheduler
</code>
</a>
system
variable does not change from
<code class="literal">
ON
</code>
to
<code class="literal">
OFF
</code>
. An implication is that this variable
rejects the DBA
<span class="emphasis">
<em>
intent
</em>
</span>
that the Event
Scheduler be enabled or disabled, where its actual status of
started or stopped may be distinct.). If
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
is
subsequently disabled after being enabled, the server
automatically restarts the Event Scheduler as needed.
</p>
<p>
Changes to
<a class="link" href="server-system-variables.html#sysvar_super_read_only">
<code class="literal">
super_read_only
</code>
</a>
on
a replication source server are not replicated to replica
servers. The value can be set on a replica independent of the
setting on the source.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_syseventlog.facility">
</a>
<a class="link" href="server-system-variables.html#sysvar_syseventlog.facility">
<code class="literal">
syseventlog.facility
</code>
</a>
</p>
<a class="indexterm" name="idm46045268512432">
</a>
<a class="indexterm" name="idm46045268511392">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for syseventlog.facility">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--syseventlog.facility=value
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_syseventlog.facility">
syseventlog.facility
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
daemon
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The facility for error log output written to
<code class="literal">
syslog
</code>
(what type of program is sending the
message). This variable is unavailable unless the
<code class="literal">
log_sink_syseventlog
</code>
error log component is
installed. See
<a class="xref" href="error-log-syslog.html" title="7.4.2.8 Error Logging to the System Log">
Section 7.4.2.8, “Error Logging to the System Log”
</a>
.
</p>
<p>
The permitted values can vary per operating system; consult
your system
<code class="literal">
syslog
</code>
documentation.
</p>
<p>
This variable does not exist on Windows.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_syseventlog.include_pid">
</a>
<a class="link" href="server-system-variables.html#sysvar_syseventlog.include_pid">
<code class="literal">
syseventlog.include_pid
</code>
</a>
</p>
<a class="indexterm" name="idm46045268482816">
</a>
<a class="indexterm" name="idm46045268481776">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for syseventlog.include_pid">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--syseventlog.include-pid[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_syseventlog.include_pid">
syseventlog.include_pid
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether to include the server process ID in each line of error
log output written to
<code class="literal">
syslog
</code>
. This variable
is unavailable unless the
<code class="literal">
log_sink_syseventlog
</code>
error log component is
installed. See
<a class="xref" href="error-log-syslog.html" title="7.4.2.8 Error Logging to the System Log">
Section 7.4.2.8, “Error Logging to the System Log”
</a>
.
</p>
<p>
This variable does not exist on Windows.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_syseventlog.tag">
</a>
<a class="link" href="server-system-variables.html#sysvar_syseventlog.tag">
<code class="literal">
syseventlog.tag
</code>
</a>
</p>
<a class="indexterm" name="idm46045268454640">
</a>
<a class="indexterm" name="idm46045268453552">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for syseventlog.tag">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--syseventlog.tag=tag
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_syseventlog.tag">
syseventlog.tag
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
empty string
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The tag to be added to the server identifier in error log
output written to
<code class="literal">
syslog
</code>
or the Windows
Event Log. This variable is unavailable unless the
<code class="literal">
log_sink_syseventlog
</code>
error log component is
installed. See
<a class="xref" href="error-log-syslog.html" title="7.4.2.8 Error Logging to the System Log">
Section 7.4.2.8, “Error Logging to the System Log”
</a>
.
</p>
<p>
By default, no tag is set, so the server identifier is simply
<code class="literal">
MySQL
</code>
on Windows, and
<code class="literal">
mysqld
</code>
on other platforms. If a tag value
of
<em class="replaceable">
<code>
tag
</code>
</em>
is specified, it is appended
to the server identifier with a leading hyphen, resulting in a
<code class="literal">
syslog
</code>
identifier of
<code class="literal">
mysqld-
<em class="replaceable">
<code>
tag
</code>
</em>
</code>
(or
<code class="literal">
MySQL-
<em class="replaceable">
<code>
tag
</code>
</em>
</code>
on
Windows).
</p>
<p>
On Windows, to use a tag that does not already exist, the
server must be run from an account with Administrator
privileges, to permit creation of a registry entry for the
tag. Elevated privileges are not required if the tag already
exists.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_system_time_zone">
</a>
<a class="link" href="server-system-variables.html#sysvar_system_time_zone">
<code class="literal">
system_time_zone
</code>
</a>
</p>
<a class="indexterm" name="idm46045268421008">
</a>
<a class="indexterm" name="idm46045268419920">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for system_time_zone">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_system_time_zone">
system_time_zone
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
The server system time zone. When the server begins executing,
it inherits a time zone setting from the machine defaults,
possibly modified by the environment of the account used for
running the server or the startup script. The value is used to
set
<a class="link" href="server-system-variables.html#sysvar_system_time_zone">
<code class="literal">
system_time_zone
</code>
</a>
. To
explicitly specify the system time zone, set the
<code class="literal">
TZ
</code>
environment variable or use the
<a class="link" href="mysqld-safe.html#option_mysqld_safe_timezone">
<code class="option">
--timezone
</code>
</a>
option of the
<a class="link" href="mysqld-safe.html" title="6.3.2 mysqld_safe — MySQL Server Startup Script">
<span class="command">
<strong>
mysqld_safe
</strong>
</span>
</a>
script.
</p>
<p>
In addition to startup time initialization, if the server host
time zone changes (for example, due to daylight saving time),
<a class="link" href="server-system-variables.html#sysvar_system_time_zone">
<code class="literal">
system_time_zone
</code>
</a>
reflects
that change, which has these implications for applications:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
Queries that reference
<a class="link" href="server-system-variables.html#sysvar_system_time_zone">
<code class="literal">
system_time_zone
</code>
</a>
will get
one value before a daylight saving change and a different
value after the change.
</p>
</li>
<li class="listitem">
<p>
For queries that begin executing before a daylight saving
change and end after the change, the
<a class="link" href="server-system-variables.html#sysvar_system_time_zone">
<code class="literal">
system_time_zone
</code>
</a>
remains
constant within the query because the value is usually
cached at the beginning of execution.
</p>
</li>
</ul>
</div>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_system_time_zone">
<code class="literal">
system_time_zone
</code>
</a>
variable
differs from the
<a class="link" href="server-system-variables.html#sysvar_time_zone">
<code class="literal">
time_zone
</code>
</a>
variable. Although they might have the same value, the latter
variable is used to initialize the time zone for each client
that connects. See
<a class="xref" href="time-zone-support.html" title="7.1.15 MySQL Server Time Zone Support">
Section 7.1.15, “MySQL Server Time Zone Support”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_table_definition_cache">
</a>
<a class="link" href="server-system-variables.html#sysvar_table_definition_cache">
<code class="literal">
table_definition_cache
</code>
</a>
</p>
<a class="indexterm" name="idm46045268385280">
</a>
<a class="indexterm" name="idm46045268384240">
</a>
<a class="indexterm" name="idm46045268382752">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for table_definition_cache">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--table-definition-cache=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_table_definition_cache">
table_definition_cache
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
-1
</code>
(signifies autosizing; do not assign this literal value)
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
400
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
524288
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of table definitions that can be stored in the
table definition cache. If you use a large number of tables,
you can create a large table definition cache to speed up
opening of tables. The table definition cache takes less space
and does not use file descriptors, unlike the normal table
cache. The minimum value is 400. The default value is based on
the following formula, capped to a limit of 2000:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa13205830"><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-simple">MIN<span class="token punctuation">(</span>400 <span class="token operator">+</span> table_open_cache <span class="token operator">/</span> 2<span class="token punctuation">,</span> 2000<span class="token punctuation">)</span></code></pre>
</div>
<p>
For
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
, the
<a class="link" href="server-system-variables.html#sysvar_table_definition_cache">
<code class="literal">
table_definition_cache
</code>
</a>
setting acts as a soft limit for the number of table instances
in the dictionary object cache and the number file-per-table
tablespaces that can be open at one time.
</p>
<p>
If the number of table instances in the dictionary object
cache exceeds the
<a class="link" href="server-system-variables.html#sysvar_table_definition_cache">
<code class="literal">
table_definition_cache
</code>
</a>
limit,
an LRU mechanism begins marking table instances for eviction
and eventually removes them from the dictionary object cache.
The number of open tables with cached metadata can be higher
than the
<a class="link" href="server-system-variables.html#sysvar_table_definition_cache">
<code class="literal">
table_definition_cache
</code>
</a>
limit
due to table instances with foreign key relationships, which
are not placed on the LRU list.
</p>
<p>
The number of file-per-table tablespaces that can be open at
one time is limited by both the
<a class="link" href="server-system-variables.html#sysvar_table_definition_cache">
<code class="literal">
table_definition_cache
</code>
</a>
and
<a class="link" href="innodb-parameters.html#sysvar_innodb_open_files">
<code class="literal">
innodb_open_files
</code>
</a>
settings.
If both variables are set, the highest setting is used. If
neither variable is set, the
<a class="link" href="server-system-variables.html#sysvar_table_definition_cache">
<code class="literal">
table_definition_cache
</code>
</a>
setting, which has a higher default value, is used. If the
number of open tablespaces exceeds the limit defined by
<a class="link" href="server-system-variables.html#sysvar_table_definition_cache">
<code class="literal">
table_definition_cache
</code>
</a>
or
<a class="link" href="innodb-parameters.html#sysvar_innodb_open_files">
<code class="literal">
innodb_open_files
</code>
</a>
, an LRU
mechanism searches the LRU list for tablespace files that are
fully flushed and not currently being extended. This process
is performed each time a new tablespace is opened. Only
inactive tablespaces are closed.
</p>
<p>
The table definition cache exists in parallel with the table
definition cache partition of the
<a class="link" href="glossary.html#glos_dictionary_object_cache" title="dictionary object cache">
dictionary object
cache
</a>
. Both caches store table definitions but serve
different parts of the MySQL server. Objects in one cache have
no dependence on the existence of objects in the other. For
more information, see
<a class="xref" href="data-dictionary-object-cache.html" title="16.4 Dictionary Object Cache">
Section 16.4, “Dictionary Object Cache”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_table_encryption_privilege_check">
</a>
<a class="link" href="server-system-variables.html#sysvar_table_encryption_privilege_check">
<code class="literal">
table_encryption_privilege_check
</code>
</a>
</p>
<a class="indexterm" name="idm46045268335536">
</a>
<a class="indexterm" name="idm46045268334432">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for table_encryption_privilege_check">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--table-encryption-privilege-check[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_table_encryption_privilege_check">
table_encryption_privilege_check
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Controls the
<a class="link" href="privileges-provided.html#priv_table-encryption-admin">
<code class="literal">
TABLE_ENCRYPTION_ADMIN
</code>
</a>
privilege check that occurs when creating or altering a schema
or general tablespace with encryption that differs from the
<a class="link" href="server-system-variables.html#sysvar_default_table_encryption">
<code class="literal">
default_table_encryption
</code>
</a>
setting, or when creating or altering a table with an
encryption setting that differs from the default schema
encryption. The check is disabled by default.
</p>
<p>
Setting
<a class="link" href="server-system-variables.html#sysvar_table_encryption_privilege_check">
<code class="literal">
table_encryption_privilege_check
</code>
</a>
at runtime requires the
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_table_encryption_privilege_check">
<code class="literal">
table_encryption_privilege_check
</code>
</a>
supports
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
PERSIST
</code>
</a>
and
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
PERSIST_ONLY
</code>
</a>
syntax. See
<a class="xref" href="persisted-system-variables.html" title="7.1.9.3 Persisted System Variables">
Section 7.1.9.3, “Persisted System Variables”
</a>
.
</p>
<p>
For more information, see
<a class="xref" href="innodb-data-encryption.html#innodb-schema-tablespace-encryption-default" title="Defining an Encryption Default for Schemas and General Tablespaces">
Defining an Encryption Default for Schemas and General Tablespaces
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_table_open_cache">
</a>
<a class="link" href="server-system-variables.html#sysvar_table_open_cache">
<code class="literal">
table_open_cache
</code>
</a>
</p>
<a class="indexterm" name="idm46045268297296">
</a>
<a class="indexterm" name="idm46045268296208">
</a>
<a class="indexterm" name="idm46045268294720">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for table_open_cache">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--table-open-cache=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_table_open_cache">
table_open_cache
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
4000
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
524288
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of open tables for all threads. Increasing this
value increases the number of file descriptors that
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
requires. The effective value of
this variable is the greater of the effective value of
<a class="link" href="server-system-variables.html#sysvar_open_files_limit">
<code class="literal">
open_files_limit
</code>
</a>
<code class="literal">
-
10 -
</code>
the effective value of
<a class="link" href="server-system-variables.html#sysvar_max_connections">
<code class="literal">
max_connections
</code>
</a>
<code class="literal">
/
2
</code>
, and 400; that is
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-simple"><div class="docs-select-all right" id="sa24169110"><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-simple">MAX<span class="token punctuation">(</span>
<span class="token punctuation">(</span>open_files_limit <span class="token operator">-</span> 10 <span class="token operator">-</span> max_connections<span class="token punctuation">)</span> <span class="token operator">/</span> 2<span class="token punctuation">,</span>
400
<span class="token punctuation">)</span></code></pre>
</div>
<p>
You can check whether you need to increase the table cache by
checking the
<a class="link" href="server-status-variables.html#statvar_Opened_tables">
<code class="literal">
Opened_tables
</code>
</a>
status variable. If the value of
<a class="link" href="server-status-variables.html#statvar_Opened_tables">
<code class="literal">
Opened_tables
</code>
</a>
is large and
you do not use
<a class="link" href="flush.html#flush-tables">
<code class="literal">
FLUSH TABLES
</code>
</a>
often (which just forces all tables to be closed and
reopened), then you should increase the value of the
<a class="link" href="server-system-variables.html#sysvar_table_open_cache">
<code class="literal">
table_open_cache
</code>
</a>
variable.
For more information about the table cache, see
<a class="xref" href="table-cache.html" title="10.4.3.1 How MySQL Opens and Closes Tables">
Section 10.4.3.1, “How MySQL Opens and Closes Tables”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_table_open_cache_instances">
</a>
<a class="link" href="server-system-variables.html#sysvar_table_open_cache_instances">
<code class="literal">
table_open_cache_instances
</code>
</a>
</p>
<a class="indexterm" name="idm46045268252816">
</a>
<a class="indexterm" name="idm46045268251712">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for table_open_cache_instances">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--table-open-cache-instances=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_table_open_cache_instances">
table_open_cache_instances
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
16
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
64
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of open tables cache instances. To improve
scalability by reducing contention among sessions, the open
tables cache can be partitioned into several smaller cache
instances of size
<a class="link" href="server-system-variables.html#sysvar_table_open_cache">
<code class="literal">
table_open_cache
</code>
</a>
/
<a class="link" href="server-system-variables.html#sysvar_table_open_cache_instances">
<code class="literal">
table_open_cache_instances
</code>
</a>
.
A session needs to lock only one instance to access it for DML
statements. This segments cache access among instances,
permitting higher performance for operations that use the
cache when there are many sessions accessing tables. (DDL
statements still require a lock on the entire cache, but such
statements are much less frequent than DML statements.)
</p>
<p>
A value of 8 or 16 is recommended on systems that routinely
use 16 or more cores. However, if you have many large triggers
on your tables that cause a high memory load, the default
setting for
<a class="link" href="server-system-variables.html#sysvar_table_open_cache_instances">
<code class="literal">
table_open_cache_instances
</code>
</a>
might lead to excessive memory usage. In that situation, it
can be helpful to set
<a class="link" href="server-system-variables.html#sysvar_table_open_cache_instances">
<code class="literal">
table_open_cache_instances
</code>
</a>
to
1 in order to restrict memory usage.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_tablespace_definition_cache">
</a>
<a class="link" href="server-system-variables.html#sysvar_tablespace_definition_cache">
<code class="literal">
tablespace_definition_cache
</code>
</a>
</p>
<a class="indexterm" name="idm46045268215808">
</a>
<a class="indexterm" name="idm46045268214704">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for tablespace_definition_cache">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--tablespace-definition-cache=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_tablespace_definition_cache">
tablespace_definition_cache
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
256
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
256
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
524288
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Defines a limit for the number of tablespace definition
objects, both used and unused, that can be kept in the
dictionary object cache.
</p>
<p>
Unused tablespace definition objects are only kept in the
dictionary object cache when the number in use is less than
the capacity defined by
<code class="literal">
tablespace_definition_cache
</code>
.
</p>
<p>
A setting of
<code class="literal">
0
</code>
means that tablespace
definition objects are only kept in the dictionary object
cache while they are in use.
</p>
<p>
For more information, see
<a class="xref" href="data-dictionary-object-cache.html" title="16.4 Dictionary Object Cache">
Section 16.4, “Dictionary Object Cache”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_temptable_max_mmap">
</a>
<a class="link" href="server-system-variables.html#sysvar_temptable_max_mmap">
<code class="literal">
temptable_max_mmap
</code>
</a>
</p>
<a class="indexterm" name="idm46045268181360">
</a>
<a class="indexterm" name="idm46045268180320">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for temptable_max_mmap">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--temptable-max-mmap=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_temptable_max_mmap">
temptable_max_mmap
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2^64-1
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
Defines the maximum amount of memory (in bytes) the TempTable
storage engine is permitted to allocate from memory-mapped
temporary files before it starts storing data to
<code class="literal">
InnoDB
</code>
internal temporary tables on disk. A
setting of 0 (default) disables allocation of memory from
memory-mapped temporary files. For more information, see
<a class="xref" href="internal-temporary-tables.html" title="10.4.4 Internal Temporary Table Use in MySQL">
Section 10.4.4, “Internal Temporary Table Use in MySQL”
</a>
.
</p>
<p>
Before MySQL 8.4, this option was set to 1 GiB instead of 0.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_temptable_max_ram">
</a>
<a class="link" href="server-system-variables.html#sysvar_temptable_max_ram">
<code class="literal">
temptable_max_ram
</code>
</a>
</p>
<a class="indexterm" name="idm46045268146608">
</a>
<a class="indexterm" name="idm46045268145568">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for temptable_max_ram">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--temptable-max-ram=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_temptable_max_ram">
temptable_max_ram
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
3% of total memory: min 1 GB, max 4 GB
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
2097152
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2^64-1
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
Defines the maximum amount of memory that can be occupied by
the
<code class="literal">
TempTable
</code>
storage engine before it
starts storing data on disk. The default value is 3% of total
memory available on the server, with a minimum and maximum
default range of 1-4 GiB. For more information, see
<a class="xref" href="internal-temporary-tables.html" title="10.4.4 Internal Temporary Table Use in MySQL">
Section 10.4.4, “Internal Temporary Table Use in MySQL”
</a>
.
</p>
<p>
Before MySQL 8.4, the default value was always 1 GiB.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_temptable_use_mmap">
</a>
<a class="link" href="server-system-variables.html#sysvar_temptable_use_mmap">
<code class="literal">
temptable_use_mmap
</code>
</a>
</p>
<a class="indexterm" name="idm46045268111840">
</a>
<a class="indexterm" name="idm46045268110800">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for temptable_use_mmap">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--temptable-use-mmap[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_temptable_use_mmap">
temptable_use_mmap
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Defines whether the TempTable storage engine allocates space
for internal in-memory temporary tables as memory-mapped
temporary files when the amount of memory occupied by the
TempTable storage engine exceeds the limit defined by the
<a class="link" href="server-system-variables.html#sysvar_temptable_max_ram">
<code class="literal">
temptable_max_ram
</code>
</a>
variable.
When
<a class="link" href="server-system-variables.html#sysvar_temptable_use_mmap">
<code class="literal">
temptable_use_mmap
</code>
</a>
is
disabled (default), the TempTable storage engine uses
<code class="literal">
InnoDB
</code>
on-disk internal temporary tables
instead. For more information, see
<a class="xref" href="internal-temporary-tables.html" title="10.4.4 Internal Temporary Table Use in MySQL">
Section 10.4.4, “Internal Temporary Table Use in MySQL”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_cache_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_cache_size">
<code class="literal">
thread_cache_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045268079904">
</a>
<a class="indexterm" name="idm46045268078864">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_cache_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-cache-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_cache_size">
thread_cache_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
-1
</code>
(signifies autosizing; do not assign this literal value)
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
16384
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
How many threads the server should cache for reuse. When a
client disconnects, the client's threads are put in the cache
if there are fewer than
<a class="link" href="server-system-variables.html#sysvar_thread_cache_size">
<code class="literal">
thread_cache_size
</code>
</a>
threads
there. Requests for threads are satisfied by reusing threads
taken from the cache if possible, and only when the cache is
empty is a new thread created. This variable can be increased
to improve performance if you have a lot of new connections.
Normally, this does not provide a notable performance
improvement if you have a good thread implementation. However,
if your server sees hundreds of connections per second you
should normally set
<a class="link" href="server-system-variables.html#sysvar_thread_cache_size">
<code class="literal">
thread_cache_size
</code>
</a>
high enough
so that most new connections use cached threads. By examining
the difference between the
<a class="link" href="server-status-variables.html#statvar_Connections">
<code class="literal">
Connections
</code>
</a>
and
<a class="link" href="server-status-variables.html#statvar_Threads_created">
<code class="literal">
Threads_created
</code>
</a>
status
variables, you can see how efficient the thread cache is. For
details, see
<a class="xref" href="server-status-variables.html" title="7.1.10 Server Status Variables">
Section 7.1.10, “Server Status Variables”
</a>
.
</p>
<p>
The default value is based on the following formula, capped to
a limit of 100:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa69513222"><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-simple">8 <span class="token operator">+</span> <span class="token punctuation">(</span>max_connections <span class="token operator">/</span> 100<span class="token punctuation">)</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_handling">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_handling">
<code class="literal">
thread_handling
</code>
</a>
</p>
<a class="indexterm" name="idm46045268041376">
</a>
<a class="indexterm" name="idm46045268040288">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_handling">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-handling=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_handling">
thread_handling
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
one-thread-per-connection
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
no-threads
</code>
</p>
<p class="valid-value">
<code class="literal">
one-thread-per-connection
</code>
</p>
<p class="valid-value">
<code class="literal">
loaded-dynamically
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The thread-handling model used by the server for connection
threads. The permissible values are
<code class="literal">
no-threads
</code>
(the server uses a single thread
to handle one connection),
<code class="literal">
one-thread-per-connection
</code>
(the server uses
one thread to handle each client connection), and
<code class="literal">
loaded-dynamically
</code>
(set by the thread pool
plugin when it initializes).
<code class="literal">
no-threads
</code>
is
useful for debugging under Linux; see
<a class="xref" href="debugging-mysql.html" title="7.9 Debugging MySQL">
Section 7.9, “Debugging MySQL”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_algorithm">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_algorithm">
<code class="literal">
thread_pool_algorithm
</code>
</a>
</p>
<a class="indexterm" name="idm46045268007024">
</a>
<a class="indexterm" name="idm46045268005984">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_algorithm">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-algorithm=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_algorithm">
thread_pool_algorithm
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls which algorithm the thread pool plugin
uses:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
0
</code>
: Use a conservative low-concurrency
algorithm.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
1
</code>
: Use an aggressive high-currency
algorithm which performs better with optimal thread
counts, but performance may be degraded if the number of
connections reaches extremely high values.
</p>
</li>
</ul>
</div>
<p>
This variable is available only if the thread pool plugin is
enabled. See
<a class="xref" href="thread-pool.html" title="7.6.3 MySQL Enterprise Thread Pool">
Section 7.6.3, “MySQL Enterprise Thread Pool”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_dedicated_listeners">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_dedicated_listeners">
<code class="literal">
thread_pool_dedicated_listeners
</code>
</a>
</p>
<a class="indexterm" name="idm46045267971792">
</a>
<a class="indexterm" name="idm46045267970688">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_dedicated_listeners">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-dedicated-listeners
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_dedicated_listeners">
thread_pool_dedicated_listeners
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Dedicates a listener thread in each thread group to listen for
incoming statements from connections assigned to the group.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
OFF
</code>
: (Default) Disables dedicated
listener threads.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ON
</code>
: Dedicates a listener thread in each
thread group to listen for incoming statements from
connections assigned to the group. Dedicated listener
threads do not execute queries.
</p>
</li>
</ul>
</div>
<p>
Enabling
<a class="link" href="server-system-variables.html#sysvar_thread_pool_dedicated_listeners">
<code class="literal">
thread_pool_dedicated_listeners
</code>
</a>
is only useful when a transaction limit is defined by
<code class="literal">
thread_pool_max_transactions_limit
</code>
.
Otherwise,
<a class="link" href="server-system-variables.html#sysvar_thread_pool_dedicated_listeners">
<code class="literal">
thread_pool_dedicated_listeners
</code>
</a>
should not be enabled.
</p>
<p>
HeatWave Service uses this variable, which is available only with MySQL Enterprise Edition,
and not supported in MySQL 8.4.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_high_priority_connection">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_high_priority_connection">
<code class="literal">
thread_pool_high_priority_connection
</code>
</a>
</p>
<a class="indexterm" name="idm46045267937936">
</a>
<a class="indexterm" name="idm46045267936896">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_high_priority_connection">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-high-priority-connection=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_high_priority_connection">
thread_pool_high_priority_connection
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable affects queuing of new statements prior to
execution. If the value is 0 (false, the default), statement
queuing uses both the low-priority and high-priority queues.
If the value is 1 (true), queued statements always go to the
high-priority queue.
</p>
<p>
This variable is available only if the thread pool plugin is
enabled. See
<a class="xref" href="thread-pool.html" title="7.6.3 MySQL Enterprise Thread Pool">
Section 7.6.3, “MySQL Enterprise Thread Pool”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_longrun_trx_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_longrun_trx_limit">
<code class="literal">
thread_pool_longrun_trx_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045267906032">
</a>
<a class="indexterm" name="idm46045267904928">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_longrun_trx_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-longrun-trx-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_longrun_trx_limit">
thread_pool_longrun_trx_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
2000
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
10
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
60*60*24
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
ms
</td>
</tr>
</tbody>
</table>
</div>
<p>
When
<a class="link" href="server-system-variables.html#sysvar_thread_pool_max_transactions_limit">
<code class="literal">
thread_pool_max_transactions_limit
</code>
</a>
is in use, there is a maximum number of transactions that can
be active in each thread group. If entire number available is
being used by long-running transactions, any additional
transaction assigned to the group blocks until one of the
long-running transactions is completed, which users can
perceive as an inexplicable hang.
</p>
<p>
To mitigate this issue, the limit for a given thread group is
suspended if all of the threads using up the transaction
maximum have been executing longer than the interval (in
milliseconds) specified by
<code class="literal">
thread_pool_longrun_trx_limit
</code>
. When the
number of long-running transactions decreases,
<code class="literal">
thread_pool_max_transactions_limit
</code>
can be
(and is) enabled again. In order for this to happen, the
number of ongoing transactions must be less than
<code class="literal">
thread_pool_max_transactions_limit / 2
</code>
for
the interval defined as shown:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa97844416"><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 function">MIN</span><span class="token punctuation">(</span> <span class="token function">MAX</span><span class="token punctuation">(</span>thread_pool_longrun_trx_limit <span class="token operator">*</span> <span class="token number">15</span><span class="token punctuation">,</span> <span class="token number">5000</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token number">30000</span><span class="token punctuation">)</span></code></pre>
</div>
<p>
This variable is available only if the thread pool plugin is
enabled. See
<a class="xref" href="thread-pool.html" title="7.6.3 MySQL Enterprise Thread Pool">
Section 7.6.3, “MySQL Enterprise Thread Pool”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_max_active_query_threads">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_max_active_query_threads">
<code class="literal">
thread_pool_max_active_query_threads
</code>
</a>
</p>
<a class="indexterm" name="idm46045267866384">
</a>
<a class="indexterm" name="idm46045267865344">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_max_active_query_threads">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-max-active-query-threads
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_max_active_query_threads">
thread_pool_max_active_query_threads
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
512
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum permissible number of active (running) query
threads per group. If the value is 0, the thread pool plugin
uses up to as many threads as are available.
</p>
<p>
This variable is available only if the thread pool plugin is
enabled. See
<a class="xref" href="thread-pool.html" title="7.6.3 MySQL Enterprise Thread Pool">
Section 7.6.3, “MySQL Enterprise Thread Pool”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_max_transactions_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_max_transactions_limit">
<code class="literal">
thread_pool_max_transactions_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045267834416">
</a>
<a class="indexterm" name="idm46045267833376">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_max_transactions_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-max-transactions-limit
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_max_transactions_limit">
thread_pool_max_transactions_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
1000000
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum number of transactions permitted by the thread
pool plugin. Defining a transaction limit binds a thread to a
transaction until it commits, which helps stabilize throughput
during high concurrency.
</p>
<p>
The default value of 0 means that there is no transaction
limit. The variable is dynamic but cannot be changed from 0 to
a higher value at runtime and vice versa. A non-zero value at
startup permits dynamic configuration at runtime. The
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
privilege is
required to configure
<code class="literal">
thread_pool_max_transactions_limit
</code>
at
runtime.
</p>
<p>
When you define a transaction limit, enabling
<a class="link" href="server-system-variables.html#sysvar_thread_pool_dedicated_listeners">
<code class="literal">
thread_pool_dedicated_listeners
</code>
</a>
creates a dedicated listener thread in each thread group. The
additional dedicated listener thread consumes more resources
and affects thread pool performance.
<a class="link" href="server-system-variables.html#sysvar_thread_pool_dedicated_listeners">
<code class="literal">
thread_pool_dedicated_listeners
</code>
</a>
should therefore be used cautiously.
</p>
<p>
When the limit defined by
<a class="link" href="server-system-variables.html#sysvar_thread_pool_max_transactions_limit">
<code class="literal">
thread_pool_max_transactions_limit
</code>
</a>
has been reached, new connections or transactions on existing
connections may appear to hang until one or more existing
transactions are completed. It should be possible in many
cases to mitigate this issue by setting
<a class="link" href="server-system-variables.html#sysvar_thread_pool_longrun_trx_limit">
<code class="literal">
thread_pool_longrun_trx_limit
</code>
</a>
so that the transaction maximum can be relaxed when the number
of ongoing transactions matches it for a given length of time.
If existing connections continue to be blocked or long-running
even after attempting this, a privileged connection may be
required to access the server to increase the limit, remove
the limit, or kill running transactions. See
<a class="xref" href="thread-pool-operation.html#privileged-connections" title="Privileged Connections">
Privileged Connections
</a>
.
</p>
<p>
HeatWave Service uses this variable, which is available only with MySQL Enterprise Edition,
and not supported in MySQL 8.4.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_max_unused_threads">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_max_unused_threads">
<code class="literal">
thread_pool_max_unused_threads
</code>
</a>
</p>
<a class="indexterm" name="idm46045267792560">
</a>
<a class="indexterm" name="idm46045267791456">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_max_unused_threads">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-max-unused-threads=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_max_unused_threads">
thread_pool_max_unused_threads
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4096
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum permitted number of unused threads in the thread
pool. This variable makes it possible to limit the amount of
memory used by sleeping threads.
</p>
<p>
A value of 0 (the default) means no limit on the number of
sleeping threads. A value of
<em class="replaceable">
<code>
N
</code>
</em>
where
<em class="replaceable">
<code>
N
</code>
</em>
is greater than 0 means 1
consumer thread and
<em class="replaceable">
<code>
N
</code>
</em>
−1
reserve threads. In this case, if a thread is ready to sleep
but the number of sleeping threads is already at the maximum,
the thread exits rather than going to sleep.
</p>
<p>
A sleeping thread is either sleeping as a consumer thread or a
reserve thread. The thread pool permits one thread to be the
consumer thread when sleeping. If a thread goes to sleep and
there is no existing consumer thread, it sleeps as a consumer
thread. When a thread must be woken up, a consumer thread is
selected if there is one. A reserve thread is selected only
when there is no consumer thread to wake up.
</p>
<p>
This variable is available only if the thread pool plugin is
enabled. See
<a class="xref" href="thread-pool.html" title="7.6.3 MySQL Enterprise Thread Pool">
Section 7.6.3, “MySQL Enterprise Thread Pool”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_prio_kickup_timer">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_prio_kickup_timer">
<code class="literal">
thread_pool_prio_kickup_timer
</code>
</a>
</p>
<a class="indexterm" name="idm46045267757072">
</a>
<a class="indexterm" name="idm46045267755968">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_prio_kickup_timer">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-prio-kickup-timer=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_prio_kickup_timer">
thread_pool_prio_kickup_timer
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1000
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4294967294
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
milliseconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable affects statements waiting for execution in the
low-priority queue. The value is the number of milliseconds
before a waiting statement is moved to the high-priority
queue. The default is 1000 (1 second).
</p>
<p>
This variable is available only if the thread pool plugin is
enabled. See
<a class="xref" href="thread-pool.html" title="7.6.3 MySQL Enterprise Thread Pool">
Section 7.6.3, “MySQL Enterprise Thread Pool”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_query_threads_per_group">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_query_threads_per_group">
<code class="literal">
thread_pool_query_threads_per_group
</code>
</a>
</p>
<a class="indexterm" name="idm46045267722960">
</a>
<a class="indexterm" name="idm46045267721920">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_query_threads_per_group">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-query-threads-per-group
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_query_threads_per_group">
thread_pool_query_threads_per_group
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
4096
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The maximum number of query threads permitted in a thread
group. The maximum value is 4096, but if
<a class="link" href="server-system-variables.html#sysvar_thread_pool_max_transactions_limit">
<code class="literal">
thread_pool_max_transactions_limit
</code>
</a>
is set,
<a class="link" href="server-system-variables.html#sysvar_thread_pool_query_threads_per_group">
<code class="literal">
thread_pool_query_threads_per_group
</code>
</a>
must not exceed that value.
</p>
<p>
The default value of 1 means there is one active query thread
in each thread group, which works well for many loads. When
you are using the high concurrency thread pool algorithm
(
<code class="literal">
thread_pool_algorithm = 1
</code>
), consider
increasing the value if you experience slower response times
due to long-running transactions.
</p>
<p>
The
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
privilege
is required to configure
<a class="link" href="server-system-variables.html#sysvar_thread_pool_query_threads_per_group">
<code class="literal">
thread_pool_query_threads_per_group
</code>
</a>
at runtime.
</p>
<p>
If you decrease the value of
<a class="link" href="server-system-variables.html#sysvar_thread_pool_query_threads_per_group">
<code class="literal">
thread_pool_query_threads_per_group
</code>
</a>
at runtime, threads that are currently running user queries
are allowed to complete, then moved to the reserve pool or
terminated. if you increment the value at runtime and the
thread group needs more threads, these are taken from the
reserve pool if possible, otherwise they are created.
</p>
<p>
HeatWave Service uses this variable, which is available only with MySQL Enterprise Edition,
and not supported in MySQL 8.4.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_size">
<code class="literal">
thread_pool_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045267682656">
</a>
<a class="indexterm" name="idm46045267681568">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_size">
thread_pool_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
16
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
512
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of thread groups in the thread pool. This is the
most important parameter controlling thread pool performance.
It affects how many statements can execute simultaneously. If
a value outside the range of permissible values is specified,
the thread pool plugin does not load and the server writes a
message to the error log.
</p>
<p>
This variable is available only if the thread pool plugin is
enabled. See
<a class="xref" href="thread-pool.html" title="7.6.3 MySQL Enterprise Thread Pool">
Section 7.6.3, “MySQL Enterprise Thread Pool”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_stall_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_stall_limit">
<code class="literal">
thread_pool_stall_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045267650336">
</a>
<a class="indexterm" name="idm46045267649296">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_stall_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-stall-limit=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_stall_limit">
thread_pool_stall_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
6
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
4
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
600
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
milliseconds * 10
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable affects executing statements. The value is the
amount of time a statement has to finish after starting to
execute before it becomes defined as stalled, at which point
the thread pool permits the thread group to begin executing
another statement. The value is measured in 10 millisecond
units, so the default of 6 means 60ms. Short wait values
permit threads to start more quickly. Short values are also
better for avoiding deadlock situations. Long wait values are
useful for workloads that include long-running statements, to
avoid starting too many new statements while the current ones
execute.
</p>
<p>
This variable is available only if the thread pool plugin is
enabled. See
<a class="xref" href="thread-pool.html" title="7.6.3 MySQL Enterprise Thread Pool">
Section 7.6.3, “MySQL Enterprise Thread Pool”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_pool_transaction_delay">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_pool_transaction_delay">
<code class="literal">
thread_pool_transaction_delay
</code>
</a>
</p>
<a class="indexterm" name="idm46045267616016">
</a>
<a class="indexterm" name="idm46045267614912">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_pool_transaction_delay">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-pool-transaction-delay
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_pool_transaction_delay">
thread_pool_transaction_delay
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
300000
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The delay period before executing a new transaction, in
milliseconds. The maximum value is 300000 (5 minutes).
</p>
<p>
A transaction delay can be used in cases where parallel
transactions affect the performance of other operations due to
resource contention. For example, if parallel transactions
affect index creation or an online buffer pool resizing
operation, you can configure a transaction delay to reduce
resource contention while those operations are running.
</p>
<p>
Worker threads sleep for the number of milliseconds specified
by
<code class="literal">
thread_pool_transaction_delay
</code>
before
executing a new transaction.
</p>
<p>
The
<code class="literal">
thread_pool_transaction_delay
</code>
setting
does not affect queries issued from a privileged connection (a
connection assigned to the
<code class="literal">
Admin
</code>
thread
group). These queries are not subject to a configured
transaction delay.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_thread_stack">
</a>
<a class="link" href="server-system-variables.html#sysvar_thread_stack">
<code class="literal">
thread_stack
</code>
</a>
</p>
<a class="indexterm" name="idm46045267581360">
</a>
<a class="indexterm" name="idm46045267580272">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for thread_stack">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--thread-stack=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_thread_stack">
thread_stack
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1048576
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
131072
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (64-bit platforms)
</th>
<td>
<code class="literal">
18446744073709550592
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (32-bit platforms)
</th>
<td>
<code class="literal">
4294966272
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The stack size for each thread. The default is large enough
for normal operation. If the thread stack size is too small,
it limits the complexity of the SQL statements that the server
can handle, the recursion depth of stored procedures, and
other memory-consuming actions.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_time_zone">
</a>
<a class="link" href="server-system-variables.html#sysvar_time_zone">
<code class="literal">
time_zone
</code>
</a>
</p>
<a class="indexterm" name="idm46045267543104">
</a>
<a class="indexterm" name="idm46045267542016">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for time_zone">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_time_zone">
time_zone
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
SYSTEM
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
-13:59
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
+14:00
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The current time zone. This variable is used to initialize the
time zone for each client that connects. By default, the
initial value of this is
<code class="literal">
'SYSTEM'
</code>
(which
means,
<span class="quote">
“
<span class="quote">
use the value of
<a class="link" href="server-system-variables.html#sysvar_system_time_zone">
<code class="literal">
system_time_zone
</code>
</a>
</span>
”
</span>
).
The value can be specified explicitly at server startup with
the
<a class="link" href="server-options.html#option_mysqld_default-time-zone">
<code class="option">
--default-time-zone
</code>
</a>
option.
See
<a class="xref" href="time-zone-support.html" title="7.1.15 MySQL Server Time Zone Support">
Section 7.1.15, “MySQL Server Time Zone Support”
</a>
.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
If set to
<code class="literal">
SYSTEM
</code>
, every MySQL function
call that requires a time zone calculation makes a system
library call to determine the current system time zone. This
call may be protected by a global mutex, resulting in
contention.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_timestamp">
</a>
<a class="link" href="server-system-variables.html#sysvar_timestamp">
<code class="literal">
timestamp
</code>
</a>
</p>
<a class="indexterm" name="idm46045267509248">
</a>
<a class="indexterm" name="idm46045267508160">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for timestamp">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_timestamp">
timestamp
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Numeric
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
UNIX_TIMESTAMP()
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2147483647
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Set the time for this client. This is used to get the original
timestamp if you use the binary log to restore rows.
<em class="replaceable">
<code>
timestamp_value
</code>
</em>
should be a Unix
epoch timestamp (a value like that returned by
<a class="link" href="date-and-time-functions.html#function_unix-timestamp">
<code class="literal">
UNIX_TIMESTAMP()
</code>
</a>
, not a value
in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
'
</code>
format) or
<code class="literal">
DEFAULT
</code>
.
</p>
<p>
Setting
<a class="link" href="server-system-variables.html#sysvar_timestamp">
<code class="literal">
timestamp
</code>
</a>
to a
constant value causes it to retain that value until it is
changed again. Setting
<a class="link" href="server-system-variables.html#sysvar_timestamp">
<code class="literal">
timestamp
</code>
</a>
to
<code class="literal">
DEFAULT
</code>
causes its value to be the current
date and time as of the time it is accessed.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_timestamp">
<code class="literal">
timestamp
</code>
</a>
is a
<code class="literal">
DOUBLE
</code>
rather than
<code class="literal">
BIGINT
</code>
because its value includes a
microseconds part. The maximum value corresponds to
<code class="literal">
'2038-01-19 03:14:07'
</code>
UTC, the same as for
the
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
data type.
</p>
<p>
<code class="literal">
SET timestamp
</code>
affects the value returned by
<a class="link" href="date-and-time-functions.html#function_now">
<code class="literal">
NOW()
</code>
</a>
but not by
<a class="link" href="date-and-time-functions.html#function_sysdate">
<code class="literal">
SYSDATE()
</code>
</a>
. This means that
timestamp settings in the binary log have no effect on
invocations of
<a class="link" href="date-and-time-functions.html#function_sysdate">
<code class="literal">
SYSDATE()
</code>
</a>
. The
server can be started with the
<a class="link" href="server-options.html#option_mysqld_sysdate-is-now">
<code class="option">
--sysdate-is-now
</code>
</a>
option to
cause
<a class="link" href="date-and-time-functions.html#function_sysdate">
<code class="literal">
SYSDATE()
</code>
</a>
to be a synonym
for
<a class="link" href="date-and-time-functions.html#function_now">
<code class="literal">
NOW()
</code>
</a>
, in which case
<code class="literal">
SET timestamp
</code>
affects both functions.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_tls_certificates_enforced_validation">
</a>
<a class="link" href="server-system-variables.html#sysvar_tls_certificates_enforced_validation">
<code class="literal">
tls_certificates_enforced_validation
</code>
</a>
</p>
<a class="indexterm" name="idm46045267459104">
</a>
<a class="indexterm" name="idm46045267458016">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for tls_certificates_enforced_validation">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--tls-certificates-enforced-validation[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_tls_certificates_enforced_validation">
tls_certificates_enforced_validation
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
During startup, the server ensures that the location of each
required SSL certificate file is present in the default data
directory if the file locations are not given on the command
line. However, the server does not validate the certificate
files and, as a result, it is able to start with an invalid
certificate. The
<a class="link" href="server-system-variables.html#sysvar_tls_certificates_enforced_validation">
<code class="literal">
tls_certificates_enforced_validation
</code>
</a>
system variable controls whether certificate validation is
enforced at startup. Discovery of an invalid certificate halts
the startup execution when validation enforcement is enabled.
By default, certificate validation enforcement is disabled
(
<code class="literal">
OFF
</code>
).
</p>
<p>
Validation enforcement can be enabled by specifying the
<code class="option">
--tls-certificates-enforced-validation
</code>
option
on the command line with or without the
<code class="literal">
ON
</code>
value. With validation enforcement enabled, certificates are
also validated at the time of reloading them through the
<a class="link" href="alter-instance.html#alter-instance-reload-tls">
<code class="literal">
ALTER INSTANCE RELOAD TLS
</code>
</a>
statement. This system variable cannot be persisted across
reboots. For more information, see
<a class="xref" href="using-encrypted-connections.html#enforce-certificate-validation" title="Configuring Certificate Validation Enforcement">
Configuring Certificate Validation Enforcement
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_tls_ciphersuites">
</a>
<a class="link" href="server-system-variables.html#sysvar_tls_ciphersuites">
<code class="literal">
tls_ciphersuites
</code>
</a>
</p>
<a class="indexterm" name="idm46045267426992">
</a>
<a class="indexterm" name="idm46045267425904">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for tls_ciphersuites">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--tls-ciphersuites=ciphersuite_list
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_tls_ciphersuites">
tls_ciphersuites
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Which ciphersuites the server permits for encrypted
connections that use TLSv1.3. The value is a list of zero or
more colon-separated ciphersuite names from among those listed
here:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
TLS_AES_128_GCM_SHA256
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TLS_AES_256_GCM_SHA384
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TLS_CHACHA20_POLY1305_SHA256
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TLS_AES_128_CCM_SHA256
</code>
</p>
</li>
</ul>
</div>
<p>
Trying to include any values in the cipher list that are not
shown here when setting this variable raises an error
(
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_blocked_cipher" target="_top">
<code class="literal">
ER_BLOCKED_CIPHER
</code>
</a>
).
</p>
<p>
The ciphersuites that can be named for this variable depend on
the SSL library used to compile MySQL. If this variable is not
set, its default value is
<code class="literal">
NULL
</code>
, which means
that the server permits the default set of ciphersuites. If
the variable is set to the empty string, no ciphersuites are
enabled and encrypted connections cannot be established. For
more information, see
<a class="xref" href="encrypted-connection-protocols-ciphers.html" title="8.3.2 Encrypted Connection TLS Protocols and Ciphers">
Section 8.3.2, “Encrypted Connection TLS Protocols and Ciphers”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_tls_version">
</a>
<a class="link" href="server-system-variables.html#sysvar_tls_version">
<code class="literal">
tls_version
</code>
</a>
</p>
<a class="indexterm" name="idm46045267391088">
</a>
<a class="indexterm" name="idm46045267390000">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for tls_version">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--tls-version=protocol_list
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_tls_version">
tls_version
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
TLSv1.2,TLSv1.3
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Which protocols the server permits for encrypted connections.
The value is a list of one or more comma-separated protocol
names, which are not case-sensitive. The protocols that can be
named for this variable depend on the SSL library used to
compile MySQL. Permitted protocols should be chosen such as
not to leave
<span class="quote">
“
<span class="quote">
holes
</span>
”
</span>
in the list. For details,
see
<a class="xref" href="encrypted-connection-protocols-ciphers.html" title="8.3.2 Encrypted Connection TLS Protocols and Ciphers">
Section 8.3.2, “Encrypted Connection TLS Protocols and Ciphers”
</a>
.
</p>
<p>
This variable can be modified at runtime to affect the TLS
context the server uses for new connections. See
<a class="xref" href="using-encrypted-connections.html#using-encrypted-connections-server-side-runtime-configuration" title="Server-Side Runtime Configuration and Monitoring for Encrypted Connections">
Server-Side Runtime Configuration and Monitoring for Encrypted
Connections
</a>
.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
MySQL 8.4 does not support the TLSv1 and
TLSv1.1 connection protocols. See
<a class="xref" href="encrypted-connection-protocols-ciphers.html#encrypted-connection-deprecated-protocols" title="Removal of Support for the TLSv1 and TLSv1.1 Protocols">
Removal of Support for the TLSv1 and TLSv1.1 Protocols
</a>
for more information.
</p>
</li>
<li class="listitem">
<p>
Support for the TLSv1.3 protocol is available in MySQL
8.4, provided that MySQL Server was
compiled using OpenSSL 1.1.1 or higher. The server
checks the version of OpenSSL at startup, and if it is
lower than 1.1.1, TLSv1.3 is removed from the default
value for the system variable. In that case, the default
is
<code class="literal">
TLSv1.2
</code>
.
</p>
</li>
</ul>
</div>
</div>
<p>
Setting this variable to an empty string disables encrypted
connections.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_tmp_table_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_tmp_table_size">
<code class="literal">
tmp_table_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045267357792">
</a>
<a class="indexterm" name="idm46045267356704">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for tmp_table_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--tmp-table-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_tmp_table_size">
tmp_table_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
16777216
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
18446744073709551615
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
</tbody>
</table>
</div>
<p>
Defines the maximum size of internal in-memory temporary
tables created by the
<code class="literal">
MEMORY
</code>
and
<code class="literal">
TempTable
</code>
storage engines. If an internal
in-memory temporary table exceeds this size, it is
automatically converted to an on-disk internal temporary
table.
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_tmp_table_size">
<code class="literal">
tmp_table_size
</code>
</a>
variable
does not apply to user-created
<code class="literal">
MEMORY
</code>
tables. User-created
<code class="literal">
TempTable
</code>
tables are
not supported.
</p>
<p>
When using the
<code class="literal">
MEMORY
</code>
storage engine for
internal in-memory temporary tables, the actual size limit is
the smaller of
<a class="link" href="server-system-variables.html#sysvar_tmp_table_size">
<code class="literal">
tmp_table_size
</code>
</a>
and
<a class="link" href="server-system-variables.html#sysvar_max_heap_table_size">
<code class="literal">
max_heap_table_size
</code>
</a>
. The
<a class="link" href="server-system-variables.html#sysvar_max_heap_table_size">
<code class="literal">
max_heap_table_size
</code>
</a>
setting
does not apply to
<code class="literal">
TempTable
</code>
tables.
</p>
<p>
Increase the value of
<a class="link" href="server-system-variables.html#sysvar_tmp_table_size">
<code class="literal">
tmp_table_size
</code>
</a>
(and
<a class="link" href="server-system-variables.html#sysvar_max_heap_table_size">
<code class="literal">
max_heap_table_size
</code>
</a>
if
necessary when using the
<code class="literal">
MEMORY
</code>
storage
engine for internal in-memory temporary tables) if you do many
advanced
<code class="literal">
GROUP BY
</code>
queries and you have lots
of memory.
</p>
<p>
You can compare the number of internal on-disk temporary
tables created to the total number of internal temporary
tables created by comparing
<a class="link" href="server-status-variables.html#statvar_Created_tmp_disk_tables">
<code class="literal">
Created_tmp_disk_tables
</code>
</a>
and
<a class="link" href="server-status-variables.html#statvar_Created_tmp_tables">
<code class="literal">
Created_tmp_tables
</code>
</a>
values.
</p>
<p>
See also
<a class="xref" href="internal-temporary-tables.html" title="10.4.4 Internal Temporary Table Use in MySQL">
Section 10.4.4, “Internal Temporary Table Use in MySQL”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_tmpdir">
</a>
<a class="link" href="server-system-variables.html#sysvar_tmpdir">
<code class="literal">
tmpdir
</code>
</a>
</p>
<a class="indexterm" name="idm46045267306112">
</a>
<a class="indexterm" name="idm46045267305040">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for tmpdir">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--tmpdir=dir_name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_tmpdir">
tmpdir
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Directory name
</td>
</tr>
</tbody>
</table>
</div>
<p>
The path of the directory to use for creating temporary files.
It might be useful if your default
<code class="literal">
/tmp
</code>
directory resides on a partition that is too small to hold
temporary tables. This variable can be set to a list of
several paths that are used in round-robin fashion. Paths
should be separated by colon characters (
<code class="literal">
:
</code>
)
on Unix and semicolon characters (
<code class="literal">
;
</code>
) on
Windows.
</p>
<p>
<a class="link" href="server-system-variables.html#sysvar_tmpdir">
<code class="literal">
tmpdir
</code>
</a>
can be a non-permanent
location, such as a directory on a memory-based file system or
a directory that is cleared when the server host restarts. If
the MySQL server is acting as a replica, and you are using a
non-permanent location for
<a class="link" href="server-system-variables.html#sysvar_tmpdir">
<code class="literal">
tmpdir
</code>
</a>
, consider setting a
different temporary directory for the replica using the
<a class="link" href="replication-options-replica.html#sysvar_replica_load_tmpdir">
<code class="literal">
replica_load_tmpdir
</code>
</a>
variable.
For a replica, the temporary files used to replicate
<a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
<code class="literal">
LOAD DATA
</code>
</a>
statements are stored
in this directory, so with a permanent location they can
survive machine restarts, although replication can now
continue after a restart if the temporary files have been
removed.
</p>
<p>
For more information about the storage location of temporary
files, see
<a class="xref" href="temporary-files.html" title="B.3.3.5 Where MySQL Stores Temporary Files">
Section B.3.3.5, “Where MySQL Stores Temporary Files”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_transaction_alloc_block_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_transaction_alloc_block_size">
<code class="literal">
transaction_alloc_block_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045267273408">
</a>
<a class="indexterm" name="idm46045267272304">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for transaction_alloc_block_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--transaction-alloc-block-size=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_transaction_alloc_block_size">
transaction_alloc_block_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
8192
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
131072
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The amount in bytes by which to increase a per-transaction
memory pool which needs memory. See the description of
<a class="link" href="server-system-variables.html#sysvar_transaction_prealloc_size">
<code class="literal">
transaction_prealloc_size
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_transaction_isolation">
</a>
<a class="link" href="server-system-variables.html#sysvar_transaction_isolation">
<code class="literal">
transaction_isolation
</code>
</a>
</p>
<a class="indexterm" name="idm46045267236384">
</a>
<a class="indexterm" name="idm46045267235344">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for transaction-isolation">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--transaction-isolation=name
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_transaction_isolation">
transaction_isolation
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
REPEATABLE-READ
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
READ-UNCOMMITTED
</code>
</p>
<p class="valid-value">
<code class="literal">
READ-COMMITTED
</code>
</p>
<p class="valid-value">
<code class="literal">
REPEATABLE-READ
</code>
</p>
<p class="valid-value">
<code class="literal">
SERIALIZABLE
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The transaction isolation level. The default is
<a class="link" href="innodb-transaction-isolation-levels.html#isolevel_repeatable-read">
<code class="literal">
REPEATABLE-READ
</code>
</a>
.
</p>
<p>
The transaction isolation level has three scopes: global,
session, and next transaction. This three-scope implementation
leads to some nonstandard isolation-level assignment
semantics, as described later.
</p>
<p>
To set the global transaction isolation level at startup, use
the
<a class="link" href="server-options.html#option_mysqld_transaction-isolation">
<code class="option">
--transaction-isolation
</code>
</a>
server option.
</p>
<p>
At runtime, the isolation level can be set directly 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 to assign a value to the
<a class="link" href="server-system-variables.html#sysvar_transaction_isolation">
<code class="literal">
transaction_isolation
</code>
</a>
system
variable, or indirectly using the
<a class="link" href="set-transaction.html" title="15.3.7 SET TRANSACTION Statement">
<code class="literal">
SET
TRANSACTION
</code>
</a>
statement. If you set
<a class="link" href="server-system-variables.html#sysvar_transaction_isolation">
<code class="literal">
transaction_isolation
</code>
</a>
directly to an isolation level name that contains a space, the
name should be enclosed within quotation marks, with the space
replaced by a dash. For example, use this
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
</code>
</a>
statement to set the global value:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa98593769"><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> transaction_isolation <span class="token operator">=</span> <span class="token string">'READ-COMMITTED'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Setting the global
<a class="link" href="server-system-variables.html#sysvar_transaction_isolation">
<code class="literal">
transaction_isolation
</code>
</a>
value
sets the isolation level for all subsequent sessions. Existing
sessions are unaffected.
</p>
<p>
To set the session or next-level
<a class="link" href="server-system-variables.html#sysvar_transaction_isolation">
<code class="literal">
transaction_isolation
</code>
</a>
value,
use 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 most session system variables, these statements
are equivalent ways to set the value:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa7868422"><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 variable">@@SESSION.<em class="replaceable">var_name</em></span> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token keyword">SESSION</span> <em class="replaceable">var_name</em> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <em class="replaceable">var_name</em> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token variable">@@<em class="replaceable">var_name</em></span> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span></code></pre>
</div>
<p>
As mentioned previously, the transaction isolation level has a
next-transaction scope, in addition to the global and session
scopes. To enable the next-transaction scope to be set,
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
</code>
</a>
syntax for assigning session system variable values has
nonstandard semantics for
<a class="link" href="server-system-variables.html#sysvar_transaction_isolation">
<code class="literal">
transaction_isolation
</code>
</a>
:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
To set the session isolation level, use any of these
syntaxes:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa9668898"><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 variable">@@SESSION.transaction_isolation</span> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token keyword">SESSION</span> transaction_isolation <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> transaction_isolation <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span></code></pre>
</div>
<p>
For each of those syntaxes, these semantics apply:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: square; ">
<li class="listitem">
<p>
Sets the isolation level for all subsequent
transactions performed within the session.
</p>
</li>
<li class="listitem">
<p>
Permitted within transactions, but does not affect the
current ongoing transaction.
</p>
</li>
<li class="listitem">
<p>
If executed between transactions, overrides any
preceding statement that sets the next-transaction
isolation level.
</p>
</li>
<li class="listitem">
<p>
Corresponds to
<a class="link" href="set-transaction.html" title="15.3.7 SET TRANSACTION Statement">
<code class="literal">
SET
SESSION TRANSACTION ISOLATION LEVEL
</code>
</a>
(with
the
<code class="literal">
SESSION
</code>
keyword).
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
To set the next-transaction isolation level, use this
syntax:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa30157045"><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 variable">@@transaction_isolation</span> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span></code></pre>
</div>
<p>
For that syntax, these semantics apply:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: square; ">
<li class="listitem">
<p>
Sets the isolation level only for the next single
transaction performed within the session.
</p>
</li>
<li class="listitem">
<p>
Subsequent transactions revert to the session
isolation level.
</p>
</li>
<li class="listitem">
<p>
Not permitted within transactions.
</p>
</li>
<li class="listitem">
<p>
Corresponds to
<a class="link" href="set-transaction.html" title="15.3.7 SET TRANSACTION Statement">
<code class="literal">
SET
TRANSACTION ISOLATION LEVEL
</code>
</a>
(without the
<code class="literal">
SESSION
</code>
keyword).
</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<p>
For more information about
<a class="link" href="set-transaction.html" title="15.3.7 SET TRANSACTION Statement">
<code class="literal">
SET
TRANSACTION
</code>
</a>
and its relationship to the
<a class="link" href="server-system-variables.html#sysvar_transaction_isolation">
<code class="literal">
transaction_isolation
</code>
</a>
system
variable, see
<a class="xref" href="set-transaction.html" title="15.3.7 SET TRANSACTION Statement">
Section 15.3.7, “SET TRANSACTION Statement”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_transaction_prealloc_size">
</a>
<a class="link" href="server-system-variables.html#sysvar_transaction_prealloc_size">
<code class="literal">
transaction_prealloc_size
</code>
</a>
</p>
<a class="indexterm" name="idm46045267158944">
</a>
<a class="indexterm" name="idm46045267157840">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for transaction_prealloc_size">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--transaction-prealloc-size=#
</code>
</td>
</tr>
<tr>
<th>
Deprecated
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_transaction_prealloc_size">
transaction_prealloc_size
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
4096
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
131072
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
bytes
</td>
</tr>
<tr>
<th>
<a class="link" href="server-system-variables.html#system-variables-block-size" title="Note">
Block Size
</a>
</th>
<td>
<code class="literal">
1024
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
There is a per-transaction memory pool from which various
transaction-related allocations take memory. The initial size
of the pool in bytes is
<code class="literal">
transaction_prealloc_size
</code>
. For every
allocation that cannot be satisfied from the pool because it
has insufficient memory available, the pool is increased by
<a class="link" href="server-system-variables.html#sysvar_transaction_alloc_block_size">
<code class="literal">
transaction_alloc_block_size
</code>
</a>
bytes. When the transaction ends, the pool is truncated to
<code class="literal">
transaction_prealloc_size
</code>
bytes. By making
<code class="literal">
transaction_prealloc_size
</code>
sufficiently
large to contain all statements within a single transaction,
you can avoid many
<code class="literal">
malloc()
</code>
calls.
</p>
<p>
<code class="literal">
transaction_prealloc_size
</code>
is deprecated,
and setting this variable no longer has any effect. Expect
<code class="literal">
transaction_prealloc_size
</code>
to be removed in
a future release of MySQL.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_transaction_read_only">
</a>
<a class="link" href="server-system-variables.html#sysvar_transaction_read_only">
<code class="literal">
transaction_read_only
</code>
</a>
</p>
<a class="indexterm" name="idm46045267113824">
</a>
<a class="indexterm" name="idm46045267112784">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for transaction-read-only">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--transaction-read-only[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_transaction_read_only">
transaction_read_only
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
OFF
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The transaction access mode. The value can be
<code class="literal">
OFF
</code>
(read/write; the default) or
<code class="literal">
ON
</code>
(read only).
</p>
<p>
The transaction access mode has three scopes: global, session,
and next transaction. This three-scope implementation leads to
some nonstandard access-mode assignment semantics, as
described later.
</p>
<p>
To set the global transaction access mode at startup, use the
<a class="link" href="server-options.html#option_mysqld_transaction-read-only">
<code class="option">
--transaction-read-only
</code>
</a>
server
option.
</p>
<p>
At runtime, the access mode can be set directly 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 to assign a value to the
<a class="link" href="server-system-variables.html#sysvar_transaction_read_only">
<code class="literal">
transaction_read_only
</code>
</a>
system
variable, or indirectly using the
<a class="link" href="set-transaction.html" title="15.3.7 SET TRANSACTION Statement">
<code class="literal">
SET
TRANSACTION
</code>
</a>
statement. For example, use this
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
</code>
</a>
statement to set the global value:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa79528805"><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> transaction_read_only <span class="token operator">=</span> <span class="token keyword">ON</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Setting the global
<a class="link" href="server-system-variables.html#sysvar_transaction_read_only">
<code class="literal">
transaction_read_only
</code>
</a>
value
sets the access mode for all subsequent sessions. Existing
sessions are unaffected.
</p>
<p>
To set the session or next-level
<a class="link" href="server-system-variables.html#sysvar_transaction_read_only">
<code class="literal">
transaction_read_only
</code>
</a>
value,
use 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 most session system variables, these statements
are equivalent ways to set the value:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa16273460"><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 variable">@@SESSION.<em class="replaceable">var_name</em></span> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token keyword">SESSION</span> <em class="replaceable">var_name</em> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <em class="replaceable">var_name</em> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token variable">@@<em class="replaceable">var_name</em></span> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span></code></pre>
</div>
<p>
As mentioned previously, the transaction access mode has a
next-transaction scope, in addition to the global and session
scopes. To enable the next-transaction scope to be set,
<a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
<code class="literal">
SET
</code>
</a>
syntax for assigning session system variable values has
nonstandard semantics for
<a class="link" href="server-system-variables.html#sysvar_transaction_read_only">
<code class="literal">
transaction_read_only
</code>
</a>
,
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
To set the session access mode, use any of these syntaxes:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa71468346"><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 variable">@@SESSION.transaction_read_only</span> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token keyword">SESSION</span> transaction_read_only <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> transaction_read_only <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span></code></pre>
</div>
<p>
For each of those syntaxes, these semantics apply:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: square; ">
<li class="listitem">
<p>
Sets the access mode for all subsequent transactions
performed within the session.
</p>
</li>
<li class="listitem">
<p>
Permitted within transactions, but does not affect the
current ongoing transaction.
</p>
</li>
<li class="listitem">
<p>
If executed between transactions, overrides any
preceding statement that sets the next-transaction
access mode.
</p>
</li>
<li class="listitem">
<p>
Corresponds to
<a class="link" href="set-transaction.html" title="15.3.7 SET TRANSACTION Statement">
<code class="literal">
SET
SESSION TRANSACTION {READ WRITE | READ ONLY}
</code>
</a>
(with the
<code class="literal">
SESSION
</code>
keyword).
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
To set the next-transaction access mode, use this syntax:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa97939771"><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 variable">@@transaction_read_only</span> <span class="token operator">=</span> <span class="token keyword"><em class="replaceable">value</em></span><span class="token punctuation">;</span></code></pre>
</div>
<p>
For that syntax, these semantics apply:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: square; ">
<li class="listitem">
<p>
Sets the access mode only for the next single
transaction performed within the session.
</p>
</li>
<li class="listitem">
<p>
Subsequent transactions revert to the session access
mode.
</p>
</li>
<li class="listitem">
<p>
Not permitted within transactions.
</p>
</li>
<li class="listitem">
<p>
Corresponds to
<a class="link" href="set-transaction.html" title="15.3.7 SET TRANSACTION Statement">
<code class="literal">
SET
TRANSACTION {READ WRITE | READ ONLY}
</code>
</a>
(without the
<code class="literal">
SESSION
</code>
keyword).
</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<p>
For more information about
<a class="link" href="set-transaction.html" title="15.3.7 SET TRANSACTION Statement">
<code class="literal">
SET
TRANSACTION
</code>
</a>
and its relationship to the
<a class="link" href="server-system-variables.html#sysvar_transaction_read_only">
<code class="literal">
transaction_read_only
</code>
</a>
system
variable, see
<a class="xref" href="set-transaction.html" title="15.3.7 SET TRANSACTION Statement">
Section 15.3.7, “SET TRANSACTION Statement”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_unique_checks">
</a>
<a class="link" href="server-system-variables.html#sysvar_unique_checks">
<code class="literal">
unique_checks
</code>
</a>
</p>
<a class="indexterm" name="idm46045267043552">
</a>
<a class="indexterm" name="idm46045267042464">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for unique_checks">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_unique_checks">
unique_checks
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
If set to 1 (the default), uniqueness checks for secondary
indexes in
<code class="literal">
InnoDB
</code>
tables are performed. If
set to 0, storage engines are permitted to assume that
duplicate keys are not present in input data. If you know for
certain that your data does not contain uniqueness violations,
you can set this to 0 to speed up large table imports to
<code class="literal">
InnoDB
</code>
.
</p>
<p>
Setting this variable to 0 does not
<span class="emphasis">
<em>
require
</em>
</span>
storage engines to ignore
duplicate keys. An engine is still permitted to check for them
and issue duplicate-key errors if it detects them.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_updatable_views_with_limit">
</a>
<a class="link" href="server-system-variables.html#sysvar_updatable_views_with_limit">
<code class="literal">
updatable_views_with_limit
</code>
</a>
</p>
<a class="indexterm" name="idm46045267017536">
</a>
<a class="indexterm" name="idm46045267016432">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for updatable_views_with_limit">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--updatable-views-with-limit[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_updatable_views_with_limit">
updatable_views_with_limit
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
This variable controls whether updates to a view can be made
when the view does not contain all columns of the primary key
defined in the underlying table, if the update statement
contains a
<code class="literal">
LIMIT
</code>
clause. (Such updates
often are generated by GUI tools.) An update is an
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
or
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
statement. Primary key
here means a
<code class="literal">
PRIMARY KEY
</code>
, or a
<code class="literal">
UNIQUE
</code>
index in which no column can contain
<code class="literal">
NULL
</code>
.
</p>
<p>
The variable can have two values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
1
</code>
or
<code class="literal">
YES
</code>
: Issue a
warning only (not an error message). This is the default
value.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
0
</code>
or
<code class="literal">
NO
</code>
: Prohibit
the update.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a name="sysvar_use_secondary_engine">
</a>
<a class="link" href="server-system-variables.html#sysvar_use_secondary_engine">
<code class="literal">
use_secondary_engine
</code>
</a>
</p>
<a class="indexterm" name="idm46045266980928">
</a>
<a class="indexterm" name="idm46045266979888">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for use_secondary_engine">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_use_secondary_engine">
use_secondary_engine
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
OFF
</code>
</p>
<p class="valid-value">
<code class="literal">
ON
</code>
</p>
<p class="valid-value">
<code class="literal">
FORCED
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
For future use.
</p>
<p>
Whether to execute queries using a secondary engine.
</p>
<p>
For use with HeatWave. See
<a class="ulink" href="/doc/heatwave/en/" target="_top">
HeatWave User Guide
</a>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
validate_password.
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
</p>
<p>
The
<code class="literal">
validate_password
</code>
component implements
a set of system variables having names of the form
<code class="literal">
validate_password.
<em class="replaceable">
<code>
xxx
</code>
</em>
</code>
.
These variables affect password testing by that component; see
<a class="xref" href="validate-password-options-variables.html" title="8.4.3.2 Password Validation Options and Variables">
Section 8.4.3.2, “Password Validation Options and Variables”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_version">
</a>
<a class="link" href="server-system-variables.html#sysvar_version">
<code class="literal">
version
</code>
</a>
</p>
<a class="indexterm" name="idm46045266946752">
</a>
<a class="indexterm" name="idm46045266945680">
</a>
<p>
The version number for the server. The value might also
include a suffix indicating server build or configuration
information.
<code class="option">
-debug
</code>
indicates that the server
was built with debugging support enabled.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_version_comment">
</a>
<a class="link" href="server-system-variables.html#sysvar_version_comment">
<code class="literal">
version_comment
</code>
</a>
</p>
<a class="indexterm" name="idm46045266940784">
</a>
<a class="indexterm" name="idm46045266939696">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for version_comment">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_version_comment">
version_comment
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
The
<span class="command">
<strong>
CMake
</strong>
</span>
configuration program has a
<a class="link" href="source-configuration-options.html#option_cmake_compilation_comment_server">
<code class="option">
COMPILATION_COMMENT_SERVER
</code>
</a>
option that permits a comment to be specified when building
MySQL. This variable contains the value of that comment.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_version_compile_machine">
</a>
<a class="link" href="server-system-variables.html#sysvar_version_compile_machine">
<code class="literal">
version_compile_machine
</code>
</a>
</p>
<a class="indexterm" name="idm46045266918176">
</a>
<a class="indexterm" name="idm46045266917136">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for version_compile_machine">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_version_compile_machine">
version_compile_machine
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
The type of the server binary.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_version_compile_os">
</a>
<a class="link" href="server-system-variables.html#sysvar_version_compile_os">
<code class="literal">
version_compile_os
</code>
</a>
</p>
<a class="indexterm" name="idm46045266897424">
</a>
<a class="indexterm" name="idm46045266896384">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for version_compile_os">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_version_compile_os">
version_compile_os
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
The type of operating system on which MySQL was built.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_version_compile_zlib">
</a>
<a class="link" href="server-system-variables.html#sysvar_version_compile_zlib">
<code class="literal">
version_compile_zlib
</code>
</a>
</p>
<a class="indexterm" name="idm46045266876704">
</a>
<a class="indexterm" name="idm46045266875664">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for version_compile_zlib">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_version_compile_zlib">
version_compile_zlib
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
No
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
</tbody>
</table>
</div>
<p>
The version of the compiled-in
<code class="literal">
zlib
</code>
library.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_wait_timeout">
</a>
<a class="link" href="server-system-variables.html#sysvar_wait_timeout">
<code class="literal">
wait_timeout
</code>
</a>
</p>
<a class="indexterm" name="idm46045266855392">
</a>
<a class="indexterm" name="idm46045266854304">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for wait_timeout">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--wait-timeout=#
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_wait_timeout">
wait_timeout
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
28800
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
1
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Windows)
</th>
<td>
<code class="literal">
2147483
</code>
</td>
</tr>
<tr>
<th>
Maximum Value (Other)
</th>
<td>
<code class="literal">
31536000
</code>
</td>
</tr>
<tr>
<th>
Unit
</th>
<td>
seconds
</td>
</tr>
</tbody>
</table>
</div>
<p>
The number of seconds the server waits for activity on a
noninteractive connection before closing it.
</p>
<p>
On thread startup, the session
<a class="link" href="server-system-variables.html#sysvar_wait_timeout">
<code class="literal">
wait_timeout
</code>
</a>
value is
initialized from the global
<a class="link" href="server-system-variables.html#sysvar_wait_timeout">
<code class="literal">
wait_timeout
</code>
</a>
value or from
the global
<a class="link" href="server-system-variables.html#sysvar_interactive_timeout">
<code class="literal">
interactive_timeout
</code>
</a>
value,
depending on the type of client (as defined by the
<code class="literal">
CLIENT_INTERACTIVE
</code>
connect option to
<a class="ulink" href="/doc/c-api/8.4/en/mysql-real-connect.html" target="_top">
<code class="literal">
mysql_real_connect()
</code>
</a>
). See
also
<a class="link" href="server-system-variables.html#sysvar_interactive_timeout">
<code class="literal">
interactive_timeout
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_warning_count">
</a>
<a class="link" href="server-system-variables.html#sysvar_warning_count">
<code class="literal">
warning_count
</code>
</a>
</p>
<a class="indexterm" name="idm46045266812912">
</a>
<a class="indexterm" name="idm46045266811824">
</a>
<p>
The number of errors, warnings, and notes that resulted from
the last statement that generated messages. This variable is
read only. See
<a class="xref" href="show-warnings.html" title="15.7.7.42 SHOW WARNINGS Statement">
Section 15.7.7.42, “SHOW WARNINGS Statement”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_windowing_use_high_precision">
</a>
<a class="link" href="server-system-variables.html#sysvar_windowing_use_high_precision">
<code class="literal">
windowing_use_high_precision
</code>
</a>
</p>
<a class="indexterm" name="idm46045266806672">
</a>
<a class="indexterm" name="idm46045266805568">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for windowing_use_high_precision">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--windowing-use-high-precision[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_windowing_use_high_precision">
windowing_use_high_precision
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Whether to compute window operations without loss of
precision. See
<a class="xref" href="window-function-optimization.html" title="10.2.1.21 Window Function Optimization">
Section 10.2.1.21, “Window Function Optimization”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="sysvar_xa_detach_on_prepare">
</a>
<a class="link" href="server-system-variables.html#sysvar_xa_detach_on_prepare">
<code class="literal">
xa_detach_on_prepare
</code>
</a>
</p>
<a class="indexterm" name="idm46045266779984">
</a>
<a class="indexterm" name="idm46045266778944">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for xa_detach_on_prepare">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--xa-detach-on-prepare[={OFF|ON}]
</code>
</td>
</tr>
<tr>
<th>
System Variable
</th>
<td>
<code class="literal">
<a class="link" href="server-system-variables.html#sysvar_xa_detach_on_prepare">
xa_detach_on_prepare
</a>
</code>
</td>
</tr>
<tr>
<th>
Scope
</th>
<td>
Global, Session
</td>
</tr>
<tr>
<th>
Dynamic
</th>
<td>
Yes
</td>
</tr>
<tr>
<th>
<a class="link" href="optimizer-hints.html#optimizer-hints-set-var" title="Variable-Setting Hint Syntax">
<code class="literal">
SET_VAR
</code>
</a>
Hint Applies
</th>
<td>
No
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Boolean
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
ON
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
When set to
<code class="literal">
ON
</code>
(enabled), all XA
transactions are detached (disconnected) from the connection
(session) as part of
<a class="link" href="xa-statements.html" title="15.3.8.1 XA Transaction SQL Statements">
<code class="literal">
XA
PREPARE
</code>
</a>
. This means that the XA transaction can be
committed or rolled back by another connection, even if the
originating connection has not terminated, and this connection
can start new transactions.
</p>
<p>
Temporary tables cannot be used inside detached XA
transactions.
</p>
<p>
When this is
<code class="literal">
OFF
</code>
(disabled), an XA
transaction is strictly associated with the same connection
until the session disconnects. It is recommended that you
allow it to be enabled (the default behavior) for replication.
</p>
<p>
For more information, see
<a class="xref" href="xa-states.html" title="15.3.8.2 XA Transaction States">
Section 15.3.8.2, “XA Transaction States”
</a>
.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/rebuilding-tables.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="rebuilding-tables">
</a>
3.14 Rebuilding or Repairing Tables or Indexes
</h2>
</div>
</div>
</div>
<a class="indexterm" name="idm46045325860784">
</a>
<a class="indexterm" name="idm46045325859328">
</a>
<a class="indexterm" name="idm46045325857840">
</a>
<p>
This section describes how to rebuild or repair tables or indexes,
which may be necessitated by:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Changes to how MySQL handles data types or character sets. For
example, an error in a collation might have been corrected,
necessitating a table rebuild to update the indexes for
character columns that use the collation.
</p>
</li>
<li class="listitem">
<p>
Required table repairs or upgrades reported by
<a class="link" href="check-table.html" title="15.7.3.2 CHECK TABLE Statement">
<code class="literal">
CHECK TABLE
</code>
</a>
or
<a class="link" href="mysqlcheck.html" title="6.5.3 mysqlcheck — A Table Maintenance Program">
<span class="command">
<strong>
mysqlcheck
</strong>
</span>
</a>
.
</p>
</li>
</ul>
</div>
<p>
Methods for rebuilding a table include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="xref" href="rebuilding-tables.html#rebuilding-tables-dump-reload" title="Dump and Reload Method">
Dump and Reload Method
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="rebuilding-tables.html#rebuilding-tables-alter-table" title="ALTER TABLE Method">
ALTER TABLE Method
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="rebuilding-tables.html#rebuilding-tables-repair-table" title="REPAIR TABLE Method">
REPAIR TABLE Method
</a>
</p>
</li>
</ul>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="rebuilding-tables-dump-reload">
</a>
Dump and Reload Method
</h3>
</div>
</div>
</div>
<p>
If you are rebuilding tables because a different version of
MySQL cannot handle them after a binary (in-place) upgrade or
downgrade, you must use the dump-and-reload method. Dump the
tables
<span class="emphasis">
<em>
before
</em>
</span>
upgrading or downgrading
using your original version of MySQL. Then reload the tables
<span class="emphasis">
<em>
after
</em>
</span>
upgrading or downgrading.
</p>
<p>
If you use the dump-and-reload method of rebuilding tables only
for the purpose of rebuilding indexes, you can perform the dump
either before or after upgrading or downgrading. Reloading still
must be done afterward.
</p>
<p>
If you need to rebuild an
<code class="literal">
InnoDB
</code>
table
because a
<a class="link" href="check-table.html" title="15.7.3.2 CHECK TABLE Statement">
<code class="literal">
CHECK TABLE
</code>
</a>
operation
indicates that a table upgrade is required, use
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
to create a dump file and
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
to reload the file. If the
<a class="link" href="check-table.html" title="15.7.3.2 CHECK TABLE Statement">
<code class="literal">
CHECK TABLE
</code>
</a>
operation indicates
that there is a corruption or causes
<code class="literal">
InnoDB
</code>
to fail, refer to
<a class="xref" href="forcing-innodb-recovery.html" title="17.20.3 Forcing InnoDB Recovery">
Section 17.20.3, “Forcing InnoDB Recovery”
</a>
for
information about using the
<a class="link" href="innodb-parameters.html#sysvar_innodb_force_recovery">
<code class="literal">
innodb_force_recovery
</code>
</a>
option to
restart
<code class="literal">
InnoDB
</code>
. To understand the type of
problem that
<a class="link" href="check-table.html" title="15.7.3.2 CHECK TABLE Statement">
<code class="literal">
CHECK TABLE
</code>
</a>
may be
encountering, refer to the
<code class="literal">
InnoDB
</code>
notes in
<a class="xref" href="check-table.html" title="15.7.3.2 CHECK TABLE Statement">
Section 15.7.3.2, “CHECK TABLE Statement”
</a>
.
</p>
<p>
To rebuild a table by dumping and reloading it, use
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
to create a dump file and
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
to reload the file:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa79568684"><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">mysqldump <em class="replaceable">db_name</em> t1 > dump<span class="token punctuation">.</span>sql
mysql <em class="replaceable">db_name</em> < dump<span class="token punctuation">.</span>sql</code></pre>
</div>
<p>
To rebuild all the tables in a single database, specify the
database name without any following table name:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa69480297"><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">mysqldump <em class="replaceable">db_name</em> > dump<span class="token punctuation">.</span>sql
mysql <em class="replaceable">db_name</em> < dump<span class="token punctuation">.</span>sql</code></pre>
</div>
<p>
To rebuild all tables in all databases, use the
<a class="link" href="mysqldump.html#option_mysqldump_all-databases">
<code class="option">
--all-databases
</code>
</a>
option:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa19300286"><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">mysqldump <span class="token property">--all-databases</span> > dump<span class="token punctuation">.</span>sql
mysql < dump<span class="token punctuation">.</span>sql</code></pre>
</div>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="rebuilding-tables-alter-table">
</a>
ALTER TABLE Method
</h3>
</div>
</div>
</div>
<p>
To rebuild a table with
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER
TABLE
</code>
</a>
, use a
<span class="quote">
“
<span class="quote">
null
</span>
”
</span>
alteration; that is,
an
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
statement that
<span class="quote">
“
<span class="quote">
changes
</span>
”
</span>
the table to use the storage engine that
it already has. For example, if
<code class="literal">
t1
</code>
is an
<code class="literal">
InnoDB
</code>
table, use this statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa62473108"><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">ALTER</span> <span class="token keyword">TABLE</span> t1 <span class="token keyword">ENGINE</span> <span class="token operator">=</span> InnoDB<span class="token punctuation">;</span></code></pre>
</div>
<p>
If you are not sure which storage engine to specify in the
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
statement, use
<a class="link" href="show-create-table.html" title="15.7.7.11 SHOW CREATE TABLE Statement">
<code class="literal">
SHOW CREATE TABLE
</code>
</a>
to display the
table definition.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title">
<a name="rebuilding-tables-repair-table">
</a>
REPAIR TABLE Method
</h3>
</div>
</div>
</div>
<p>
The
<a class="link" href="repair-table.html" title="15.7.3.5 REPAIR TABLE Statement">
<code class="literal">
REPAIR TABLE
</code>
</a>
method is only
applicable to
<code class="literal">
MyISAM
</code>
,
<code class="literal">
ARCHIVE
</code>
, and
<code class="literal">
CSV
</code>
tables.
</p>
<p>
You can use
<a class="link" href="repair-table.html" title="15.7.3.5 REPAIR TABLE Statement">
<code class="literal">
REPAIR TABLE
</code>
</a>
if the
table checking operation indicates that there is a corruption or
that an upgrade is required. For example, to repair a
<code class="literal">
MyISAM
</code>
table, use this statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa53678265"><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">REPAIR</span> <span class="token keyword">TABLE</span> t1<span class="token punctuation">;</span></code></pre>
</div>
<p>
<a class="link" href="mysqlcheck.html" title="6.5.3 mysqlcheck — A Table Maintenance Program">
<span class="command">
<strong>
mysqlcheck --repair
</strong>
</span>
</a>
provides command-line
access to the
<a class="link" href="repair-table.html" title="15.7.3.5 REPAIR TABLE Statement">
<code class="literal">
REPAIR TABLE
</code>
</a>
statement. This can be a more convenient means of repairing
tables because you can use the
<a class="link" href="mysqlcheck.html#option_mysqlcheck_databases">
<code class="option">
--databases
</code>
</a>
or
<a class="link" href="mysqlcheck.html#option_mysqlcheck_all-databases">
<code class="option">
--all-databases
</code>
</a>
option to
repair all tables in specific databases or all databases,
respectively:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa84546195"><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">mysqlcheck <span class="token property">--repair</span> <span class="token property">--databases</span> <em class="replaceable">db_name</em> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
mysqlcheck <span class="token property">--repair</span> <span class="token property">--all-databases</span></code></pre>
</div>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/handler.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="handler">
</a>
15.2.5 HANDLER Statement
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045182744768">
</a>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa6463351"><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">HANDLER</span> <em class="replaceable">tbl_name</em> <span class="token keyword">OPEN</span> <span class="token punctuation">[</span> <span class="token punctuation">[</span><span class="token keyword">AS</span><span class="token punctuation">]</span> <em class="replaceable">alias</em><span class="token punctuation">]</span>
<span class="token keyword">HANDLER</span> <em class="replaceable">tbl_name</em> <span class="token keyword">READ</span> <em class="replaceable">index_name</em> { <span class="token operator">=</span> <span class="token operator">|</span> <span class="token operator"><=</span> <span class="token operator">|</span> <span class="token operator">>=</span> <span class="token operator">|</span> <span class="token operator"><</span> <span class="token operator">|</span> <span class="token operator">></span> } <span class="token punctuation">(</span><em class="replaceable">value1</em><span class="token punctuation">,</span><em class="replaceable">value2</em><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 keyword">WHERE</span> <em class="replaceable">where_condition</em> <span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token keyword">LIMIT</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token punctuation">]</span>
<span class="token keyword">HANDLER</span> <em class="replaceable">tbl_name</em> <span class="token keyword">READ</span> <em class="replaceable">index_name</em> { <span class="token keyword">FIRST</span> <span class="token operator">|</span> <span class="token keyword">NEXT</span> <span class="token operator">|</span> <span class="token keyword">PREV</span> <span class="token operator">|</span> <span class="token keyword">LAST</span> }
<span class="token punctuation">[</span> <span class="token keyword">WHERE</span> <em class="replaceable">where_condition</em> <span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token keyword">LIMIT</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token punctuation">]</span>
<span class="token keyword">HANDLER</span> <em class="replaceable">tbl_name</em> <span class="token keyword">READ</span> { <span class="token keyword">FIRST</span> <span class="token operator">|</span> <span class="token keyword">NEXT</span> }
<span class="token punctuation">[</span> <span class="token keyword">WHERE</span> <em class="replaceable">where_condition</em> <span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token keyword">LIMIT</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token punctuation">]</span>
<span class="token keyword">HANDLER</span> <em class="replaceable">tbl_name</em> <span class="token keyword">CLOSE</span></code></pre>
</div>
<p>
The
<code class="literal">
HANDLER
</code>
statement provides direct access to
table storage engine interfaces. It is available for
<code class="literal">
InnoDB
</code>
and
<code class="literal">
MyISAM
</code>
tables.
</p>
<p>
The
<code class="literal">
HANDLER ... OPEN
</code>
statement opens a table,
making it accessible using subsequent
<code class="literal">
HANDLER ...
READ
</code>
statements. This table object is not shared by
other sessions and is not closed until the session calls
<code class="literal">
HANDLER ... CLOSE
</code>
or the session terminates.
</p>
<p>
If you open the table using an alias, further references to the
open table with other
<code class="literal">
HANDLER
</code>
statements must
use the alias rather than the table name. If you do not use an
alias, but open the table using a table name qualified by the
database name, further references must use the unqualified table
name. For example, for a table opened using
<code class="literal">
mydb.mytable
</code>
, further references must use
<code class="literal">
mytable
</code>
.
</p>
<p>
The first
<code class="literal">
HANDLER ... READ
</code>
syntax fetches a row
where the index specified satisfies the given values and the
<code class="literal">
WHERE
</code>
condition is met. If you have a
multiple-column index, specify the index column values as a
comma-separated list. Either specify values for all the columns in
the index, or specify values for a leftmost prefix of the index
columns. Suppose that an index
<code class="literal">
my_idx
</code>
includes
three columns named
<code class="literal">
col_a
</code>
,
<code class="literal">
col_b
</code>
, and
<code class="literal">
col_c
</code>
, in that
order. The
<code class="literal">
HANDLER
</code>
statement can specify values
for all three columns in the index, or for the columns in a
leftmost prefix. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa4562167"><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">HANDLER</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token keyword">READ</span> my_idx <span class="token operator">=</span> <span class="token punctuation">(</span>col_a_val<span class="token punctuation">,</span>col_b_val<span class="token punctuation">,</span>col_c_val<span class="token punctuation">)</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token keyword">HANDLER</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token keyword">READ</span> my_idx <span class="token operator">=</span> <span class="token punctuation">(</span>col_a_val<span class="token punctuation">,</span>col_b_val<span class="token punctuation">)</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token keyword">HANDLER</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token keyword">READ</span> my_idx <span class="token operator">=</span> <span class="token punctuation">(</span>col_a_val<span class="token punctuation">)</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span></code></pre>
</div>
<p>
To employ the
<code class="literal">
HANDLER
</code>
interface to refer to a
table's
<code class="literal">
PRIMARY KEY
</code>
, use the quoted identifier
<code class="literal">
`PRIMARY`
</code>
:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa40111632"><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">HANDLER</span> <em class="replaceable">tbl_name</em> <span class="token keyword">READ</span> <span class="token punctuation">`</span><span class="token keyword">PRIMARY</span><span class="token punctuation">`</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span></code></pre>
</div>
<p>
The second
<code class="literal">
HANDLER ... READ
</code>
syntax fetches a
row from the table in index order that matches the
<code class="literal">
WHERE
</code>
condition.
</p>
<p>
The third
<code class="literal">
HANDLER ... READ
</code>
syntax fetches a row
from the table in natural row order that matches the
<code class="literal">
WHERE
</code>
condition. It is faster than
<code class="literal">
HANDLER
<em class="replaceable">
<code>
tbl_name
</code>
</em>
READ
<em class="replaceable">
<code>
index_name
</code>
</em>
</code>
when a full table
scan is desired. Natural row order is the order in which rows are
stored in a
<code class="literal">
MyISAM
</code>
table data file. This
statement works for
<code class="literal">
InnoDB
</code>
tables as well, but
there is no such concept because there is no separate data file.
</p>
<p>
Without a
<code class="literal">
LIMIT
</code>
clause, all forms of
<code class="literal">
HANDLER ... READ
</code>
fetch a single row if one is
available. To return a specific number of rows, include a
<code class="literal">
LIMIT
</code>
clause. It has the same syntax as for the
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statement. See
<a class="xref" href="select.html" title="15.2.13 SELECT Statement">
Section 15.2.13, “SELECT Statement”
</a>
.
</p>
<p>
<code class="literal">
HANDLER ... CLOSE
</code>
closes a table that was
opened with
<code class="literal">
HANDLER ... OPEN
</code>
.
</p>
<p>
There are several reasons to use the
<code class="literal">
HANDLER
</code>
interface instead of normal
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
HANDLER
</code>
is faster than
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
A designated storage engine handler object is allocated
for the
<code class="literal">
HANDLER ... OPEN
</code>
. The object is
reused for subsequent
<code class="literal">
HANDLER
</code>
statements for that table; it need not be reinitialized
for each one.
</p>
</li>
<li class="listitem">
<p>
There is less parsing involved.
</p>
</li>
<li class="listitem">
<p>
There is no optimizer or query-checking overhead.
</p>
</li>
<li class="listitem">
<p>
The handler interface does not have to provide a
consistent look of the data (for example,
<a class="link" href="glossary.html#glos_dirty_read" title="dirty read">
dirty reads
</a>
are
permitted), so the storage engine can use optimizations
that
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
does not
normally permit.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<code class="literal">
HANDLER
</code>
makes it easier to port to MySQL
applications that use a low-level
<code class="literal">
ISAM
</code>
-like
interface.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
HANDLER
</code>
enables you to traverse a database
in a manner that is difficult (or even impossible) to
accomplish with
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
. The
<code class="literal">
HANDLER
</code>
interface is a more natural way to
look at data when working with applications that provide an
interactive user interface to the database.
</p>
</li>
</ul>
</div>
<p>
<code class="literal">
HANDLER
</code>
is a somewhat low-level statement. For
example, it does not provide consistency. That is,
<code class="literal">
HANDLER ... OPEN
</code>
does
<span class="emphasis">
<em>
not
</em>
</span>
take a snapshot of the table, and does
<span class="emphasis">
<em>
not
</em>
</span>
lock the table. This means that after a
<code class="literal">
HANDLER ...
OPEN
</code>
statement is issued, table data can be modified (by
the current session or other sessions) and these modifications
might be only partially visible to
<code class="literal">
HANDLER ...
NEXT
</code>
or
<code class="literal">
HANDLER ... PREV
</code>
scans.
</p>
<p>
An open handler can be closed and marked for reopen, in which case
the handler loses its position in the table. This occurs when both
of the following circumstances are true:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Any session executes
<a class="link" href="flush.html#flush-tables">
<code class="literal">
FLUSH
TABLES
</code>
</a>
or DDL statements on the handler's table.
</p>
</li>
<li class="listitem">
<p>
The session in which the handler is open executes
non-
<code class="literal">
HANDLER
</code>
statements that use tables.
</p>
</li>
</ul>
</div>
<p>
<a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
<code class="literal">
TRUNCATE TABLE
</code>
</a>
for a table closes
all handlers for the table that were opened with
<a class="link" href="handler.html" title="15.2.5 HANDLER Statement">
<code class="literal">
HANDLER OPEN
</code>
</a>
.
</p>
<p>
If a table is flushed with
<a class="link" href="flush.html#flush-tables-with-read-lock-with-list">
<code class="literal">
FLUSH
TABLES
<em class="replaceable">
<code>
tbl_name
</code>
</em>
WITH READ
LOCK
</code>
</a>
was opened with
<code class="literal">
HANDLER
</code>
, the
handler is implicitly flushed and loses its position.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/select-benchmarking.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="select-benchmarking">
</a>
10.13.1 Measuring the Speed of Expressions and Functions
</h3>
</div>
</div>
</div>
<p>
To measure the speed of a specific MySQL expression or function,
invoke the
<a class="link" href="information-functions.html#function_benchmark">
<code class="literal">
BENCHMARK()
</code>
</a>
function
using the
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
client program. Its syntax is
<a class="link" href="information-functions.html#function_benchmark">
<code class="literal">
BENCHMARK(
<em class="replaceable">
<code>
loop_count
</code>
</em>
,
<em class="replaceable">
<code>
expr
</code>
</em>
)
</code>
</a>
.
The return value is always zero, but
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
prints a line displaying approximately how long the statement
took to execute. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa11839927"><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></span> <span class="token keyword">SELECT</span> <span class="token function">BENCHMARK</span><span class="token punctuation">(</span><span class="token number">1000000</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> BENCHMARK(1000000,1<span class="token punctuation">+</span>1) <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>
<span class="token output"><span class="token punctuation">|</span> 0 <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>
<span class="token output">1 row in set (0.32 sec)</span></code></pre>
</div>
<p>
This result was obtained on a Pentium II 400MHz system. It shows
that MySQL can execute 1,000,000 simple addition expressions in
0.32 seconds on that system.
</p>
<p>
The built-in MySQL functions are typically highly optimized, but
there may be some exceptions.
<a class="link" href="information-functions.html#function_benchmark">
<code class="literal">
BENCHMARK()
</code>
</a>
is an excellent tool
for finding out if some function is a problem for your queries.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/replication-options-reference.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="replication-options-reference">
</a>
19.1.6.1 Replication and Binary Logging Option and Variable Reference
</h4>
</div>
</div>
</div>
<p>
The following two sections provide basic information about the
MySQL command-line options and system variables applicable to
replication and the binary log.
</p>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="replication-optvars-list">
</a>
Replication Options and Variables
</h5>
</div>
</div>
</div>
<p>
The command-line options and system variables in the following list
relate to replication source servers and replicas.
<a class="xref" href="replication-options-source.html" title="19.1.6.2 Replication Source Options and Variables">
Section 19.1.6.2, “Replication Source Options and Variables”
</a>
provides more detailed
information about options and variables relating to replication
source servers. For more information about options and variables
relating to replicas, see
<a class="xref" href="replication-options-replica.html" title="19.1.6.3 Replica Server Options and Variables">
Section 19.1.6.3, “Replica Server Options and Variables”
</a>
.
</p>
<div class="itemizedlist">
<a name="replication-optvar-summary-list">
</a>
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_auto_increment_increment">
auto_increment_increment
</a>
</code>
:
AUTO_INCREMENT columns are incremented by this value.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_auto_increment_offset">
auto_increment_offset
</a>
</code>
:
Offset added to AUTO_INCREMENT columns.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Com_xxx">
Com_change_replication_source
</a>
</code>
:
Count of CHANGE REPLICATION SOURCE TO and CHANGE MASTER TO
statements.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Com_xxx">
Com_replica_start
</a>
</code>
:
Count of START REPLICA and START SLAVE statements.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Com_xxx">
Com_replica_stop
</a>
</code>
:
Count of STOP REPLICA and STOP SLAVE statements.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Com_xxx">
Com_show_binary_log_status
</a>
</code>
:
Count of SHOW BINARY LOG STATUS statements; use instead of
Com_show_master_status.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Com_xxx">
Com_show_replica_status
</a>
</code>
:
Count of SHOW REPLICA STATUS and SHOW SLAVE STATUS statements.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Com_xxx">
Com_show_replicas
</a>
</code>
:
Count of SHOW REPLICAS and SHOW SLAVE HOSTS statements.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-gtids.html#sysvar_enforce_gtid_consistency">
enforce_gtid_consistency
</a>
</code>
:
Prevents execution of statements that cannot be logged in
transactionally safe manner.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-gtids.html#sysvar_gtid_executed">
gtid_executed
</a>
</code>
:
Global: All GTIDs in binary log (global) or current transaction
(session). Read-only.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-gtids.html#sysvar_gtid_executed_compression_period">
gtid_executed_compression_period
</a>
</code>
:
Compress gtid_executed table each time this many transactions
have occurred. 0 means never compress this table. Applies only
when binary logging is disabled.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-gtids.html#sysvar_gtid_mode">
gtid_mode
</a>
</code>
:
Controls whether GTID based logging is enabled and what type of
transactions logs can contain.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-gtids.html#sysvar_gtid_next">
gtid_next
</a>
</code>
:
Specifies GTID for subsequent transaction or transactions; see
documentation for details.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-gtids.html#sysvar_gtid_owned">
gtid_owned
</a>
</code>
:
Set of GTIDs owned by this client (session), or by all clients,
together with thread ID of owner (global). Read-only.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-gtids.html#sysvar_gtid_purged">
gtid_purged
</a>
</code>
:
Set of all GTIDs that have been purged from binary log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_immediate_server_version">
immediate_server_version
</a>
</code>
:
MySQL Server release number of server which is immediate
replication source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_init_replica">
init_replica
</a>
</code>
:
Statements that are executed when replica connects to source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_init_slave">
init_slave
</a>
</code>
:
Statements that are executed when replica connects to source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_log_bin_trust_function_creators">
log_bin_trust_function_creators
</a>
</code>
:
If equal to 0 (default), then when --log-bin is used, stored
function creation is allowed only to users having SUPER
privilege and only if function created does not break binary
logging.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_log_statements_unsafe_for_binlog">
log_statements_unsafe_for_binlog
</a>
</code>
:
Disables error 1592 warnings being written to error log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_master-retry-count">
master-retry-count
</a>
</code>
:
Number of tries replica makes to connect to source before giving
up.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_max_relay_log_size">
max_relay_log_size
</a>
</code>
:
If nonzero, relay log is rotated automatically when its size
exceeds this value. If zero, size at which rotation occurs is
determined by value of max_binlog_size.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_original_commit_timestamp">
original_commit_timestamp
</a>
</code>
:
Time when transaction was committed on original source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_original_server_version">
original_server_version
</a>
</code>
:
MySQL Server release number of server on which transaction was
originally committed.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_relay_log">
relay_log
</a>
</code>
:
Location and base name to use for relay logs.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_relay_log_basename">
relay_log_basename
</a>
</code>
:
Complete path to relay log, including file name.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_relay_log_index">
relay_log_index
</a>
</code>
:
Location and name to use for file that keeps list of last relay
logs.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_relay_log_purge">
relay_log_purge
</a>
</code>
:
Determines whether relay logs are purged.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_relay_log_recovery">
relay_log_recovery
</a>
</code>
:
Whether automatic recovery of relay log files from source at
startup is enabled; must be enabled for crash-safe replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_relay_log_space_limit">
relay_log_space_limit
</a>
</code>
:
Maximum space to use for all relay logs.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_checkpoint_group">
replica_checkpoint_group
</a>
</code>
:
Maximum number of transactions processed by multithreaded
replica before checkpoint operation is called to update progress
status. Not supported by NDB Cluster.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_checkpoint_period">
replica_checkpoint_period
</a>
</code>
:
Update progress status of multithreaded replica and flush relay
log info to disk after this number of milliseconds. Not
supported by NDB Cluster.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_compressed_protocol">
replica_compressed_protocol
</a>
</code>
:
Use compression of source/replica protocol.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_exec_mode">
replica_exec_mode
</a>
</code>
:
Allows for switching replication thread between IDEMPOTENT mode
(key and some other errors suppressed) and STRICT mode; STRICT
mode is default, except for NDB Cluster, where IDEMPOTENT is
always used.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_load_tmpdir">
replica_load_tmpdir
</a>
</code>
:
Location where replica should put its temporary files when
replicating LOAD DATA statements.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_max_allowed_packet">
replica_max_allowed_packet
</a>
</code>
:
Maximum size, in bytes, of packet that can be sent from
replication source server to replica; overrides
max_allowed_packet.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_net_timeout">
replica_net_timeout
</a>
</code>
:
Number of seconds to wait for more data from source/replica
connection before aborting read.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Replica_open_temp_tables">
Replica_open_temp_tables
</a>
</code>
:
Number of temporary tables that replication SQL thread currently
has open.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_parallel_type">
replica_parallel_type
</a>
</code>
:
Tells replica to use timestamp information (LOGICAL_CLOCK) or
database partitioning (DATABASE) to parallelize transactions.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_parallel_workers">
replica_parallel_workers
</a>
</code>
:
Number of applier threads for executing replication
transactions; when this is 0 or 1, there is only one applier
thread. NDB Cluster: see documentation.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_pending_jobs_size_max">
replica_pending_jobs_size_max
</a>
</code>
:
Maximum size of replica worker queues holding events not yet
applied.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_preserve_commit_order">
replica_preserve_commit_order
</a>
</code>
:
Ensures that all commits by replica workers happen in same order
as on source to maintain consistency when using parallel applier
threads.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_skip_errors">
replica_skip_errors
</a>
</code>
:
Tells replication thread to continue replication when query
returns error from provided list.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_transaction_retries">
replica_transaction_retries
</a>
</code>
:
Number of times replication SQL thread retries transaction in
case it failed with deadlock or elapsed lock wait timeout,
before giving up and stopping.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_type_conversions">
replica_type_conversions
</a>
</code>
:
Controls type conversion mode on replica. Value is list of zero
or more elements from this list: ALL_LOSSY, ALL_NON_LOSSY. Set
to empty string to disallow type conversions between source and
replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_replicate-do-db">
replicate-do-db
</a>
</code>
:
Tells replication SQL thread to restrict replication to
specified database.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_replicate-do-table">
replicate-do-table
</a>
</code>
:
Tells replication SQL thread to restrict replication to
specified table.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_replicate-ignore-db">
replicate-ignore-db
</a>
</code>
:
Tells replication SQL thread not to replicate to specified
database.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_replicate-ignore-table">
replicate-ignore-table
</a>
</code>
:
Tells replication SQL thread not to replicate to specified
table.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_replicate-rewrite-db">
replicate-rewrite-db
</a>
</code>
:
Updates to database with different name from original.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_replicate-same-server-id">
replicate-same-server-id
</a>
</code>
:
In replication, if enabled, do not skip events having our server
id.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_replicate-wild-do-table">
replicate-wild-do-table
</a>
</code>
:
Tells replication SQL thread to restrict replication to tables
that match specified wildcard pattern.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_replicate-wild-ignore-table">
replicate-wild-ignore-table
</a>
</code>
:
Tells replication SQL thread not to replicate to tables that
match given wildcard pattern.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replication_optimize_for_static_plugin_config">
replication_optimize_for_static_plugin_config
</a>
</code>
:
Shared locks for semisynchronous replication.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replication_sender_observe_commit_only">
replication_sender_observe_commit_only
</a>
</code>
:
Limited callbacks for semisynchronous replication.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_report_host">
report_host
</a>
</code>
:
Host name or IP of replica to be reported to source during
replica registration.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_report_password">
report_password
</a>
</code>
:
Arbitrary password which replica server should report to source;
not same as password for replication user account.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_report_port">
report_port
</a>
</code>
:
Port for connecting to replica reported to source during replica
registration.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_report_user">
report_user
</a>
</code>
:
Arbitrary user name which replica server should report to
source; not same as name used for replication user account.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_rpl_read_size">
rpl_read_size
</a>
</code>
:
Set minimum amount of data in bytes which is read from binary
log files and relay log files.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_clients">
Rpl_semi_sync_master_clients
</a>
</code>
:
Number of semisynchronous replicas.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_master_enabled">
rpl_semi_sync_master_enabled
</a>
</code>
:
Whether semisynchronous replication is enabled on source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_net_avg_wait_time">
Rpl_semi_sync_master_net_avg_wait_time
</a>
</code>
:
Average time source has waited for replies from replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_net_wait_time">
Rpl_semi_sync_master_net_wait_time
</a>
</code>
:
Total time source has waited for replies from replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_net_waits">
Rpl_semi_sync_master_net_waits
</a>
</code>
:
Total number of times source waited for replies from replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_no_times">
Rpl_semi_sync_master_no_times
</a>
</code>
:
Number of times source turned off semisynchronous replication.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_no_tx">
Rpl_semi_sync_master_no_tx
</a>
</code>
:
Number of commits not acknowledged successfully.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_status">
Rpl_semi_sync_master_status
</a>
</code>
:
Whether semisynchronous replication is operational on source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_timefunc_failures">
Rpl_semi_sync_master_timefunc_failures
</a>
</code>
:
Number of times source failed when calling time functions.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_master_timeout">
rpl_semi_sync_master_timeout
</a>
</code>
:
Number of milliseconds to wait for replica acknowledgment.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_master_trace_level">
rpl_semi_sync_master_trace_level
</a>
</code>
:
Semisynchronous replication debug trace level on source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_tx_avg_wait_time">
Rpl_semi_sync_master_tx_avg_wait_time
</a>
</code>
:
Average time source waited for each transaction.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_tx_wait_time">
Rpl_semi_sync_master_tx_wait_time
</a>
</code>
:
Total time source waited for transactions.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_tx_waits">
Rpl_semi_sync_master_tx_waits
</a>
</code>
:
Total number of times source waited for transactions.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_master_wait_for_slave_count">
rpl_semi_sync_master_wait_for_slave_count
</a>
</code>
:
Number of replica acknowledgments source must receive per
transaction before proceeding.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_master_wait_no_slave">
rpl_semi_sync_master_wait_no_slave
</a>
</code>
:
Whether source waits for timeout even with no replicas.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_master_wait_point">
rpl_semi_sync_master_wait_point
</a>
</code>
:
Wait point for replica transaction receipt acknowledgment.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_wait_pos_backtraverse">
Rpl_semi_sync_master_wait_pos_backtraverse
</a>
</code>
:
Total number of times source has waited for event with binary
coordinates lower than events waited for previously.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_wait_sessions">
Rpl_semi_sync_master_wait_sessions
</a>
</code>
:
Number of sessions currently waiting for replica replies.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_master_yes_tx">
Rpl_semi_sync_master_yes_tx
</a>
</code>
:
Number of commits acknowledged successfully.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_rpl_semi_sync_replica_enabled">
rpl_semi_sync_replica_enabled
</a>
</code>
:
Whether semisynchronous replication is enabled on replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_replica_status">
Rpl_semi_sync_replica_status
</a>
</code>
:
Whether semisynchronous replication is operational on replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_rpl_semi_sync_replica_trace_level">
rpl_semi_sync_replica_trace_level
</a>
</code>
:
Semisynchronous replication debug trace level on replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_rpl_semi_sync_slave_enabled">
rpl_semi_sync_slave_enabled
</a>
</code>
:
Whether semisynchronous replication is enabled on replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_slave_status">
Rpl_semi_sync_slave_status
</a>
</code>
:
Whether semisynchronous replication is operational on replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_rpl_semi_sync_slave_trace_level">
rpl_semi_sync_slave_trace_level
</a>
</code>
:
Semisynchronous replication debug trace level on replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_clients">
Rpl_semi_sync_source_clients
</a>
</code>
:
Number of semisynchronous replicas.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_source_enabled">
rpl_semi_sync_source_enabled
</a>
</code>
:
Whether semisynchronous replication is enabled on source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_net_avg_wait_time">
Rpl_semi_sync_source_net_avg_wait_time
</a>
</code>
:
Average time source has waited for replies from replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_net_wait_time">
Rpl_semi_sync_source_net_wait_time
</a>
</code>
:
Total time source has waited for replies from replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_net_waits">
Rpl_semi_sync_source_net_waits
</a>
</code>
:
Total number of times source waited for replies from replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_no_times">
Rpl_semi_sync_source_no_times
</a>
</code>
:
Number of times source turned off semisynchronous replication.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_no_tx">
Rpl_semi_sync_source_no_tx
</a>
</code>
:
Number of commits not acknowledged successfully.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_status">
Rpl_semi_sync_source_status
</a>
</code>
:
Whether semisynchronous replication is operational on source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_timefunc_failures">
Rpl_semi_sync_source_timefunc_failures
</a>
</code>
:
Number of times source failed when calling time functions.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_source_timeout">
rpl_semi_sync_source_timeout
</a>
</code>
:
Number of milliseconds to wait for replica acknowledgment.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_source_trace_level">
rpl_semi_sync_source_trace_level
</a>
</code>
:
Semisynchronous replication debug trace level on source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_tx_avg_wait_time">
Rpl_semi_sync_source_tx_avg_wait_time
</a>
</code>
:
Average time source waited for each transaction.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_tx_wait_time">
Rpl_semi_sync_source_tx_wait_time
</a>
</code>
:
Total time source waited for transactions.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_tx_waits">
Rpl_semi_sync_source_tx_waits
</a>
</code>
:
Total number of times source waited for transactions.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_source_wait_for_replica_count">
rpl_semi_sync_source_wait_for_replica_count
</a>
</code>
:
Number of replica acknowledgments source must receive per
transaction before proceeding.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_source_wait_no_replica">
rpl_semi_sync_source_wait_no_replica
</a>
</code>
:
Whether source waits for timeout even with no replicas.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#sysvar_rpl_semi_sync_source_wait_point">
rpl_semi_sync_source_wait_point
</a>
</code>
:
Wait point for replica transaction receipt acknowledgment.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_wait_pos_backtraverse">
Rpl_semi_sync_source_wait_pos_backtraverse
</a>
</code>
:
Total number of times source has waited for event with binary
coordinates lower than events waited for previously.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_wait_sessions">
Rpl_semi_sync_source_wait_sessions
</a>
</code>
:
Number of sessions currently waiting for replica replies.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Rpl_semi_sync_source_yes_tx">
Rpl_semi_sync_source_yes_tx
</a>
</code>
:
Number of commits acknowledged successfully.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_rpl_stop_replica_timeout">
rpl_stop_replica_timeout
</a>
</code>
:
Number of seconds that STOP REPLICA waits before timing out.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_rpl_stop_slave_timeout">
rpl_stop_slave_timeout
</a>
</code>
:
Number of seconds that STOP REPLICA or STOP SLAVE waits before
timing out.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options.html#sysvar_server_uuid">
server_uuid
</a>
</code>
:
Server's globally unique ID, automatically (re)generated at
server start.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#option_mysqld_show-replica-auth-info">
show-replica-auth-info
</a>
</code>
:
Show user name and password in SHOW REPLICAS on this source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-source.html#option_mysqld_show-slave-auth-info">
show-slave-auth-info
</a>
</code>
:
Show user name and password in SHOW REPLICAS and SHOW SLAVE
HOSTS on this source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_skip-replica-start">
skip-replica-start
</a>
</code>
:
If set, replication is not autostarted when replica server
starts.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_skip-slave-start">
skip-slave-start
</a>
</code>
:
If set, replication is not autostarted when replica server
starts.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_slave-skip-errors">
slave-skip-errors
</a>
</code>
:
Tells replication thread to continue replication when query
returns error from provided list.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_checkpoint_group">
slave_checkpoint_group
</a>
</code>
:
Maximum number of transactions processed by multithreaded
replica before checkpoint operation is called to update progress
status. Not supported by NDB Cluster.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_checkpoint_period">
slave_checkpoint_period
</a>
</code>
:
Update progress status of multithreaded replica and flush relay
log info to disk after this number of milliseconds. Not
supported by NDB Cluster.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_compressed_protocol">
slave_compressed_protocol
</a>
</code>
:
Use compression of source/replica protocol.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_exec_mode">
slave_exec_mode
</a>
</code>
:
Allows for switching replication thread between IDEMPOTENT mode
(key and some other errors suppressed) and STRICT mode; STRICT
mode is default, except for NDB Cluster, where IDEMPOTENT is
always used.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_load_tmpdir">
slave_load_tmpdir
</a>
</code>
:
Location where replica should put its temporary files when
replicating LOAD DATA statements.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_max_allowed_packet">
slave_max_allowed_packet
</a>
</code>
:
Maximum size, in bytes, of packet that can be sent from
replication source server to replica; overrides
max_allowed_packet.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_net_timeout">
slave_net_timeout
</a>
</code>
:
Number of seconds to wait for more data from source/replica
connection before aborting read.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Slave_open_temp_tables">
Slave_open_temp_tables
</a>
</code>
:
Number of temporary tables that replication SQL thread currently
has open.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_parallel_type">
slave_parallel_type
</a>
</code>
:
Tells replica to use timestamp information (LOGICAL_CLOCK) or
database partioning (DATABASE) to parallelize transactions.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_parallel_workers">
slave_parallel_workers
</a>
</code>
:
Number of applier threads for executing replication transactions
in parallel; 0 or 1 disables replica multithreading. NDB
Cluster: see documentation.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_pending_jobs_size_max">
slave_pending_jobs_size_max
</a>
</code>
:
Maximum size of replica worker queues holding events not yet
applied.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_preserve_commit_order">
slave_preserve_commit_order
</a>
</code>
:
Ensures that all commits by replica workers happen in same order
as on source to maintain consistency when using parallel applier
threads.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Slave_rows_last_search_algorithm_used">
Slave_rows_last_search_algorithm_used
</a>
</code>
:
Search algorithm most recently used by this replica to locate
rows for row-based replication (index, table, or hash scan).
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_transaction_retries">
slave_transaction_retries
</a>
</code>
:
Number of times replication SQL thread retries transaction in
case it failed with deadlock or elapsed lock wait timeout,
before giving up and stopping.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_type_conversions">
slave_type_conversions
</a>
</code>
:
Controls type conversion mode on replica. Value is list of zero
or more elements from this list: ALL_LOSSY, ALL_NON_LOSSY. Set
to empty string to disallow type conversions between source and
replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_sql_log_bin">
sql_log_bin
</a>
</code>
:
Controls binary logging for current session.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_sql_replica_skip_counter">
sql_replica_skip_counter
</a>
</code>
:
Number of events from source that replica should skip. Not
compatible with GTID replication.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_sql_slave_skip_counter">
sql_slave_skip_counter
</a>
</code>
:
Number of events from source that replica should skip. Not
compatible with GTID replication.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_sync_master_info">
sync_master_info
</a>
</code>
:
Synchronize source information after every #th event.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_sync_relay_log">
sync_relay_log
</a>
</code>
:
Synchronize relay log to disk after every #th event.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_sync_relay_log_info">
sync_relay_log_info
</a>
</code>
:
Synchronize relay.info file to disk after every #th event.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_sync_source_info">
sync_source_info
</a>
</code>
:
Synchronize source information after every #th event.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_terminology_use_previous">
terminology_use_previous
</a>
</code>
:
Use terminology from before specified version where changes are
incompatible.
</p>
</li>
</ul>
</div>
<p>
For a listing of all command-line options, system variables, and
status variables used with
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
, see
<a class="xref" href="server-option-variable-reference.html" title="7.1.4 Server Option, System Variable, and Status Variable Reference">
Section 7.1.4, “Server Option, System Variable, and Status Variable Reference”
</a>
.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="binlog-optvars-list">
</a>
Binary Logging Options and Variables
</h5>
</div>
</div>
</div>
<p>
The command-line options and system variables in the following list
relate to the binary log.
<a class="xref" href="replication-options-binary-log.html" title="19.1.6.4 Binary Logging Options and Variables">
Section 19.1.6.4, “Binary Logging Options and Variables”
</a>
, provides more
detailed information about options and variables relating to binary
logging. For additional general information about the binary log,
see
<a class="xref" href="binary-log.html" title="7.4.4 The Binary Log">
Section 7.4.4, “The Binary Log”
</a>
.
</p>
<div class="itemizedlist">
<a name="binlog-optvar-summary-list">
</a>
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-checksum">
binlog-checksum
</a>
</code>
:
Enable or disable binary log checksums.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-do-db">
binlog-do-db
</a>
</code>
:
Limits binary logging to specific databases.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-ignore-db">
binlog-ignore-db
</a>
</code>
:
Tells source that updates to given database should not be
written to binary log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#option_mysqld_binlog-row-event-max-size">
binlog-row-event-max-size
</a>
</code>
:
Binary log max event size.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Binlog_cache_disk_use">
Binlog_cache_disk_use
</a>
</code>
:
Number of transactions which used temporary file instead of
binary log cache.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_cache_size">
binlog_cache_size
</a>
</code>
:
Size of cache to hold SQL statements for binary log during
transaction.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Binlog_cache_use">
Binlog_cache_use
</a>
</code>
:
Number of transactions that used temporary binary log cache.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_checksum">
binlog_checksum
</a>
</code>
:
Enable or disable binary log checksums.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_direct_non_transactional_updates">
binlog_direct_non_transactional_updates
</a>
</code>
:
Causes updates using statement format to nontransactional
engines to be written directly to binary log. See documentation
before using.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_encryption">
binlog_encryption
</a>
</code>
:
Enable encryption for binary log files and relay log files on
this server.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_error_action">
binlog_error_action
</a>
</code>
:
Controls what happens when server cannot write to binary log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_expire_logs_auto_purge">
binlog_expire_logs_auto_purge
</a>
</code>
:
Controls automatic purging of binary log files; can be
overridden when enabled, by setting both
binlog_expire_logs_seconds and expire_logs_days to 0.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_expire_logs_seconds">
binlog_expire_logs_seconds
</a>
</code>
:
Purge binary logs after this many seconds.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_format">
binlog_format
</a>
</code>
:
Specifies format of binary log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_delay">
binlog_group_commit_sync_delay
</a>
</code>
:
Sets number of microseconds to wait before synchronizing
transactions to disk.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_group_commit_sync_no_delay_count">
binlog_group_commit_sync_no_delay_count
</a>
</code>
:
Sets maximum number of transactions to wait for before aborting
current delay specified by binlog_group_commit_sync_delay.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-gtids.html#sysvar_binlog_gtid_simple_recovery">
binlog_gtid_simple_recovery
</a>
</code>
:
Controls how binary logs are iterated during GTID recovery.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_max_flush_queue_time">
binlog_max_flush_queue_time
</a>
</code>
:
How long to read transactions before flushing to binary log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_order_commits">
binlog_order_commits
</a>
</code>
:
Whether to commit in same order as writes to binary log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_rotate_encryption_master_key_at_startup">
binlog_rotate_encryption_master_key_at_startup
</a>
</code>
:
Rotate binary log master key at server startup.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_image">
binlog_row_image
</a>
</code>
:
Use full or minimal images when logging row changes.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_metadata">
binlog_row_metadata
</a>
</code>
:
Whether to record all or only minimal table related metadata to
binary log when using row-based logging.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_row_value_options">
binlog_row_value_options
</a>
</code>
:
Enables binary logging of partial JSON updates for row-based
replication.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_rows_query_log_events">
binlog_rows_query_log_events
</a>
</code>
:
When enabled, enables logging of rows query log events when
using row-based logging. Disabled by default..
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Binlog_stmt_cache_disk_use">
Binlog_stmt_cache_disk_use
</a>
</code>
:
Number of nontransactional statements that used temporary file
instead of binary log statement cache.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_stmt_cache_size">
binlog_stmt_cache_size
</a>
</code>
:
Size of cache to hold nontransactional statements for binary log
during transaction.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Binlog_stmt_cache_use">
Binlog_stmt_cache_use
</a>
</code>
:
Number of statements that used temporary binary log statement
cache.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression">
binlog_transaction_compression
</a>
</code>
:
Enable compression for transaction payloads in binary log files.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_compression_level_zstd">
binlog_transaction_compression_level_zstd
</a>
</code>
:
Compression level for transaction payloads in binary log files.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_binlog_transaction_dependency_history_size">
binlog_transaction_dependency_history_size
</a>
</code>
:
Number of row hashes kept for looking up transaction that last
updated some row.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Com_xxx">
Com_show_binlog_events
</a>
</code>
:
Count of SHOW BINLOG EVENTS statements.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="server-status-variables.html#statvar_Com_xxx">
Com_show_binlogs
</a>
</code>
:
Count of SHOW BINLOGS statements.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
log-bin
</a>
</code>
:
Base name for binary log files.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin-index">
log-bin-index
</a>
</code>
:
Name of binary log index file.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_log_bin">
log_bin
</a>
</code>
:
Whether binary log is enabled.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_log_bin_basename">
log_bin_basename
</a>
</code>
:
Path and base name for binary log files.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
log_replica_updates
</a>
</code>
:
Whether replica should log updates performed by its replication
SQL thread to its own binary log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_log_slave_updates">
log_slave_updates
</a>
</code>
:
Whether replica should log updates performed by its replication
SQL thread to its own binary log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_master_verify_checksum">
master_verify_checksum
</a>
</code>
:
Cause source to examine checksums when reading from binary log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#option_mysqld_max-binlog-dump-events">
max-binlog-dump-events
</a>
</code>
:
Option used by mysql-test for debugging and testing of
replication.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_cache_size">
max_binlog_cache_size
</a>
</code>
:
Can be used to restrict total size in bytes used to cache
multi-statement transactions.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_size">
max_binlog_size
</a>
</code>
:
Binary log is rotated automatically when size exceeds this
value.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_max_binlog_stmt_cache_size">
max_binlog_stmt_cache_size
</a>
</code>
:
Can be used to restrict total size used to cache all
nontransactional statements during transaction.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_replica_sql_verify_checksum">
replica_sql_verify_checksum
</a>
</code>
:
Cause replica to examine checksums when reading from relay log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#option_mysqld_slave-sql-verify-checksum">
slave-sql-verify-checksum
</a>
</code>
:
Cause replica to examine checksums when reading from relay log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-replica.html#sysvar_slave_sql_verify_checksum">
slave_sql_verify_checksum
</a>
</code>
:
Cause replica to examine checksums when reading from relay log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_source_verify_checksum">
source_verify_checksum
</a>
</code>
:
Cause source to examine checksums when reading from binary log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#option_mysqld_sporadic-binlog-dump-fail">
sporadic-binlog-dump-fail
</a>
</code>
:
Option used by mysql-test for debugging and testing of
replication.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
<a class="link" href="replication-options-binary-log.html#sysvar_sync_binlog">
sync_binlog
</a>
</code>
:
Synchronously flush binary log to disk after every #th event.
</p>
</li>
</ul>
</div>
<p>
For a listing of all command-line options, system and status
variables used with
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
, see
<a class="xref" href="server-option-variable-reference.html" title="7.1.4 Server Option, System Variable, and Status Variable Reference">
Section 7.1.4, “Server Option, System Variable, and Status Variable Reference”
</a>
.
</p>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/mysqldump-stored-programs.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="mysqldump-stored-programs">
</a>
9.4.5.3 Dumping Stored Programs
</h4>
</div>
</div>
</div>
<p>
Several options control how
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
handles stored programs (stored procedures and functions,
triggers, and events):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="link" href="mysqldump.html#option_mysqldump_events">
<code class="option">
--events
</code>
</a>
: Dump Event
Scheduler events
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="mysqldump.html#option_mysqldump_routines">
<code class="option">
--routines
</code>
</a>
: Dump stored
procedures and functions
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="mysqldump.html#option_mysqldump_triggers">
<code class="option">
--triggers
</code>
</a>
: Dump
triggers for tables
</p>
</li>
</ul>
</div>
<p>
The
<a class="link" href="mysqldump.html#option_mysqldump_triggers">
<code class="option">
--triggers
</code>
</a>
option is
enabled by default so that when tables are dumped, they are
accompanied by any triggers they have. The other options are
disabled by default and must be specified explicitly to dump
the corresponding objects. To disable any of these options
explicitly, use its skip form:
<a class="link" href="mysqldump.html#option_mysqldump_events">
<code class="option">
--skip-events
</code>
</a>
,
<a class="link" href="mysqldump.html#option_mysqldump_routines">
<code class="option">
--skip-routines
</code>
</a>
,
or
<a class="link" href="mysqldump.html#option_mysqldump_triggers">
<code class="option">
--skip-triggers
</code>
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/data-masking-plugin-functions.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="data-masking-plugin-functions">
</a>
8.5.3.4 MySQL Enterprise Data Masking and De-Identification Plugin Function Descriptions
</h4>
</div>
</div>
</div>
<p>
The MySQL Enterprise Data Masking and De-Identification plugin library includes several functions, which
may be grouped into these categories:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="xref" href="data-masking-plugin-functions.html#data-masking-masking-plugin-functions" title="Data Masking Plugin Functions">
Data Masking Plugin Functions
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="data-masking-plugin-functions.html#data-masking-generation-plugin-functions" title="Random Data Generation Plugin Functions">
Random Data Generation Plugin Functions
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="data-masking-plugin-functions.html#data-masking-dictionary-plugin-functions" title="Random Data Dictionary-Based Plugin Functions">
Random Data Dictionary-Based Plugin Functions
</a>
</p>
</li>
</ul>
</div>
<p>
These functions support the single-byte
<code class="literal">
latin1
</code>
character set for string arguments and
return values. If a string return value should be in a different
character set, convert it. The following example shows how to
convert the result of
<a class="link" href="data-masking-plugin-functions.html#function_gen-rnd-email-plugin">
<code class="literal">
gen_rnd_email()
</code>
</a>
to the
<code class="literal">
utf8mb4
</code>
character set:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa56608784"><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 variable">@email</span> <span class="token operator">=</span> <span class="token function">CONVERT</span><span class="token punctuation">(</span>gen_rnd_email<span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">USING</span> utf8mb4<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
It may also be necessary to convert string arguments, as
illustrated in
<a class="xref" href="data-masking-component-usage.html#data-masking-component-usage-customer-identification" title="Using Masked Data for Customer Identification">
Using Masked Data for Customer Identification
</a>
.
</p>
<p>
If a MySQL Enterprise Data Masking and De-Identification function is invoked from within the
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
client, binary string results display
using hexadecimal notation, depending on the value of the
<a class="link" href="mysql-command-options.html#option_mysql_binary-as-hex">
<code class="option">
--binary-as-hex
</code>
</a>
. For more
information about that option, see
<a class="xref" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
Section 6.5.1, “mysql — The MySQL Command-Line Client”
</a>
.
</p>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="data-masking-masking-plugin-functions">
</a>
Data Masking Plugin Functions
</h5>
</div>
</div>
</div>
<p>
Each plugin function in this section performs a masking
operation on its string argument and returns the masked
result.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a name="function_mask-inner-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_mask-inner-plugin">
<code class="literal">
mask_inner(
<em class="replaceable">
<code>
str
</code>
</em>
,
<em class="replaceable">
<code>
margin1
</code>
</em>
,
<em class="replaceable">
<code>
margin2
</code>
</em>
[,
<em class="replaceable">
<code>
mask_char
</code>
</em>
])
</code>
</a>
</p>
<a class="indexterm" name="idm46045232237360">
</a>
<a class="indexterm" name="idm46045232236224">
</a>
<p>
Masks the interior part of a string, leaving the ends
untouched, and returns the result. An optional masking
character can be specified.
</p>
<p>
Arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<em class="replaceable">
<code>
str
</code>
</em>
: The string to mask.
</p>
</li>
<li class="listitem">
<p>
<em class="replaceable">
<code>
margin1
</code>
</em>
: A nonnegative
integer that specifies the number of characters on the
left end of the string to remain unmasked. If the
value is 0, no left end characters remain unmasked.
</p>
</li>
<li class="listitem">
<p>
<em class="replaceable">
<code>
margin2
</code>
</em>
: A nonnegative
integer that specifies the number of characters on the
right end of the string to remain unmasked. If the
value is 0, no right end characters remain unmasked.
</p>
</li>
<li class="listitem">
<p>
<em class="replaceable">
<code>
mask_char
</code>
</em>
: (Optional) The
single character to use for masking. The default is
<code class="literal">
'X'
</code>
if
<em class="replaceable">
<code>
mask_char
</code>
</em>
is not given.
</p>
<p>
The masking character must be a single-byte character.
Attempts to use a multibyte character produce an
error.
</p>
</li>
</ul>
</div>
<p>
Return value:
</p>
<p>
The masked string, or
<code class="literal">
NULL
</code>
if either
margin is negative.
</p>
<p>
If the sum of the margin values is larger than the
argument length, no masking occurs and the argument is
returned unchanged.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa10835252"><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></span> <span class="token keyword">SELECT</span> mask_inner<span class="token punctuation">(</span><span class="token string">'abcdef'</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">,</span> mask_inner<span class="token punctuation">(</span><span class="token string">'abcdef'</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> mask_inner('abcdef', 1, 2) <span class="token punctuation">|</span> mask_inner('abcdef',0, 5) <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>
<span class="token output"><span class="token punctuation">|</span> aXXXef <span class="token punctuation">|</span> Xbcdef <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> mask_inner<span class="token punctuation">(</span><span class="token string">'abcdef'</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token string">'*'</span><span class="token punctuation">)</span><span class="token punctuation">,</span> mask_inner<span class="token punctuation">(</span><span class="token string">'abcdef'</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token string">'#'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> mask_inner('abcdef', 1, 2, '*') <span class="token punctuation">|</span> mask_inner('abcdef',0, 5, '#') <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>
<span class="token output"><span class="token punctuation">|</span> a***ef <span class="token punctuation">|</span> #bcdef <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="function_mask-outer-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_mask-outer-plugin">
<code class="literal">
mask_outer(
<em class="replaceable">
<code>
str
</code>
</em>
,
<em class="replaceable">
<code>
margin1
</code>
</em>
,
<em class="replaceable">
<code>
margin2
</code>
</em>
[,
<em class="replaceable">
<code>
mask_char
</code>
</em>
])
</code>
</a>
</p>
<a class="indexterm" name="idm46045232215920">
</a>
<a class="indexterm" name="idm46045232214784">
</a>
<p>
Masks the left and right ends of a string, leaving the
interior unmasked, and returns the result. An optional
masking character can be specified.
</p>
<p>
Arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<em class="replaceable">
<code>
str
</code>
</em>
: The string to mask.
</p>
</li>
<li class="listitem">
<p>
<em class="replaceable">
<code>
margin1
</code>
</em>
: A nonnegative
integer that specifies the number of characters on the
left end of the string to mask. If the value is 0, no
left end characters are masked.
</p>
</li>
<li class="listitem">
<p>
<em class="replaceable">
<code>
margin2
</code>
</em>
: A nonnegative
integer that specifies the number of characters on the
right end of the string to mask. If the value is 0, no
right end characters are masked.
</p>
</li>
<li class="listitem">
<p>
<em class="replaceable">
<code>
mask_char
</code>
</em>
: (Optional) The
single character to use for masking. The default is
<code class="literal">
'X'
</code>
if
<em class="replaceable">
<code>
mask_char
</code>
</em>
is not given.
</p>
<p>
The masking character must be a single-byte character.
Attempts to use a multibyte character produce an
error.
</p>
</li>
</ul>
</div>
<p>
Return value:
</p>
<p>
The masked string, or
<code class="literal">
NULL
</code>
if either
margin is negative.
</p>
<p>
If the sum of the margin values is larger than the
argument length, the entire argument is masked.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa66970434"><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></span> <span class="token keyword">SELECT</span> mask_outer<span class="token punctuation">(</span><span class="token string">'abcdef'</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">,</span> mask_outer<span class="token punctuation">(</span><span class="token string">'abcdef'</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> mask_outer('abcdef', 1, 2) <span class="token punctuation">|</span> mask_outer('abcdef',0, 5) <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>
<span class="token output"><span class="token punctuation">|</span> XbcdXX <span class="token punctuation">|</span> aXXXXX <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> mask_outer<span class="token punctuation">(</span><span class="token string">'abcdef'</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token string">'*'</span><span class="token punctuation">)</span><span class="token punctuation">,</span> mask_outer<span class="token punctuation">(</span><span class="token string">'abcdef'</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token string">'#'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> mask_outer('abcdef', 1, 2, '*') <span class="token punctuation">|</span> mask_outer('abcdef',0, 5, '#') <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>
<span class="token output"><span class="token punctuation">|</span> *bcd** <span class="token punctuation">|</span> a##### <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="function_mask-pan-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_mask-pan-plugin">
<code class="literal">
mask_pan(
<em class="replaceable">
<code>
str
</code>
</em>
)
</code>
</a>
</p>
<a class="indexterm" name="idm46045232195872">
</a>
<a class="indexterm" name="idm46045232194752">
</a>
<p>
Masks a payment card Primary Account Number and returns
the number with all but the last four digits replaced by
<code class="literal">
'X'
</code>
characters.
</p>
<p>
Arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<em class="replaceable">
<code>
str
</code>
</em>
: The string to mask.
The string must be a suitable length for the Primary
Account Number, but is not otherwise checked.
</p>
</li>
</ul>
</div>
<p>
Return value:
</p>
<p>
The masked payment number as a string. If the argument is
shorter than required, it is returned unchanged.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa63244642"><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></span> <span class="token keyword">SELECT</span> mask_pan<span class="token punctuation">(</span>gen_rnd_pan<span class="token punctuation">(</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><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> mask_pan(gen_rnd_pan()) <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>
<span class="token output"><span class="token punctuation">|</span> XXXXXXXXXXXX9102 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> mask_pan<span class="token punctuation">(</span>gen_rnd_pan<span class="token punctuation">(</span><span class="token number">19</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><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> mask_pan(gen_rnd_pan(19)) <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>
<span class="token output"><span class="token punctuation">|</span> XXXXXXXXXXXXXXX8268 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> mask_pan<span class="token punctuation">(</span><span class="token string">'a*Z'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> mask_pan('a*Z') <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>
<span class="token output"><span class="token punctuation">|</span> a*Z <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="function_mask-pan-relaxed-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_mask-pan-relaxed-plugin">
<code class="literal">
mask_pan_relaxed(
<em class="replaceable">
<code>
str
</code>
</em>
)
</code>
</a>
</p>
<a class="indexterm" name="idm46045232181744">
</a>
<a class="indexterm" name="idm46045232180608">
</a>
<p>
Masks a payment card Primary Account Number and returns
the number with all but the first six and last four digits
replaced by
<code class="literal">
'X'
</code>
characters. The first
six digits indicate the payment card issuer.
</p>
<p>
Arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<em class="replaceable">
<code>
str
</code>
</em>
: The string to mask.
The string must be a suitable length for the Primary
Account Number, but is not otherwise checked.
</p>
</li>
</ul>
</div>
<p>
Return value:
</p>
<p>
The masked payment number as a string. If the argument is
shorter than required, it is returned unchanged.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa47114605"><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></span> <span class="token keyword">SELECT</span> mask_pan_relaxed<span class="token punctuation">(</span>gen_rnd_pan<span class="token punctuation">(</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><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> mask_pan_relaxed(gen_rnd_pan()) <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>
<span class="token output"><span class="token punctuation">|</span> 551279XXXXXX3108 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> mask_pan_relaxed<span class="token punctuation">(</span>gen_rnd_pan<span class="token punctuation">(</span><span class="token number">19</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><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> mask_pan_relaxed(gen_rnd_pan(19)) <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>
<span class="token output"><span class="token punctuation">|</span> 462634XXXXXXXXX6739 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> mask_pan_relaxed<span class="token punctuation">(</span><span class="token string">'a*Z'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> mask_pan_relaxed('a*Z') <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>
<span class="token output"><span class="token punctuation">|</span> a*Z <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="function_mask-ssn-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_mask-ssn-plugin">
<code class="literal">
mask_ssn(
<em class="replaceable">
<code>
str
</code>
</em>
)
</code>
</a>
</p>
<a class="indexterm" name="idm46045232167280">
</a>
<a class="indexterm" name="idm46045232166160">
</a>
<p>
Masks a US Social Security number and returns the number
with all but the last four digits replaced by
<code class="literal">
'X'
</code>
characters.
</p>
<p>
Arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<em class="replaceable">
<code>
str
</code>
</em>
: The string to mask.
The string must be 11 characters long.
</p>
</li>
</ul>
</div>
<p>
Return value:
</p>
<p>
The masked Social Security number as a string, or an error
if the argument is not the correct length.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa93887653"><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></span> <span class="token keyword">SELECT</span> mask_ssn<span class="token punctuation">(</span><span class="token string">'909-63-6922'</span><span class="token punctuation">)</span><span class="token punctuation">,</span> mask_ssn<span class="token punctuation">(</span><span class="token string">'abcdefghijk'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> mask_ssn('909<span class="token punctuation">-</span>63<span class="token punctuation">-</span>6922') <span class="token punctuation">|</span> mask_ssn('abcdefghijk') <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>
<span class="token output"><span class="token punctuation">|</span> XXX<span class="token punctuation">-</span>XX<span class="token punctuation">-</span>6922 <span class="token punctuation">|</span> XXX<span class="token punctuation">-</span>XX<span class="token punctuation">-</span>hijk <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> mask_ssn<span class="token punctuation">(</span><span class="token string">'909'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output">ERROR 1123 (HY000)<span class="token punctuation">:</span> Can't initialize function 'mask_ssn'; MASK_SSN<span class="token punctuation">:</span> Error<span class="token punctuation">:</span>
String argument width too small</span>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> mask_ssn<span class="token punctuation">(</span><span class="token string">'123456789123456789'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output">ERROR 1123 (HY000)<span class="token punctuation">:</span> Can't initialize function 'mask_ssn'; MASK_SSN<span class="token punctuation">:</span> Error<span class="token punctuation">:</span>
String argument width too large</span></code></pre>
</div>
</li>
</ul>
</div>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="data-masking-generation-plugin-functions">
</a>
Random Data Generation Plugin Functions
</h5>
</div>
</div>
</div>
<p>
The plugin functions in this section generate random values
for different types of data. When possible, generated values
have characteristics reserved for demonstration or test
values, to avoid having them mistaken for legitimate data. For
example,
<a class="link" href="data-masking-plugin-functions.html#function_gen-rnd-us-phone-plugin">
<code class="literal">
gen_rnd_us_phone()
</code>
</a>
returns a US phone number that uses the 555 area code, which
is not assigned to phone numbers in actual use. Individual
function descriptions describe any exceptions to this
principle.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a name="function_gen-range-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_gen-range-plugin">
<code class="literal">
gen_range(
<em class="replaceable">
<code>
lower
</code>
</em>
,
<em class="replaceable">
<code>
upper
</code>
</em>
)
</code>
</a>
</p>
<a class="indexterm" name="idm46045232148656">
</a>
<a class="indexterm" name="idm46045232147520">
</a>
<p>
Generates a random number chosen from a specified range.
</p>
<p>
Arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<em class="replaceable">
<code>
lower
</code>
</em>
: An integer that
specifies the lower boundary of the range.
</p>
</li>
<li class="listitem">
<p>
<em class="replaceable">
<code>
upper
</code>
</em>
: An integer that
specifies the upper boundary of the range, which must
not be less than the lower boundary.
</p>
</li>
</ul>
</div>
<p>
Return value:
</p>
<p>
A random integer in the range from
<em class="replaceable">
<code>
lower
</code>
</em>
to
<em class="replaceable">
<code>
upper
</code>
</em>
, inclusive, or
<code class="literal">
NULL
</code>
if the
<em class="replaceable">
<code>
upper
</code>
</em>
argument is less than
<em class="replaceable">
<code>
lower
</code>
</em>
.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa31024037"><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></span> <span class="token keyword">SELECT</span> gen_range<span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">,</span> <span class="token number">200</span><span class="token punctuation">)</span><span class="token punctuation">,</span> gen_range<span class="token punctuation">(</span><span class="token operator">-</span><span class="token number">1000</span><span class="token punctuation">,</span> <span class="token operator">-</span><span class="token number">800</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_range(100, 200) <span class="token punctuation">|</span> gen_range(<span class="token punctuation">-</span>1000, <span class="token punctuation">-</span>800) <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>
<span class="token output"><span class="token punctuation">|</span> 177 <span class="token punctuation">|</span> <span class="token punctuation">-</span>917 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> gen_range<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_range(1, 0) <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>
<span class="token output"><span class="token punctuation">|</span> NULL <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="function_gen-rnd-email-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_gen-rnd-email-plugin">
<code class="literal">
gen_rnd_email()
</code>
</a>
</p>
<a class="indexterm" name="idm46045232132704">
</a>
<a class="indexterm" name="idm46045232131568">
</a>
<p>
Generates a random email address in the
<code class="literal">
example.com
</code>
domain.
</p>
<p>
Arguments:
</p>
<p>
None.
</p>
<p>
Return value:
</p>
<p>
A random email address as a string.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa39242815"><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></span> <span class="token keyword">SELECT</span> gen_rnd_email<span class="token punctuation">(</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_rnd_email() <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>
<span class="token output"><span class="token punctuation">|</span> [email protected] <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="function_gen-rnd-pan-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_gen-rnd-pan-plugin">
<code class="literal">
gen_rnd_pan([
<em class="replaceable">
<code>
size
</code>
</em>
])
</code>
</a>
</p>
<a class="indexterm" name="idm46045232121984">
</a>
<a class="indexterm" name="idm46045232120848">
</a>
<p>
Generates a random payment card Primary Account Number.
The number passes the Luhn check (an algorithm that
performs a checksum verification against a check digit).
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Warning
</div>
<p>
Values returned from
<a class="link" href="data-masking-plugin-functions.html#function_gen-rnd-pan-plugin">
<code class="literal">
gen_rnd_pan()
</code>
</a>
should be used only for test purposes, and are not
suitable for publication. There is no way to guarantee
that a given return value is not assigned to a
legitimate payment account. Should it be necessary to
publish a
<a class="link" href="data-masking-plugin-functions.html#function_gen-rnd-pan-plugin">
<code class="literal">
gen_rnd_pan()
</code>
</a>
result, consider masking it with
<a class="link" href="data-masking-plugin-functions.html#function_mask-pan-plugin">
<code class="literal">
mask_pan()
</code>
</a>
or
<a class="link" href="data-masking-plugin-functions.html#function_mask-pan-relaxed-plugin">
<code class="literal">
mask_pan_relaxed()
</code>
</a>
.
</p>
</div>
<p>
Arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<em class="replaceable">
<code>
size
</code>
</em>
: (Optional) An integer
that specifies the size of the result. The default is
16 if
<em class="replaceable">
<code>
size
</code>
</em>
is not given. If
given,
<em class="replaceable">
<code>
size
</code>
</em>
must be an
integer in the range from 12 to 19.
</p>
</li>
</ul>
</div>
<p>
Return value:
</p>
<p>
A random payment number as a string, or
<code class="literal">
NULL
</code>
if a
<em class="replaceable">
<code>
size
</code>
</em>
argument outside the
permitted range is given.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa75187778"><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></span> <span class="token keyword">SELECT</span> mask_pan<span class="token punctuation">(</span>gen_rnd_pan<span class="token punctuation">(</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><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> mask_pan(gen_rnd_pan()) <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>
<span class="token output"><span class="token punctuation">|</span> XXXXXXXXXXXX5805 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> mask_pan<span class="token punctuation">(</span>gen_rnd_pan<span class="token punctuation">(</span><span class="token number">19</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><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> mask_pan(gen_rnd_pan(19)) <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>
<span class="token output"><span class="token punctuation">|</span> XXXXXXXXXXXXXXX5067 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> mask_pan_relaxed<span class="token punctuation">(</span>gen_rnd_pan<span class="token punctuation">(</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><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> mask_pan_relaxed(gen_rnd_pan()) <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>
<span class="token output"><span class="token punctuation">|</span> 398403XXXXXX9547 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> mask_pan_relaxed<span class="token punctuation">(</span>gen_rnd_pan<span class="token punctuation">(</span><span class="token number">19</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><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> mask_pan_relaxed(gen_rnd_pan(19)) <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>
<span class="token output"><span class="token punctuation">|</span> 578416XXXXXXXXX6509 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> gen_rnd_pan<span class="token punctuation">(</span><span class="token number">11</span><span class="token punctuation">)</span><span class="token punctuation">,</span> gen_rnd_pan<span class="token punctuation">(</span><span class="token number">20</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_rnd_pan(11) <span class="token punctuation">|</span> gen_rnd_pan(20) <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>
<span class="token output"><span class="token punctuation">|</span> NULL <span class="token punctuation">|</span> NULL <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="function_gen-rnd-ssn-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_gen-rnd-ssn-plugin">
<code class="literal">
gen_rnd_ssn()
</code>
</a>
</p>
<a class="indexterm" name="idm46045232098128">
</a>
<a class="indexterm" name="idm46045232096992">
</a>
<p>
Generates a random US Social Security number in
<code class="literal">
<em class="replaceable">
<code>
AAA
</code>
</em>
-
<em class="replaceable">
<code>
BB
</code>
</em>
-
<em class="replaceable">
<code>
CCCC
</code>
</em>
</code>
format. The
<em class="replaceable">
<code>
AAA
</code>
</em>
part is greater
than 900 and the
<em class="replaceable">
<code>
BB
</code>
</em>
part is
less than 70, which are characteristics not used for
legitimate Social Security numbers.
</p>
<p>
Arguments:
</p>
<p>
None.
</p>
<p>
Return value:
</p>
<p>
A random Social Security number as a string.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa38592825"><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></span> <span class="token keyword">SELECT</span> gen_rnd_ssn<span class="token punctuation">(</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_rnd_ssn() <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>
<span class="token output"><span class="token punctuation">|</span> 951<span class="token punctuation">-</span>26<span class="token punctuation">-</span>0058 <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="function_gen-rnd-us-phone-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_gen-rnd-us-phone-plugin">
<code class="literal">
gen_rnd_us_phone()
</code>
</a>
</p>
<a class="indexterm" name="idm46045232085936">
</a>
<a class="indexterm" name="idm46045232084800">
</a>
<p>
Generates a random US phone number in
<code class="literal">
1-555-
<em class="replaceable">
<code>
AAA
</code>
</em>
-
<em class="replaceable">
<code>
BBBB
</code>
</em>
</code>
format. The 555 area code is not used for legitimate phone
numbers.
</p>
<p>
Arguments:
</p>
<p>
None.
</p>
<p>
Return value:
</p>
<p>
A random US phone number as a string.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa93349365"><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></span> <span class="token keyword">SELECT</span> gen_rnd_us_phone<span class="token punctuation">(</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_rnd_us_phone() <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>
<span class="token output"><span class="token punctuation">|</span> 1<span class="token punctuation">-</span>555<span class="token punctuation">-</span>682<span class="token punctuation">-</span>5423 <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></code></pre>
</div>
</li>
</ul>
</div>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="data-masking-dictionary-plugin-functions">
</a>
Random Data Dictionary-Based Plugin Functions
</h5>
</div>
</div>
</div>
<p>
The plugin functions in this section manipulate dictionaries
of terms and perform generation and masking operations based
on them. Some of these functions require the
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege.
</p>
<p>
When a dictionary is loaded, it becomes part of the dictionary
registry and is assigned a name to be used by other dictionary
functions. Dictionaries are loaded from plain text files
containing one term per line. Empty lines are ignored. To be
valid, a dictionary file must contain at least one nonempty
line.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a name="function_gen-blacklist-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_gen-blacklist-plugin">
<code class="literal">
gen_blacklist(
<em class="replaceable">
<code>
str
</code>
</em>
,
<em class="replaceable">
<code>
dictionary_name
</code>
</em>
,
<em class="replaceable">
<code>
replacement_dictionary_name
</code>
</em>
)
</code>
</a>
</p>
<a class="indexterm" name="idm46045232069296">
</a>
<a class="indexterm" name="idm46045232068160">
</a>
<p>
Replaces a term present in one dictionary with a term from
a second dictionary and returns the replacement term. This
masks the original term by substitution. This function is
deprecated; use
<a class="link" href="data-masking-plugin-functions.html#function_gen-blocklist-plugin">
<code class="literal">
gen_blocklist()
</code>
</a>
instead.
</p>
</li>
<li class="listitem">
<p>
<a name="function_gen-blocklist-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_gen-blocklist-plugin">
<code class="literal">
gen_blocklist(
<em class="replaceable">
<code>
str
</code>
</em>
,
<em class="replaceable">
<code>
dictionary_name
</code>
</em>
,
<em class="replaceable">
<code>
replacement_dictionary_name
</code>
</em>
)
</code>
</a>
</p>
<a class="indexterm" name="idm46045232060928">
</a>
<a class="indexterm" name="idm46045232059792">
</a>
<p>
Replaces a term present in one dictionary with a term from
a second dictionary and returns the replacement term. This
masks the original term by substitution. This function
serves as a replacement for the deprecated
<a class="link" href="data-masking-plugin-functions.html#function_gen-blacklist-plugin">
<code class="literal">
gen_blacklist()
</code>
</a>
function.
</p>
<p>
Arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<em class="replaceable">
<code>
str
</code>
</em>
: A string that
indicates the term to replace.
</p>
</li>
<li class="listitem">
<p>
<em class="replaceable">
<code>
dictionary_name
</code>
</em>
: A string
that names the dictionary containing the term to
replace.
</p>
</li>
<li class="listitem">
<p>
<em class="replaceable">
<code>
replacement_dictionary_name
</code>
</em>
:
A string that names the dictionary from which to
choose the replacement term.
</p>
</li>
</ul>
</div>
<p>
Return value:
</p>
<p>
A string randomly chosen from
<em class="replaceable">
<code>
replacement_dictionary_name
</code>
</em>
as
a replacement for
<em class="replaceable">
<code>
str
</code>
</em>
, or
<em class="replaceable">
<code>
str
</code>
</em>
if it does not appear in
<em class="replaceable">
<code>
dictionary_name
</code>
</em>
, or
<code class="literal">
NULL
</code>
if either dictionary name is not
in the dictionary registry.
</p>
<p>
If the term to replace appears in both dictionaries, it is
possible for the return value to be the same term.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa71134547"><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></span> <span class="token keyword">SELECT</span> gen_blocklist<span class="token punctuation">(</span><span class="token string">'Berlin'</span><span class="token punctuation">,</span> <span class="token string">'DE_Cities'</span><span class="token punctuation">,</span> <span class="token string">'US_Cities'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_blocklist('Berlin', 'DE_Cities', 'US_Cities') <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>
<span class="token output"><span class="token punctuation">|</span> Phoenix <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="function_gen-dictionary-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_gen-dictionary-plugin">
<code class="literal">
gen_dictionary(
<em class="replaceable">
<code>
dictionary_name
</code>
</em>
)
</code>
</a>
</p>
<a class="indexterm" name="idm46045232041920">
</a>
<a class="indexterm" name="idm46045232040784">
</a>
<p>
Returns a random term from a dictionary.
</p>
<p>
Arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<em class="replaceable">
<code>
dictionary_name
</code>
</em>
: A string
that names the dictionary from which to choose the
term.
</p>
</li>
</ul>
</div>
<p>
Return value:
</p>
<p>
A random term from the dictionary as a string, or
<code class="literal">
NULL
</code>
if the dictionary name is not in
the dictionary registry.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa69187927"><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></span> <span class="token keyword">SELECT</span> gen_dictionary<span class="token punctuation">(</span><span class="token string">'mydict'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_dictionary('mydict') <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>
<span class="token output"><span class="token punctuation">|</span> My term <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> gen_dictionary<span class="token punctuation">(</span><span class="token string">'no-such-dict'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_dictionary('no<span class="token punctuation">-</span>such<span class="token punctuation">-</span>dict') <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>
<span class="token output"><span class="token punctuation">|</span> NULL <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="function_gen-dictionary-drop-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_gen-dictionary-drop-plugin">
<code class="literal">
gen_dictionary_drop(
<em class="replaceable">
<code>
dictionary_name
</code>
</em>
)
</code>
</a>
</p>
<a class="indexterm" name="idm46045232028768">
</a>
<a class="indexterm" name="idm46045232027632">
</a>
<p>
Removes a dictionary from the dictionary registry.
</p>
<p>
This function requires the
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege.
</p>
<p>
Arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<em class="replaceable">
<code>
dictionary_name
</code>
</em>
: A string
that names the dictionary to remove from the
dictionary registry.
</p>
</li>
</ul>
</div>
<p>
Return value:
</p>
<p>
A string that indicates whether the drop operation
succeeded.
<code class="literal">
Dictionary removed
</code>
indicates
success.
<code class="literal">
Dictionary removal error
</code>
indicates failure.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa84028969"><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></span> <span class="token keyword">SELECT</span> gen_dictionary_drop<span class="token punctuation">(</span><span class="token string">'mydict'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_dictionary_drop('mydict') <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>
<span class="token output"><span class="token punctuation">|</span> Dictionary removed <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> gen_dictionary_drop<span class="token punctuation">(</span><span class="token string">'no-such-dict'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_dictionary_drop('no<span class="token punctuation">-</span>such<span class="token punctuation">-</span>dict') <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>
<span class="token output"><span class="token punctuation">|</span> Dictionary removal error <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
<a name="function_gen-dictionary-load-plugin">
</a>
<a class="link" href="data-masking-plugin-functions.html#function_gen-dictionary-load-plugin">
<code class="literal">
gen_dictionary_load(
<em class="replaceable">
<code>
dictionary_path
</code>
</em>
,
<em class="replaceable">
<code>
dictionary_name
</code>
</em>
)
</code>
</a>
</p>
<a class="indexterm" name="idm46045232012608">
</a>
<a class="indexterm" name="idm46045232011472">
</a>
<p>
Loads a file into the dictionary registry and assigns the
dictionary a name to be used with other functions that
require a dictionary name argument.
</p>
<p>
This function requires the
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
Dictionaries are not persistent. Any dictionary used by
applications must be loaded for each server startup.
</p>
</div>
<p>
Once loaded into the registry, a dictionary is used as is,
even if the underlying dictionary file changes. To reload
a dictionary, first drop it with
<a class="link" href="data-masking-plugin-functions.html#function_gen-dictionary-drop-plugin">
<code class="literal">
gen_dictionary_drop()
</code>
</a>
,
then load it again with
<a class="link" href="data-masking-plugin-functions.html#function_gen-dictionary-load-plugin">
<code class="literal">
gen_dictionary_load()
</code>
</a>
.
</p>
<p>
Arguments:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<em class="replaceable">
<code>
dictionary_path
</code>
</em>
: A string
that specifies the path name of the dictionary file.
</p>
</li>
<li class="listitem">
<p>
<em class="replaceable">
<code>
dictionary_name
</code>
</em>
: A string
that provides a name for the dictionary.
</p>
</li>
</ul>
</div>
<p>
Return value:
</p>
<p>
A string that indicates whether the load operation
succeeded.
<code class="literal">
Dictionary load success
</code>
indicates success.
<code class="literal">
Dictionary load
error
</code>
indicates failure. Dictionary load failure
can occur for several reasons, including:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
A dictionary with the given name is already loaded.
</p>
</li>
<li class="listitem">
<p>
The dictionary file is not found.
</p>
</li>
<li class="listitem">
<p>
The dictionary file contains no terms.
</p>
</li>
<li class="listitem">
<p>
The
<a class="link" href="server-system-variables.html#sysvar_secure_file_priv">
<code class="literal">
secure_file_priv
</code>
</a>
system variable is set and the dictionary file is not
located in the directory named by the variable.
</p>
</li>
</ul>
</div>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa76565011"><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></span> <span class="token keyword">SELECT</span> gen_dictionary_load<span class="token punctuation">(</span><span class="token string">'/usr/local/mysql/mysql-files/mydict'</span><span class="token punctuation">,</span><span class="token string">'mydict'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_dictionary_load('/usr/local/mysql/mysql<span class="token punctuation">-</span>files/mydict','mydict') <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>
<span class="token output"><span class="token punctuation">|</span> Dictionary load success <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> gen_dictionary_load<span class="token punctuation">(</span><span class="token string">'/dev/null'</span><span class="token punctuation">,</span><span class="token string">'null'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> gen_dictionary_load('/dev/null','null') <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>
<span class="token output"><span class="token punctuation">|</span> Dictionary load error <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></code></pre>
</div>
</li>
</ul>
</div>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/performance-schema-setup-consumers-table.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="performance-schema-setup-consumers-table">
</a>
29.12.2.2 The setup_consumers Table
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045073895824">
</a>
<a class="indexterm" name="idm46045073894336">
</a>
<p>
The
<a class="link" href="performance-schema-setup-consumers-table.html" title="29.12.2.2 The setup_consumers Table">
<code class="literal">
setup_consumers
</code>
</a>
table lists
the types of consumers for which event information can be
stored and which are enabled:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa36832662"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>setup_consumers<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>
<span class="token output"><span class="token punctuation">|</span> NAME <span class="token punctuation">|</span> ENABLED <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>
<span class="token output"><span class="token punctuation">|</span> events_stages_current <span class="token punctuation">|</span> NO <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> events_stages_history <span class="token punctuation">|</span> NO <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> events_stages_history_long <span class="token punctuation">|</span> NO <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> events_statements_current <span class="token punctuation">|</span> YES <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> events_statements_history <span class="token punctuation">|</span> YES <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> events_statements_history_long <span class="token punctuation">|</span> NO <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> events_transactions_current <span class="token punctuation">|</span> YES <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> events_transactions_history <span class="token punctuation">|</span> YES <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> events_transactions_history_long <span class="token punctuation">|</span> NO <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> events_waits_current <span class="token punctuation">|</span> NO <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> events_waits_history <span class="token punctuation">|</span> NO <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> events_waits_history_long <span class="token punctuation">|</span> NO <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> global_instrumentation <span class="token punctuation">|</span> YES <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> thread_instrumentation <span class="token punctuation">|</span> YES <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> statements_digest <span class="token punctuation">|</span> YES <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></code></pre>
</div>
<p>
The consumer settings in the
<a class="link" href="performance-schema-setup-consumers-table.html" title="29.12.2.2 The setup_consumers Table">
<code class="literal">
setup_consumers
</code>
</a>
table form a
hierarchy from higher levels to lower. For detailed
information about the effect of enabling different consumers,
see
<a class="xref" href="performance-schema-consumer-filtering.html" title="29.4.7 Pre-Filtering by Consumer">
Section 29.4.7, “Pre-Filtering by Consumer”
</a>
.
</p>
<p>
Modifications to the
<a class="link" href="performance-schema-setup-consumers-table.html" title="29.12.2.2 The setup_consumers Table">
<code class="literal">
setup_consumers
</code>
</a>
table affect
monitoring immediately.
</p>
<p>
The
<a class="link" href="performance-schema-setup-consumers-table.html" title="29.12.2.2 The setup_consumers Table">
<code class="literal">
setup_consumers
</code>
</a>
table has
these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
NAME
</code>
</p>
<p>
The consumer name.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ENABLED
</code>
</p>
<p>
Whether the consumer is enabled. The value is
<code class="literal">
YES
</code>
or
<code class="literal">
NO
</code>
. This
column can be modified. If you disable a consumer, the
server does not spend time adding event information to it.
</p>
</li>
</ul>
</div>
<p>
The
<a class="link" href="performance-schema-setup-consumers-table.html" title="29.12.2.2 The setup_consumers Table">
<code class="literal">
setup_consumers
</code>
</a>
table has
these indexes:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Primary key on (
<code class="literal">
NAME
</code>
)
</p>
</li>
</ul>
</div>
<p>
<a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
<code class="literal">
TRUNCATE TABLE
</code>
</a>
is not permitted
for the
<a class="link" href="performance-schema-setup-consumers-table.html" title="29.12.2.2 The setup_consumers Table">
<code class="literal">
setup_consumers
</code>
</a>
table.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/performance-schema-replication-connection-status-table.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="performance-schema-replication-connection-status-table">
</a>
29.12.11.13 The replication_connection_status Table
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045070890720">
</a>
<a class="indexterm" name="idm46045070889216">
</a>
<p>
This table shows the current status of the I/O thread that
handles the replica's connection to the source,
information on the last transaction queued in the relay log,
and information on the transaction currently being queued in
the relay log.
</p>
<p>
Compared to the
<a class="link" href="performance-schema-replication-connection-configuration-table.html" title="29.12.11.11 The replication_connection_configuration Table">
<code class="literal">
replication_connection_configuration
</code>
</a>
table,
<a class="link" href="performance-schema-replication-connection-status-table.html" title="29.12.11.13 The replication_connection_status Table">
<code class="literal">
replication_connection_status
</code>
</a>
changes more frequently. It contains values that change during
the connection, whereas
<a class="link" href="performance-schema-replication-connection-configuration-table.html" title="29.12.11.11 The replication_connection_configuration Table">
<code class="literal">
replication_connection_configuration
</code>
</a>
contains values which define how the replica connects to the
source and that remain constant during the connection.
</p>
<p>
The
<a class="link" href="performance-schema-replication-connection-status-table.html" title="29.12.11.13 The replication_connection_status Table">
<code class="literal">
replication_connection_status
</code>
</a>
table has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
CHANNEL_NAME
</code>
</p>
<p>
The replication channel which this row is displaying.
There is always a default replication channel, and more
replication channels can be added. See
<a class="xref" href="replication-channels.html" title="19.2.2 Replication Channels">
Section 19.2.2, “Replication Channels”
</a>
for more
information.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
GROUP_NAME
</code>
</p>
<p>
If this server is a member of a group, shows the name of
the group the server belongs to.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
SOURCE_UUID
</code>
</p>
<p>
The
<a class="link" href="replication-options.html#sysvar_server_uuid">
<code class="literal">
server_uuid
</code>
</a>
value
from the source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
THREAD_ID
</code>
</p>
<p>
The I/O thread ID.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
SERVICE_STATE
</code>
</p>
<p>
<code class="literal">
ON
</code>
(thread exists and is active or
idle),
<code class="literal">
OFF
</code>
(thread no longer exists),
or
<code class="literal">
CONNECTING
</code>
(thread exists and is
connecting to the source).
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
RECEIVED_TRANSACTION_SET
</code>
</p>
<p>
The set of global transaction IDs (GTIDs) corresponding to
all transactions received by this replica. Empty if GTIDs
are not in use. See
<a class="xref" href="replication-gtids-concepts.html#replication-gtids-concepts-gtid-sets" title="GTID Sets">
GTID Sets
</a>
for
more information.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LAST_ERROR_NUMBER
</code>
,
<code class="literal">
LAST_ERROR_MESSAGE
</code>
</p>
<p>
The error number and error message of the most recent
error that caused the I/O thread to stop. An error number
of 0 and message of the empty string mean
<span class="quote">
“
<span class="quote">
no
error.
</span>
”
</span>
If the
<code class="literal">
LAST_ERROR_MESSAGE
</code>
value is not empty,
the error values also appear in the replica's error
log.
</p>
<p>
Issuing
<a class="link" href="reset-binary-logs-and-gtids.html" title="15.4.1.2 RESET BINARY LOGS AND GTIDS Statement">
<code class="literal">
RESET BINARY LOGS AND
GTIDS
</code>
</a>
or
<a class="link" href="reset-replica.html" title="15.4.2.3 RESET REPLICA Statement">
<code class="literal">
RESET
REPLICA
</code>
</a>
resets the values shown in these
columns.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LAST_ERROR_TIMESTAMP
</code>
</p>
<p>
A timestamp in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format that shows when the most recent I/O error took
place.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LAST_HEARTBEAT_TIMESTAMP
</code>
</p>
<p>
A timestamp in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format that shows when the most recent heartbeat signal
was received by a replica.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
COUNT_RECEIVED_HEARTBEATS
</code>
</p>
<p>
The total number of heartbeat signals that a replica
received since the last time it was restarted or reset, or
a
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE
TO
</code>
</a>
statement was issued.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LAST_QUEUED_TRANSACTION
</code>
</p>
<p>
The global transaction ID (GTID) of the last transaction
that was queued to the relay log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LAST_QUEUED_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP
</code>
</p>
<p>
A timestamp in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format that shows when the last transaction queued in the
relay log was committed on the original source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LAST_QUEUED_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP
</code>
</p>
<p>
A timestamp in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format that shows when the last transaction queued in the
relay log was committed on the immediate source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LAST_QUEUED_TRANSACTION_START_QUEUE_TIMESTAMP
</code>
</p>
<p>
A timestamp in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format that shows when the last transaction was placed in
the relay log queue by this I/O thread.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LAST_QUEUED_TRANSACTION_END_QUEUE_TIMESTAMP
</code>
</p>
<p>
A timestamp in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format that shows when the last transaction was queued to
the relay log files.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
QUEUEING_TRANSACTION
</code>
</p>
<p>
The global transaction ID (GTID) of the currently queueing
transaction in the relay log.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
QUEUEING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP
</code>
</p>
<p>
A timestamp in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format that shows when the currently queueing transaction
was committed on the original source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
QUEUEING_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP
</code>
</p>
<p>
A timestamp in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format that shows when the currently queueing transaction
was committed on the immediate source.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
QUEUEING_TRANSACTION_START_QUEUE_TIMESTAMP
</code>
</p>
<p>
A timestamp in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format that shows when the first event of the currently
queueing transaction was written to the relay log by this
I/O thread.
</p>
</li>
</ul>
</div>
<p>
When the Performance Schema is disabled, local timing
information is not collected, so the fields showing the start
and end timestamps for queued transactions are zero.
</p>
<p>
The
<a class="link" href="performance-schema-replication-connection-status-table.html" title="29.12.11.13 The replication_connection_status Table">
<code class="literal">
replication_connection_status
</code>
</a>
table has these indexes:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Primary key on (
<code class="literal">
CHANNEL_NAME
</code>
)
</p>
</li>
<li class="listitem">
<p>
Index on (
<code class="literal">
THREAD_ID
</code>
)
</p>
</li>
</ul>
</div>
<p>
The following table shows the correspondence between
<a class="link" href="performance-schema-replication-connection-status-table.html" title="29.12.11.13 The replication_connection_status Table">
<code class="literal">
replication_connection_status
</code>
</a>
columns and
<a class="link" href="show-replica-status.html" title="15.7.7.35 SHOW REPLICA STATUS Statement">
<code class="literal">
SHOW
REPLICA STATUS
</code>
</a>
columns.
</p>
<div class="informaltable">
<table summary="Correspondence between replication_connection_status columns and SHOW REPLICA STATUS columns">
<colgroup>
<col style="width: 60%"/>
<col style="width: 40%"/>
</colgroup>
<thead>
<tr>
<th>
<code class="literal">
replication_connection_status
</code>
Column
</th>
<th>
<code class="literal">
SHOW REPLICA STATUS
</code>
Column
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="literal">
SOURCE_UUID
</code>
</td>
<td>
<code class="literal">
Master_UUID
</code>
</td>
</tr>
<tr>
<td>
<code class="literal">
THREAD_ID
</code>
</td>
<td>
None
</td>
</tr>
<tr>
<td>
<code class="literal">
SERVICE_STATE
</code>
</td>
<td>
<code class="literal">
Replica_IO_Running
</code>
</td>
</tr>
<tr>
<td>
<code class="literal">
RECEIVED_TRANSACTION_SET
</code>
</td>
<td>
<code class="literal">
Retrieved_Gtid_Set
</code>
</td>
</tr>
<tr>
<td>
<code class="literal">
LAST_ERROR_NUMBER
</code>
</td>
<td>
<code class="literal">
Last_IO_Errno
</code>
</td>
</tr>
<tr>
<td>
<code class="literal">
LAST_ERROR_MESSAGE
</code>
</td>
<td>
<code class="literal">
Last_IO_Error
</code>
</td>
</tr>
<tr>
<td>
<code class="literal">
LAST_ERROR_TIMESTAMP
</code>
</td>
<td>
<code class="literal">
Last_IO_Error_Timestamp
</code>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/information-schema-firewall-table-reference.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="information-schema-firewall-table-reference">
</a>
28.7.1 INFORMATION_SCHEMA Firewall Table Reference
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045075976064">
</a>
<a class="indexterm" name="idm46045075974592">
</a>
<p>
The following table summarizes
<code class="literal">
INFORMATION_SCHEMA
</code>
firewall tables. For greater
detail, see the individual table descriptions.
</p>
<div class="table">
<a name="idm46045075971856">
</a>
<p class="title">
<b>
Table 28.9 INFORMATION_SCHEMA Firewall Tables
</b>
</p>
<div class="table-contents">
<table frame="box" rules="all" summary="A reference that lists INFORMATION_SCHEMA firewall tables.">
<colgroup>
<col style="width: 25%"/>
<col style="width: 62%"/>
<col style="width: 12%"/>
</colgroup>
<thead>
<tr>
<th>
Table Name
</th>
<th>
Description
</th>
<th>
Deprecated
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<a class="link" href="information-schema-mysql-firewall-users-table.html" title="28.7.2 The INFORMATION_SCHEMA MYSQL_FIREWALL_USERS Table">
<code class="literal">
MYSQL_FIREWALL_USERS
</code>
</a>
</th>
<td>
Firewall in-memory data for account profiles
</td>
<td>
Yes
</td>
</tr>
<tr>
<th scope="row">
<a class="link" href="information-schema-mysql-firewall-whitelist-table.html" title="28.7.3 The INFORMATION_SCHEMA MYSQL_FIREWALL_WHITELIST Table">
<code class="literal">
MYSQL_FIREWALL_WHITELIST
</code>
</a>
</th>
<td>
Firewall in-memory data for account profile allowlists
</td>
<td>
Yes
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br class="table-break"/>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/creating-ssl-rsa-files.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="creating-ssl-rsa-files">
</a>
8.3.3 Creating SSL and RSA Certificates and Keys
</h3>
</div>
</div>
</div>
<div class="toc">
<dl class="toc">
<dt>
<span class="section">
<a href="creating-ssl-rsa-files-using-mysql.html">
8.3.3.1 Creating SSL and RSA Certificates and Keys using MySQL
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="creating-ssl-files-using-openssl.html">
8.3.3.2 Creating SSL Certificates and Keys Using openssl
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="creating-rsa-files-using-openssl.html">
8.3.3.3 Creating RSA Keys Using openssl
</a>
</span>
</dt>
</dl>
</div>
<p>
The following discussion describes how to create the files
required for SSL and RSA support in MySQL. File creation can be
performed using facilities provided by MySQL itself, or by
invoking the
<span class="command">
<strong>
openssl
</strong>
</span>
command directly.
</p>
<p>
SSL certificate and key files enable MySQL to support encrypted
connections using SSL. See
<a class="xref" href="using-encrypted-connections.html" title="8.3.1 Configuring MySQL to Use Encrypted Connections">
Section 8.3.1, “Configuring MySQL to Use Encrypted Connections”
</a>
.
</p>
<p>
RSA key files enable MySQL to support secure password exchange
over unencrypted connections for accounts authenticated by the
<code class="literal">
sha256_password
</code>
(deprecated) or
<code class="literal">
caching_sha2_password
</code>
plugin. See
<a class="xref" href="sha256-pluggable-authentication.html" title="8.4.1.3 SHA-256 Pluggable Authentication">
Section 8.4.1.3, “SHA-256 Pluggable Authentication”
</a>
, and
<a class="xref" href="caching-sha2-pluggable-authentication.html" title="8.4.1.2 Caching SHA-2 Pluggable Authentication">
Section 8.4.1.2, “Caching SHA-2 Pluggable Authentication”
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/group-replication-responses-failure-partition.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="group-replication-responses-failure-partition">
</a>
20.7.7.2 Unreachable Majority Timeout
</h4>
</div>
</div>
</div>
<p>
By default, members that find themselves in a minority due to a
network partition do not automatically leave the group. You can
use the system variable
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_unreachable_majority_timeout">
<code class="literal">
group_replication_unreachable_majority_timeout
</code>
</a>
to set a number of seconds for a member to wait after losing
contact with the majority of group members, and then exit the
group. Setting a timeout means you do not need to pro-actively
monitor for servers that are in a minority group after a network
partition, and you can avoid the possibility of creating a
split-brain situation (with two versions of the group
membership) due to inappropriate intervention.
</p>
<p>
When the timeout specified by
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_unreachable_majority_timeout">
<code class="literal">
group_replication_unreachable_majority_timeout
</code>
</a>
elapses, all pending transactions that have been processed by
the member and the others in the minority group are rolled back,
and the servers in that group move to the
<code class="literal">
ERROR
</code>
state. You can use the
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_autorejoin_tries">
<code class="literal">
group_replication_autorejoin_tries
</code>
</a>
system variable to force the member to try to rejoin the group
automatically at this point. This feature is active by default;
the member makes three auto-rejoin attempts. If the auto-rejoin
procedure does not succeed or is not attempted, the minority
member then follows the exit action specified by
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_exit_state_action">
<code class="literal">
group_replication_exit_state_action
</code>
</a>
.
</p>
<p>
Consider the following points when deciding whether or not to
set an unreachable majority timeout:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
In a symmetric group, for example a group with two or four
servers, if both partitions contain an equal number of
servers, both groups consider themselves to be in a minority
and enter the
<code class="literal">
ERROR
</code>
state. In this
situation, the group has no functional partition.
</p>
</li>
<li class="listitem">
<p>
While a minority group exists, any transactions processed by
the minority group are accepted, but blocked because the
minority servers cannot reach quorum, until either
<a class="link" href="stop-group-replication.html" title="15.4.3.2 STOP GROUP_REPLICATION Statement">
<code class="literal">
STOP GROUP_REPLICATION
</code>
</a>
is
issued on those servers or the unreachable majority timeout
is reached.
</p>
</li>
<li class="listitem">
<p>
If you do not set an unreachable majority timeout, the
servers in the minority group never enter the
<code class="literal">
ERROR
</code>
state automatically, and you must
stop them manually.
</p>
</li>
<li class="listitem">
<p>
Setting an unreachable majority timeout has no effect if it
is set on the servers in the minority group after the loss
of majority has been detected.
</p>
</li>
</ul>
</div>
<p>
If you do not use the
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_unreachable_majority_timeout">
<code class="literal">
group_replication_unreachable_majority_timeout
</code>
</a>
system
variable, the process for operator invention in the event of a
network partition is described in
<a class="xref" href="group-replication-network-partitioning.html" title="20.7.8 Handling a Network Partition and Loss of Quorum">
Section 20.7.8, “Handling a Network Partition and Loss of Quorum”
</a>
. The
process involves checking which servers are functioning and
forcing a new group membership if necessary.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/innodb-standard-monitor.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="innodb-standard-monitor">
</a>
17.17.3 InnoDB Standard Monitor and Lock Monitor Output
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045149335376">
</a>
<a class="indexterm" name="idm46045149333920">
</a>
<a class="indexterm" name="idm46045149332432">
</a>
<a class="indexterm" name="idm46045149331360">
</a>
<p>
The Lock Monitor is the same as the Standard Monitor except that
it includes additional lock information. Enabling either monitor
for periodic output turns on the same output stream, but the
stream includes extra information if the Lock Monitor is enabled.
For example, if you enable the Standard Monitor and Lock Monitor,
that turns on a single output stream. The stream includes extra
lock information until you disable the Lock Monitor.
</p>
<p>
Standard Monitor output is limited to 1MB when produced using the
<a class="link" href="show-engine.html" title="15.7.7.16 SHOW ENGINE Statement">
<code class="literal">
SHOW ENGINE INNODB
STATUS
</code>
</a>
statement. This limit does not apply to output
written to server standard error output
(
<code class="literal">
stderr
</code>
).
</p>
<p>
Example Standard Monitor output:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa13547549"><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></span> <span class="token keyword">SHOW</span> <span class="token keyword">ENGINE</span> INNODB <span class="token keyword">STATUS</span>\G
<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> 1. row <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>
Type<span class="token punctuation">:</span> InnoDB
Name<span class="token punctuation">:</span>
Status<span class="token punctuation">:</span>
=====================================
2018-04-12 15<span class="token punctuation">:</span>14<span class="token punctuation">:</span>08 0x7f971c063700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 4 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops<span class="token punctuation">:</span> 15 srv_active, 0 srv_shutdown, 1122 srv_idle
srv_master_thread log flush and writes<span class="token punctuation">:</span> 0
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO<span class="token punctuation">:</span> reservation count 24
OS WAIT ARRAY INFO<span class="token punctuation">:</span> signal count 24
RW-shared spins 4, rounds 8, OS waits 4
RW-excl spins 2, rounds 60, OS waits 2
RW-sx spins 0, rounds 0, OS waits 0
Spin rounds per wait<span class="token punctuation">:</span> 2.00 RW-shared, 30.00 RW-excl, 0.00 RW-sx
------------------------
LATEST FOREIGN KEY ERROR
------------------------
2018-04-12 14<span class="token punctuation">:</span>57<span class="token punctuation">:</span>24 0x7f97a9c91700 Transaction<span class="token punctuation">:</span>
TRANSACTION 7717, ACTIVE 0 sec inserting
mysql tables in use 1, locked 1
4 lock struct(s), heap size 1136, 3 row lock(s), undo log entries 3
MySQL thread id 8, OS thread handle 140289365317376, query id 14 localhost root update
INSERT INTO child VALUES (NULL, 1), (NULL, 2), (NULL, 3), (NULL, 4), (NULL, 5), (NULL, 6)
Foreign key constraint fails for table `test`.`child`<span class="token punctuation">:</span>
,
CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE
CASCADE ON UPDATE CASCADE
Trying to add in child table, in index par_ind tuple<span class="token punctuation">:</span>
DATA TUPLE<span class="token punctuation">:</span> 2 fields;
0<span class="token punctuation">:</span> len 4; hex 80000003; asc ;;
1<span class="token punctuation">:</span> len 4; hex 80000003; asc ;;
But in parent table `test`.`parent`, in index PRIMARY,
the closest match we can find is record<span class="token punctuation">:</span>
PHYSICAL RECORD<span class="token punctuation">:</span> n_fields 3; compact format; info bits 0
0<span class="token punctuation">:</span> len 4; hex 80000004; asc ;;
1<span class="token punctuation">:</span> len 6; hex 000000001e19; asc ;;
2<span class="token punctuation">:</span> len 7; hex 81000001110137; asc 7;;
------------
TRANSACTIONS
------------
Trx id counter 7748
Purge done for trx's n<span class="token punctuation">:</span>o < 7747 undo n<span class="token punctuation">:</span>o < 0 state<span class="token punctuation">:</span> running but idle
History list length 19
LIST OF TRANSACTIONS FOR EACH SESSION<span class="token punctuation">:</span>
---TRANSACTION 421764459790000, not started
0 lock struct(s), heap size 1136, 0 row lock(s)
---TRANSACTION 7747, ACTIVE 23 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 2 lock struct(s), heap size 1136, 1 row lock(s)
MySQL thread id 9, OS thread handle 140286987249408, query id 51 localhost root updating
DELETE FROM t WHERE i = 1
------- TRX HAS BEEN WAITING 23 SEC FOR THIS LOCK TO BE GRANTED<span class="token punctuation">:</span>
RECORD LOCKS space id 4 page no 4 n bits 72 index GEN_CLUST_INDEX of table `test`.`t`
trx id 7747 lock_mode X waiting
Record lock, heap no 3 PHYSICAL RECORD<span class="token punctuation">:</span> n_fields 4; compact format; info bits 0
0<span class="token punctuation">:</span> len 6; hex 000000000202; asc ;;
1<span class="token punctuation">:</span> len 6; hex 000000001e41; asc A;;
2<span class="token punctuation">:</span> len 7; hex 820000008b0110; asc ;;
3<span class="token punctuation">:</span> len 4; hex 80000001; asc ;;
------------------
TABLE LOCK table `test`.`t` trx id 7747 lock mode IX
RECORD LOCKS space id 4 page no 4 n bits 72 index GEN_CLUST_INDEX of table `test`.`t`
trx id 7747 lock_mode X waiting
Record lock, heap no 3 PHYSICAL RECORD<span class="token punctuation">:</span> n_fields 4; compact format; info bits 0
0<span class="token punctuation">:</span> len 6; hex 000000000202; asc ;;
1<span class="token punctuation">:</span> len 6; hex 000000001e41; asc A;;
2<span class="token punctuation">:</span> len 7; hex 820000008b0110; asc ;;
3<span class="token punctuation">:</span> len 4; hex 80000001; asc ;;
--------
FILE I/O
--------
I/O thread 0 state<span class="token punctuation">:</span> waiting for i/o request (insert buffer thread)
I/O thread 1 state<span class="token punctuation">:</span> waiting for i/o request (log thread)
I/O thread 2 state<span class="token punctuation">:</span> waiting for i/o request (read thread)
I/O thread 3 state<span class="token punctuation">:</span> waiting for i/o request (read thread)
I/O thread 4 state<span class="token punctuation">:</span> waiting for i/o request (read thread)
I/O thread 5 state<span class="token punctuation">:</span> waiting for i/o request (read thread)
I/O thread 6 state<span class="token punctuation">:</span> waiting for i/o request (write thread)
I/O thread 7 state<span class="token punctuation">:</span> waiting for i/o request (write thread)
I/O thread 8 state<span class="token punctuation">:</span> waiting for i/o request (write thread)
I/O thread 9 state<span class="token punctuation">:</span> waiting for i/o request (write thread)
Pending normal aio reads<span class="token punctuation">:</span> [0, 0, 0, 0] , aio writes<span class="token punctuation">:</span> [0, 0, 0, 0] ,
ibuf aio reads<span class="token punctuation">:</span>, log i/o's<span class="token punctuation">:</span>, sync i/o's<span class="token punctuation">:</span>
Pending flushes (fsync) log<span class="token punctuation">:</span> 0; buffer pool<span class="token punctuation">:</span> 0
833 OS file reads, 605 OS file writes, 208 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf<span class="token punctuation">:</span> size 1, free list len 0, seg size 2, 0 merges
merged operations<span class="token punctuation">:</span>
insert 0, delete mark 0, delete 0
discarded operations<span class="token punctuation">:</span>
insert 0, delete mark 0, delete 0
Hash table size 553253, node heap has 0 buffer(s)
Hash table size 553253, node heap has 1 buffer(s)
Hash table size 553253, node heap has 3 buffer(s)
Hash table size 553253, node heap has 0 buffer(s)
Hash table size 553253, node heap has 0 buffer(s)
Hash table size 553253, node heap has 0 buffer(s)
Hash table size 553253, node heap has 0 buffer(s)
Hash table size 553253, node heap has 0 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 19643450
Log buffer assigned up to 19643450
Log buffer completed up to 19643450
Log written up to 19643450
Log flushed up to 19643450
Added dirty pages up to 19643450
Pages flushed up to 19643450
Last checkpoint at 19643450
129 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total large memory allocated 2198863872
Dictionary memory allocated 409606
Buffer pool size 131072
Free buffers 130095
Database pages 973
Old database pages 0
Modified db pages 0
Pending reads 0
Pending writes<span class="token punctuation">:</span> LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 810, created 163, written 404
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len<span class="token punctuation">:</span> 973, unzip_LRU len<span class="token punctuation">:</span> 0
I/O sum[0]<span class="token punctuation">:</span>cur[0], unzip sum[0]<span class="token punctuation">:</span>cur[0]
----------------------
INDIVIDUAL BUFFER POOL INFO
----------------------
---BUFFER POOL 0
Buffer pool size 65536
Free buffers 65043
Database pages 491
Old database pages 0
Modified db pages 0
Pending reads 0
Pending writes<span class="token punctuation">:</span> LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 411, created 80, written 210
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len<span class="token punctuation">:</span> 491, unzip_LRU len<span class="token punctuation">:</span> 0
I/O sum[0]<span class="token punctuation">:</span>cur[0], unzip sum[0]<span class="token punctuation">:</span>cur[0]
---BUFFER POOL 1
Buffer pool size 65536
Free buffers 65052
Database pages 482
Old database pages 0
Modified db pages 0
Pending reads 0
Pending writes<span class="token punctuation">:</span> LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 399, created 83, written 194
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len<span class="token punctuation">:</span> 482, unzip_LRU len<span class="token punctuation">:</span> 0
I/O sum[0]<span class="token punctuation">:</span>cur[0], unzip sum[0]<span class="token punctuation">:</span>cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
0 read views open inside InnoDB
Process ID=5772, Main thread ID=140286437054208 , state=sleeping
Number of rows inserted 57, updated 354, deleted 4, read 4421
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================</span></code></pre>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title">
<a name="innodb-standard-monitor-output-sections">
</a>
Standard Monitor Output Sections
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045149310256">
</a>
<p>
For a description of each metric reported by the Standard
Monitor, refer to the
<a class="ulink" href="/doc/mysql-em-plugin/en/myoem-metrics.html" target="_top">
Metrics
</a>
chapter in the
<a class="ulink" href="/doc/mysql-em-plugin/en/" target="_top">
Oracle
Enterprise Manager for MySQL Database User's Guide
</a>
.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
Status
</code>
</p>
<p>
This section shows the timestamp, the monitor name, and the
number of seconds that per-second averages are based on. The
number of seconds is the elapsed time between the current
time and the last time
<code class="literal">
InnoDB
</code>
Monitor
output was printed.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
BACKGROUND THREAD
</code>
</p>
<p>
The
<code class="literal">
srv_master_thread
</code>
lines shows work
done by the main background thread.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
SEMAPHORES
</code>
</p>
<p>
This section reports threads waiting for a semaphore and
statistics on how many times threads have needed a spin or a
wait on a mutex or a rw-lock semaphore. A large number of
threads waiting for semaphores may be a result of disk I/O,
or contention problems inside
<code class="literal">
InnoDB
</code>
.
Contention can be due to heavy parallelism of queries or
problems in operating system thread scheduling. Setting the
<a class="link" href="innodb-parameters.html#sysvar_innodb_thread_concurrency">
<code class="literal">
innodb_thread_concurrency
</code>
</a>
system variable smaller than the default value might help in
such situations. The
<code class="literal">
Spin rounds per wait
</code>
line shows the number of spinlock rounds per OS wait for a
mutex.
</p>
<p>
Mutex metrics are reported by
<a class="link" href="show-engine.html" title="15.7.7.16 SHOW ENGINE Statement">
<code class="literal">
SHOW ENGINE
INNODB MUTEX
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LATEST FOREIGN KEY ERROR
</code>
</p>
<p>
This section provides information about the most recent
foreign key constraint error. It is not present if no such
error has occurred. The contents include the statement that
failed as well as information about the constraint that
failed and the referenced and referencing tables.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LATEST DETECTED DEADLOCK
</code>
</p>
<p>
This section provides information about the most recent
deadlock. It is not present if no deadlock has occurred. The
contents show which transactions are involved, the statement
each was attempting to execute, the locks they have and
need, and which transaction
<code class="literal">
InnoDB
</code>
decided to roll back to break the deadlock. The lock modes
reported in this section are explained in
<a class="xref" href="innodb-locking.html" title="17.7.1 InnoDB Locking">
Section 17.7.1, “InnoDB Locking”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TRANSACTIONS
</code>
</p>
<p>
If this section reports lock waits, your applications might
have lock contention. The output can also help to trace the
reasons for transaction deadlocks.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
FILE I/O
</code>
</p>
<p>
This section provides information about threads that
<code class="literal">
InnoDB
</code>
uses to perform various types of
I/O. The first few of these are dedicated to general
<code class="literal">
InnoDB
</code>
processing. The contents also
display information for pending I/O operations and
statistics for I/O performance.
</p>
<p>
The number of these threads are controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_io_threads">
<code class="literal">
innodb_read_io_threads
</code>
</a>
and
<a class="link" href="innodb-parameters.html#sysvar_innodb_write_io_threads">
<code class="literal">
innodb_write_io_threads
</code>
</a>
parameters. See
<a class="xref" href="innodb-parameters.html" title="17.14 InnoDB Startup Options and System Variables">
Section 17.14, “InnoDB Startup Options and System Variables”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
INSERT BUFFER AND ADAPTIVE HASH INDEX
</code>
</p>
<p>
This section shows the status of the
<code class="literal">
InnoDB
</code>
insert buffer (also referred to as
the
<a class="link" href="glossary.html#glos_change_buffer" title="change buffer">
change buffer
</a>
)
and the adaptive hash index.
</p>
<p>
For related information, see
<a class="xref" href="innodb-change-buffer.html" title="17.5.2 Change Buffer">
Section 17.5.2, “Change Buffer”
</a>
, and
<a class="xref" href="innodb-adaptive-hash.html" title="17.5.3 Adaptive Hash Index">
Section 17.5.3, “Adaptive Hash Index”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LOG
</code>
</p>
<p>
This section displays information about the
<code class="literal">
InnoDB
</code>
log. The contents include the
current log sequence number, how far the log has been
flushed to disk, and the position at which
<code class="literal">
InnoDB
</code>
last took a checkpoint. (See
<a class="xref" href="innodb-checkpoints.html" title="17.11.3 InnoDB Checkpoints">
Section 17.11.3, “InnoDB Checkpoints”
</a>
.) The section also
displays information about pending writes and write
performance statistics.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
BUFFER POOL AND MEMORY
</code>
</p>
<p>
This section gives you statistics on pages read and written.
You can calculate from these numbers how many data file I/O
operations your queries currently are doing.
</p>
<p>
For buffer pool statistics descriptions, see
<a class="xref" href="innodb-buffer-pool.html#innodb-buffer-pool-monitoring" title="Monitoring the Buffer Pool Using the InnoDB Standard Monitor">
Monitoring the Buffer Pool Using the InnoDB Standard Monitor
</a>
. For
additional information about the operation of the buffer
pool, see
<a class="xref" href="innodb-buffer-pool.html" title="17.5.1 Buffer Pool">
Section 17.5.1, “Buffer Pool”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
ROW OPERATIONS
</code>
</p>
<p>
This section shows what the main thread is doing, including
the number and performance rate for each type of row
operation.
</p>
</li>
</ul>
</div>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/activestate-perl.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="activestate-perl">
</a>
2.10.2 Installing ActiveState Perl on Windows
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045326482176">
</a>
<a class="indexterm" name="idm46045326480720">
</a>
<a class="indexterm" name="idm46045326479232">
</a>
<p>
On Windows, you should do the following to install the MySQL
<code class="literal">
DBD
</code>
module with ActiveState Perl:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Get ActiveState Perl from
<a class="ulink" href="http://www.activestate.com/Products/ActivePerl/" target="_blank">
http://www.activestate.com/Products/ActivePerl/
</a>
and install it.
</p>
</li>
<li class="listitem">
<p>
Open a console window.
</p>
</li>
<li class="listitem">
<p>
If necessary, set the
<code class="literal">
HTTP_proxy
</code>
variable.
For example, you might try a setting like this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa66860824"><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">C:\></span><span class="token command"> set</span> HTTP_proxy<span class="token attr-value"><span class="token punctuation">=</span>my.proxy.com:3128</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Start the PPM program:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa29582354"><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">C:\></span><span class="token command"> C:\perl\bin\ppm.pl</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
If you have not previously done so, install
<code class="literal">
DBI
</code>
:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa12565658"><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">ppm> install DBI</code></pre>
</div>
</li>
<li class="listitem">
<p>
If this succeeds, run the following command:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa42099894"><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">ppm> install DBD-mysql</code></pre>
</div>
</li>
</ol>
</div>
<p>
This procedure should work with ActiveState Perl 5.6 or higher.
</p>
<p>
If you cannot get the procedure to work, you should install the
ODBC driver instead and connect to the MySQL server through ODBC:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-perl"><div class="docs-select-all right" id="sa21656460"><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-perl"><span class="token keyword">use</span> DBI<span class="token punctuation">;</span>
<span class="token variable">$dbh</span><span class="token operator">=</span> DBI<span class="token operator">-></span>connect<span class="token punctuation">(</span><span class="token string">"DBI:ODBC:$dsn"</span><span class="token punctuation">,</span><span class="token variable">$user</span><span class="token punctuation">,</span><span class="token variable">$password</span><span class="token punctuation">)</span> <span class="token operator">||</span>
<span class="token keyword">die</span> <span class="token string">"Got error $DBI::errstr when connecting to $dsn\n"</span><span class="token punctuation">;</span></code></pre>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/join.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="join">
</a>
15.2.13.2 JOIN Clause
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045180540304">
</a>
<a class="indexterm" name="idm46045180539232">
</a>
<a class="indexterm" name="idm46045180538160">
</a>
<a class="indexterm" name="idm46045180537088">
</a>
<a class="indexterm" name="idm46045180536016">
</a>
<a class="indexterm" name="idm46045180534944">
</a>
<a class="indexterm" name="idm46045180533872">
</a>
<a class="indexterm" name="idm46045180532800">
</a>
<a class="indexterm" name="idm46045180531728">
</a>
<a class="indexterm" name="idm46045180530656">
</a>
<a class="indexterm" name="idm46045180529584">
</a>
<a class="indexterm" name="idm46045180528512">
</a>
<a class="indexterm" name="idm46045180527440">
</a>
<a class="indexterm" name="idm46045180526352">
</a>
<a class="indexterm" name="idm46045180525280">
</a>
<p>
MySQL supports the following
<code class="literal">
JOIN
</code>
syntax for
the
<em class="replaceable">
<code>
table_references
</code>
</em>
part of
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements and
multiple-table
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
and
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
statements:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa813535"><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"><em class="replaceable">table_references:</em>
<em class="replaceable">escaped_table_reference</em> <span class="token punctuation">[</span><span class="token punctuation">,</span> <em class="replaceable">escaped_table_reference</em><span class="token punctuation">]</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<em class="replaceable">escaped_table_reference</em>: {
<em class="replaceable">table_reference</em>
<span class="token operator">|</span> { <span class="token keyword">OJ</span> <em class="replaceable">table_reference</em> }
}
<em class="replaceable">table_reference</em>: {
<em class="replaceable">table_factor</em>
<span class="token operator">|</span> <em class="replaceable">joined_table</em>
}
<em class="replaceable">table_factor</em>: {
<em class="replaceable">tbl_name</em> <span class="token punctuation">[</span><span class="token keyword">PARTITION</span> <span class="token punctuation">(</span><em class="replaceable">partition_names</em><span class="token punctuation">)</span><span class="token punctuation">]</span>
<span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token keyword">AS</span><span class="token punctuation">]</span> <em class="replaceable">alias</em><span class="token punctuation">]</span> <span class="token punctuation">[</span><em class="replaceable">index_hint_list</em><span class="token punctuation">]</span>
<span class="token operator">|</span> <span class="token punctuation">[</span><span class="token keyword">LATERAL</span><span class="token punctuation">]</span> <em class="replaceable">table_subquery</em> <span class="token punctuation">[</span><span class="token keyword">AS</span><span class="token punctuation">]</span> <em class="replaceable">alias</em> <span class="token punctuation">[</span><span class="token punctuation">(</span><em class="replaceable">col_list</em><span class="token punctuation">)</span><span class="token punctuation">]</span>
<span class="token operator">|</span> <span class="token punctuation">(</span> <em class="replaceable">table_references</em> <span class="token punctuation">)</span>
}
<em class="replaceable">joined_table</em>: {
<em class="replaceable">table_reference</em> {<span class="token punctuation">[</span><span class="token keyword">INNER</span> <span class="token operator">|</span> <span class="token keyword">CROSS</span><span class="token punctuation">]</span> <span class="token keyword">JOIN</span> <span class="token operator">|</span> <span class="token keyword">STRAIGHT_JOIN</span>} <em class="replaceable">table_factor</em> <span class="token punctuation">[</span><em class="replaceable">join_specification</em><span class="token punctuation">]</span>
<span class="token operator">|</span> <em class="replaceable">table_reference</em> {<span class="token keyword">LEFT</span><span class="token operator">|</span><span class="token keyword">RIGHT</span>} <span class="token punctuation">[</span><span class="token keyword">OUTER</span><span class="token punctuation">]</span> <span class="token keyword">JOIN</span> <em class="replaceable">table_reference</em> <em class="replaceable">join_specification</em>
<span class="token operator">|</span> <em class="replaceable">table_reference</em> <span class="token keyword">NATURAL</span> <span class="token punctuation">[</span><span class="token keyword">INNER</span> <span class="token operator">|</span> {<span class="token keyword">LEFT</span><span class="token operator">|</span><span class="token keyword">RIGHT</span>} <span class="token punctuation">[</span><span class="token keyword">OUTER</span><span class="token punctuation">]</span><span class="token punctuation">]</span> <span class="token keyword">JOIN</span> <em class="replaceable">table_factor</em>
}
<em class="replaceable">join_specification</em>: {
<span class="token keyword">ON</span> <em class="replaceable">search_condition</em>
<span class="token operator">|</span> <span class="token keyword">USING</span> <span class="token punctuation">(</span><em class="replaceable">join_column_list</em><span class="token punctuation">)</span>
}
<em class="replaceable">join_column_list</em>:
<span class="token keyword"><em class="replaceable">column_name</em></span><span class="token punctuation">[</span><span class="token punctuation">,</span> <span class="token keyword"><em class="replaceable">column_name</em></span><span class="token punctuation">]</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<em class="replaceable">index_hint_list</em>:
<em class="replaceable">index_hint</em><span class="token punctuation">[</span> <em class="replaceable">index_hint</em><span class="token punctuation">]</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<em class="replaceable">index_hint</em>: {
<span class="token keyword">USE</span> {<span class="token keyword">INDEX</span><span class="token operator">|</span><span class="token keyword">KEY</span>}
<span class="token punctuation">[</span><span class="token keyword">FOR</span> {<span class="token keyword">JOIN</span><span class="token operator">|</span><span class="token keyword">ORDER</span> <span class="token keyword">BY</span><span class="token operator">|</span><span class="token keyword">GROUP</span> <span class="token keyword">BY</span>}<span class="token punctuation">]</span> <span class="token punctuation">(</span><span class="token punctuation">[</span><em class="replaceable">index_list</em><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token operator">|</span> {<span class="token keyword">IGNORE</span><span class="token operator">|</span><span class="token keyword">FORCE</span>} {<span class="token keyword">INDEX</span><span class="token operator">|</span><span class="token keyword">KEY</span>}
<span class="token punctuation">[</span><span class="token keyword">FOR</span> {<span class="token keyword">JOIN</span><span class="token operator">|</span><span class="token keyword">ORDER</span> <span class="token keyword">BY</span><span class="token operator">|</span><span class="token keyword">GROUP</span> <span class="token keyword">BY</span>}<span class="token punctuation">]</span> <span class="token punctuation">(</span><em class="replaceable">index_list</em><span class="token punctuation">)</span>
}
<em class="replaceable">index_list</em>:
<em class="replaceable">index_name</em> <span class="token punctuation">[</span><span class="token punctuation">,</span> <em class="replaceable">index_name</em><span class="token punctuation">]</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span></code></pre>
</div>
<p>
A table reference is also known as a join expression.
</p>
<p>
A table reference (when it refers to a partitioned table) may
contain a
<code class="literal">
PARTITION
</code>
clause, including a list
of comma-separated partitions, subpartitions, or both. This
option follows the name of the table and precedes any alias
declaration. The effect of this option is that rows are selected
only from the listed partitions or subpartitions. Any partitions
or subpartitions not named in the list are ignored. For more
information and examples, see
<a class="xref" href="partitioning-selection.html" title="26.5 Partition Selection">
Section 26.5, “Partition Selection”
</a>
.
</p>
<p>
The syntax of
<em class="replaceable">
<code>
table_factor
</code>
</em>
is
extended in MySQL in comparison with standard SQL. The standard
accepts only
<em class="replaceable">
<code>
table_reference
</code>
</em>
, not a
list of them inside a pair of parentheses.
</p>
<p>
This is a conservative extension if each comma in a list of
<em class="replaceable">
<code>
table_reference
</code>
</em>
items is considered
as equivalent to an inner join. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa62044094"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> <span class="token punctuation">(</span>t2<span class="token punctuation">,</span> t3<span class="token punctuation">,</span> t4<span class="token punctuation">)</span>
<span class="token keyword">ON</span> <span class="token punctuation">(</span>t2<span class="token punctuation">.</span>a <span class="token operator">=</span> t1<span class="token punctuation">.</span>a <span class="token operator">AND</span> t3<span class="token punctuation">.</span>b <span class="token operator">=</span> t1<span class="token punctuation">.</span>b <span class="token operator">AND</span> t4<span class="token punctuation">.</span>c <span class="token operator">=</span> t1<span class="token punctuation">.</span>c<span class="token punctuation">)</span></code></pre>
</div>
<p>
is equivalent to:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa87079123"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> <span class="token punctuation">(</span>t2 <span class="token keyword">CROSS</span> <span class="token keyword">JOIN</span> t3 <span class="token keyword">CROSS</span> <span class="token keyword">JOIN</span> t4<span class="token punctuation">)</span>
<span class="token keyword">ON</span> <span class="token punctuation">(</span>t2<span class="token punctuation">.</span>a <span class="token operator">=</span> t1<span class="token punctuation">.</span>a <span class="token operator">AND</span> t3<span class="token punctuation">.</span>b <span class="token operator">=</span> t1<span class="token punctuation">.</span>b <span class="token operator">AND</span> t4<span class="token punctuation">.</span>c <span class="token operator">=</span> t1<span class="token punctuation">.</span>c<span class="token punctuation">)</span></code></pre>
</div>
<p>
In MySQL,
<code class="literal">
JOIN
</code>
,
<code class="literal">
CROSS
JOIN
</code>
, and
<code class="literal">
INNER JOIN
</code>
are syntactic
equivalents (they can replace each other). In standard SQL, they
are not equivalent.
<code class="literal">
INNER JOIN
</code>
is used with
an
<code class="literal">
ON
</code>
clause,
<code class="literal">
CROSS JOIN
</code>
is used otherwise.
</p>
<p>
In general, parentheses can be ignored in join expressions
containing only inner join operations. MySQL also supports
nested joins. See
<a class="xref" href="nested-join-optimization.html" title="10.2.1.8 Nested Join Optimization">
Section 10.2.1.8, “Nested Join Optimization”
</a>
.
</p>
<p>
Index hints can be specified to affect how the MySQL optimizer
makes use of indexes. For more information, see
<a class="xref" href="index-hints.html" title="10.9.4 Index Hints">
Section 10.9.4, “Index Hints”
</a>
. Optimizer hints and the
<code class="literal">
optimizer_switch
</code>
system variable are other
ways to influence optimizer use of indexes. See
<a class="xref" href="optimizer-hints.html" title="10.9.3 Optimizer Hints">
Section 10.9.3, “Optimizer Hints”
</a>
, and
<a class="xref" href="switchable-optimizations.html" title="10.9.2 Switchable Optimizations">
Section 10.9.2, “Switchable Optimizations”
</a>
.
</p>
<p>
The following list describes general factors to take into
account when writing joins:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
A table reference can be aliased using
<code class="literal">
<em class="replaceable">
<code>
tbl_name
</code>
</em>
AS
<em class="replaceable">
<code>
alias_name
</code>
</em>
</code>
or
<em class="replaceable">
<code>
tbl_name alias_name
</code>
</em>
:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa3373174"><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">SELECT</span> t1<span class="token punctuation">.</span><span class="token keyword">name</span><span class="token punctuation">,</span> t2<span class="token punctuation">.</span>salary
<span class="token keyword">FROM</span> employee <span class="token keyword">AS</span> t1 <span class="token keyword">INNER</span> <span class="token keyword">JOIN</span> info <span class="token keyword">AS</span> t2 <span class="token keyword">ON</span> t1<span class="token punctuation">.</span><span class="token keyword">name</span> <span class="token operator">=</span> t2<span class="token punctuation">.</span><span class="token keyword">name</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> t1<span class="token punctuation">.</span><span class="token keyword">name</span><span class="token punctuation">,</span> t2<span class="token punctuation">.</span>salary
<span class="token keyword">FROM</span> employee t1 <span class="token keyword">INNER</span> <span class="token keyword">JOIN</span> info t2 <span class="token keyword">ON</span> t1<span class="token punctuation">.</span><span class="token keyword">name</span> <span class="token operator">=</span> t2<span class="token punctuation">.</span><span class="token keyword">name</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
A
<em class="replaceable">
<code>
table_subquery
</code>
</em>
is also known as
a derived table or subquery in the
<code class="literal">
FROM
</code>
clause. See
<a class="xref" href="derived-tables.html" title="15.2.15.8 Derived Tables">
Section 15.2.15.8, “Derived Tables”
</a>
. Such
subqueries
<span class="emphasis">
<em>
must
</em>
</span>
include an alias to
give the subquery result a table name, and may optionally
include a list of table column names in parentheses. A
trivial example follows:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa25882108"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> <span class="token punctuation">(</span><span class="token keyword">SELECT</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">3</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> t1<span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
The maximum number of tables that can be referenced in a
single join is 61. This includes a join handled by merging
derived tables and views in the
<code class="literal">
FROM
</code>
clause into the outer query block (see
<a class="xref" href="derived-table-optimization.html" title="10.2.2.4 Optimizing Derived Tables, View References, and Common Table Expressions with Merging or Materialization">
Section 10.2.2.4, “Optimizing Derived Tables, View References, and Common Table Expressions
with Merging or Materialization”
</a>
).
</p>
<a class="indexterm" name="idm46045180468256">
</a>
<a class="indexterm" name="idm46045180466768">
</a>
</li>
<li class="listitem">
<p>
<code class="literal">
INNER JOIN
</code>
and
<code class="literal">
,
</code>
(comma) are semantically equivalent in the absence of a join
condition: both produce a Cartesian product between the
specified tables (that is, each and every row in the first
table is joined to each and every row in the second table).
</p>
<p>
However, the precedence of the comma operator is less than
that of
<code class="literal">
INNER JOIN
</code>
,
<code class="literal">
CROSS
JOIN
</code>
,
<code class="literal">
LEFT JOIN
</code>
, and so on. If
you mix comma joins with the other join types when there is
a join condition, an error of the form
<code class="literal">
Unknown
column '
<em class="replaceable">
<code>
col_name
</code>
</em>
' in 'on
clause'
</code>
may occur. Information about dealing with
this problem is given later in this section.
</p>
</li>
<li class="listitem">
<p>
The
<em class="replaceable">
<code>
search_condition
</code>
</em>
used with
<code class="literal">
ON
</code>
is any conditional expression of the
form that can be used in a
<code class="literal">
WHERE
</code>
clause.
Generally, the
<code class="literal">
ON
</code>
clause serves for
conditions that specify how to join tables, and the
<code class="literal">
WHERE
</code>
clause restricts which rows to
include in the result set.
</p>
</li>
<li class="listitem">
<p>
If there is no matching row for the right table in the
<code class="literal">
ON
</code>
or
<code class="literal">
USING
</code>
part in a
<code class="literal">
LEFT JOIN
</code>
, a row with all columns set to
<code class="literal">
NULL
</code>
is used for the right table. You can
use this fact to find rows in a table that have no
counterpart in another table:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa28834963"><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">SELECT</span> left_tbl<span class="token punctuation">.</span><span class="token operator">*</span>
<span class="token keyword">FROM</span> left_tbl <span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> right_tbl <span class="token keyword">ON</span> left_tbl<span class="token punctuation">.</span>id <span class="token operator">=</span> right_tbl<span class="token punctuation">.</span>id
<span class="token keyword">WHERE</span> right_tbl<span class="token punctuation">.</span>id <span class="token operator">IS</span> <span class="token boolean">NULL</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
This example finds all rows in
<code class="literal">
left_tbl
</code>
with an
<code class="literal">
id
</code>
value that is not present in
<code class="literal">
right_tbl
</code>
(that is, all rows in
<code class="literal">
left_tbl
</code>
with no corresponding row in
<code class="literal">
right_tbl
</code>
). See
<a class="xref" href="outer-join-optimization.html" title="10.2.1.9 Outer Join Optimization">
Section 10.2.1.9, “Outer Join Optimization”
</a>
.
</p>
</li>
<li class="listitem">
<p>
The
<code class="literal">
USING(
<em class="replaceable">
<code>
join_column_list
</code>
</em>
)
</code>
clause names a list of columns that must exist in both
tables. If tables
<code class="literal">
a
</code>
and
<code class="literal">
b
</code>
both contain columns
<code class="literal">
c1
</code>
,
<code class="literal">
c2
</code>
, and
<code class="literal">
c3
</code>
, the following join compares
corresponding columns from the two tables:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa15026346"><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">a <span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> b <span class="token keyword">USING</span> <span class="token punctuation">(</span>c1<span class="token punctuation">,</span> c2<span class="token punctuation">,</span> c3<span class="token punctuation">)</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
The
<code class="literal">
NATURAL [LEFT] JOIN
</code>
of two tables is
defined to be semantically equivalent to an
<code class="literal">
INNER
JOIN
</code>
or a
<code class="literal">
LEFT JOIN
</code>
with a
<code class="literal">
USING
</code>
clause that names all columns that
exist in both tables.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
RIGHT JOIN
</code>
works analogously to
<code class="literal">
LEFT JOIN
</code>
. To keep code portable across
databases, it is recommended that you use
<code class="literal">
LEFT
JOIN
</code>
instead of
<code class="literal">
RIGHT JOIN
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045180429712">
</a>
<a class="indexterm" name="idm46045180428640">
</a>
The
<code class="literal">
{ OJ ... }
</code>
syntax shown in the join
syntax description exists only for compatibility with ODBC.
The curly braces in the syntax should be written literally;
they are not metasyntax as used elsewhere in syntax
descriptions.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa85504815"><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">SELECT</span> left_tbl<span class="token punctuation">.</span><span class="token operator">*</span>
<span class="token keyword">FROM</span> { <span class="token keyword">OJ</span> left_tbl <span class="token keyword">LEFT</span> <span class="token keyword">OUTER</span> <span class="token keyword">JOIN</span> right_tbl
<span class="token keyword">ON</span> left_tbl<span class="token punctuation">.</span>id <span class="token operator">=</span> right_tbl<span class="token punctuation">.</span>id }
<span class="token keyword">WHERE</span> right_tbl<span class="token punctuation">.</span>id <span class="token operator">IS</span> <span class="token boolean">NULL</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
You can use other types of joins within
<code class="literal">
{ OJ ...
}
</code>
, such as
<code class="literal">
INNER JOIN
</code>
or
<code class="literal">
RIGHT OUTER JOIN
</code>
. This helps with
compatibility with some third-party applications, but is not
official ODBC syntax.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
STRAIGHT_JOIN
</code>
is similar to
<code class="literal">
JOIN
</code>
, except that the left table is
always read before the right table. This can be used for
those (few) cases for which the join optimizer processes the
tables in a suboptimal order.
</p>
</li>
</ul>
</div>
<p>
Some join examples:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa28887376"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> table1<span class="token punctuation">,</span> table2<span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> table1 <span class="token keyword">INNER</span> <span class="token keyword">JOIN</span> table2 <span class="token keyword">ON</span> table1<span class="token punctuation">.</span>id <span class="token operator">=</span> table2<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> table1 <span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> table2 <span class="token keyword">ON</span> table1<span class="token punctuation">.</span>id <span class="token operator">=</span> table2<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> table1 <span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> table2 <span class="token keyword">USING</span> <span class="token punctuation">(</span>id<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> table1 <span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> table2 <span class="token keyword">ON</span> table1<span class="token punctuation">.</span>id <span class="token operator">=</span> table2<span class="token punctuation">.</span>id
<span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> table3 <span class="token keyword">ON</span> table2<span class="token punctuation">.</span>id <span class="token operator">=</span> table3<span class="token punctuation">.</span>id<span class="token punctuation">;</span></code></pre>
</div>
<p>
Natural joins and joins with
<code class="literal">
USING
</code>
, including
outer join variants, are processed according to the SQL:2003
standard:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Redundant columns of a
<code class="literal">
NATURAL
</code>
join do
not appear. Consider this set of statements:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa7254345"><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">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>i <span class="token datatype">INT</span><span class="token punctuation">,</span> j <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t2 <span class="token punctuation">(</span>k <span class="token datatype">INT</span><span class="token punctuation">,</span> j <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t1 <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t2 <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">NATURAL</span> <span class="token keyword">JOIN</span> t2<span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">JOIN</span> t2 <span class="token keyword">USING</span> <span class="token punctuation">(</span>j<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
In the first
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statement, column
<code class="literal">
j
</code>
appears in both
tables and thus becomes a join column, so, according to
standard SQL, it should appear only once in the output, not
twice. Similarly, in the second SELECT statement, column
<code class="literal">
j
</code>
is named in the
<code class="literal">
USING
</code>
clause and should appear only once
in the output, not twice.
</p>
<p>
Thus, the statements produce this output:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-none"><div class="docs-select-all right" id="sa5032925"><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-none">+------+------+------+
| j | i | k |
+------+------+------+
| 1 | 1 | 1 |
+------+------+------+
+------+------+------+
| j | i | k |
+------+------+------+
| 1 | 1 | 1 |
+------+------+------+</code></pre>
</div>
<p>
Redundant column elimination and column ordering occurs
according to standard SQL, producing this display order:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
First, coalesced common columns of the two joined
tables, in the order in which they occur in the first
table
</p>
</li>
<li class="listitem">
<p>
Second, columns unique to the first table, in order in
which they occur in that table
</p>
</li>
<li class="listitem">
<p>
Third, columns unique to the second table, in order in
which they occur in that table
</p>
</li>
</ul>
</div>
<p>
The single result column that replaces two common columns is
defined using the coalesce operation. That is, for two
<code class="literal">
t1.a
</code>
and
<code class="literal">
t2.a
</code>
the
resulting single join column
<code class="literal">
a
</code>
is defined
as
<code class="literal">
a = COALESCE(t1.a, t2.a)
</code>
, where:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa28147654"><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 function">COALESCE</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span> y<span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">CASE</span> <span class="token keyword">WHEN</span> x <span class="token operator">IS</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token keyword">THEN</span> x <span class="token keyword">ELSE</span> y <span class="token keyword">END</span><span class="token punctuation">)</span></code></pre>
</div>
<p>
If the join operation is any other join, the result columns
of the join consist of the concatenation of all columns of
the joined tables.
</p>
<p>
A consequence of the definition of coalesced columns is
that, for outer joins, the coalesced column contains the
value of the non-
<code class="literal">
NULL
</code>
column if one of
the two columns is always
<code class="literal">
NULL
</code>
. If
neither or both columns are
<code class="literal">
NULL
</code>
, both
common columns have the same value, so it doesn't matter
which one is chosen as the value of the coalesced column. A
simple way to interpret this is to consider that a coalesced
column of an outer join is represented by the common column
of the inner table of a
<code class="literal">
JOIN
</code>
. Suppose
that the tables
<code class="literal">
t1(a, b)
</code>
and
<code class="literal">
t2(a, c)
</code>
have the following contents:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-none"><div class="docs-select-all right" id="sa68687844"><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-none">t1 t2
---- ----
1 x 2 z
2 y 3 w</code></pre>
</div>
<p>
Then, for this join, column
<code class="literal">
a
</code>
contains
the values of
<code class="literal">
t1.a
</code>
:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa93774344"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">NATURAL</span> <span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> t2<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>
<span class="token output"><span class="token punctuation">|</span> a <span class="token punctuation">|</span> b <span class="token punctuation">|</span> c <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>
<span class="token output"><span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> x <span class="token punctuation">|</span> NULL <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> y <span class="token punctuation">|</span> z <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></code></pre>
</div>
<p>
By contrast, for this join, column
<code class="literal">
a
</code>
contains the values of
<code class="literal">
t2.a
</code>
.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa66635764"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">NATURAL</span> <span class="token keyword">RIGHT</span> <span class="token keyword">JOIN</span> t2<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>
<span class="token output"><span class="token punctuation">|</span> a <span class="token punctuation">|</span> c <span class="token punctuation">|</span> b <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>
<span class="token output"><span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> z <span class="token punctuation">|</span> y <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> w <span class="token punctuation">|</span> NULL <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></code></pre>
</div>
<p>
Compare those results to the otherwise equivalent queries
with
<code class="literal">
JOIN ... ON
</code>
:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa33012725"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> t2 <span class="token keyword">ON</span> <span class="token punctuation">(</span>t1<span class="token punctuation">.</span>a <span class="token operator">=</span> t2<span class="token punctuation">.</span>a<span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> a <span class="token punctuation">|</span> b <span class="token punctuation">|</span> a <span class="token punctuation">|</span> c <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>
<span class="token output"><span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> x <span class="token punctuation">|</span> NULL <span class="token punctuation">|</span> NULL <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> y <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> z <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></code></pre>
</div>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa58802097"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">RIGHT</span> <span class="token keyword">JOIN</span> t2 <span class="token keyword">ON</span> <span class="token punctuation">(</span>t1<span class="token punctuation">.</span>a <span class="token operator">=</span> t2<span class="token punctuation">.</span>a<span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> a <span class="token punctuation">|</span> b <span class="token punctuation">|</span> a <span class="token punctuation">|</span> c <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>
<span class="token output"><span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> y <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> z <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> NULL <span class="token punctuation">|</span> NULL <span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> w <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></code></pre>
</div>
</li>
<li class="listitem">
<p>
A
<code class="literal">
USING
</code>
clause can be rewritten as an
<code class="literal">
ON
</code>
clause that compares corresponding
columns. However, although
<code class="literal">
USING
</code>
and
<code class="literal">
ON
</code>
are similar, they are not quite the
same. Consider the following two queries:
</p>
<a class="indexterm" name="idm46045180377008">
</a>
<a class="indexterm" name="idm46045180375520">
</a>
<a class="indexterm" name="idm46045180374032">
</a>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa44783911"><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">a <span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> b <span class="token keyword">USING</span> <span class="token punctuation">(</span>c1<span class="token punctuation">,</span> c2<span class="token punctuation">,</span> c3<span class="token punctuation">)</span>
a <span class="token keyword">LEFT</span> <span class="token keyword">JOIN</span> b <span class="token keyword">ON</span> a<span class="token punctuation">.</span>c1 <span class="token operator">=</span> b<span class="token punctuation">.</span>c1 <span class="token operator">AND</span> a<span class="token punctuation">.</span>c2 <span class="token operator">=</span> b<span class="token punctuation">.</span>c2 <span class="token operator">AND</span> a<span class="token punctuation">.</span>c3 <span class="token operator">=</span> b<span class="token punctuation">.</span>c3</code></pre>
</div>
<p>
With respect to determining which rows satisfy the join
condition, both joins are semantically identical.
</p>
<p>
With respect to determining which columns to display for
<code class="literal">
SELECT *
</code>
expansion, the two joins are not
semantically identical. The
<code class="literal">
USING
</code>
join
selects the coalesced value of corresponding columns,
whereas the
<code class="literal">
ON
</code>
join selects all columns
from all tables. For the
<code class="literal">
USING
</code>
join,
<code class="literal">
SELECT *
</code>
selects these values:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa47689172"><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 function">COALESCE</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>c1<span class="token punctuation">,</span> b<span class="token punctuation">.</span>c1<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">COALESCE</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>c2<span class="token punctuation">,</span> b<span class="token punctuation">.</span>c2<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">COALESCE</span><span class="token punctuation">(</span>a<span class="token punctuation">.</span>c3<span class="token punctuation">,</span> b<span class="token punctuation">.</span>c3<span class="token punctuation">)</span></code></pre>
</div>
<p>
For the
<code class="literal">
ON
</code>
join,
<code class="literal">
SELECT
*
</code>
selects these values:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-none"><div class="docs-select-all right" id="sa27552502"><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-none">a.c1, a.c2, a.c3, b.c1, b.c2, b.c3</code></pre>
</div>
<p>
With an inner join,
<a class="link" href="comparison-operators.html#function_coalesce">
<code class="literal">
COALESCE(a.c1,
b.c1)
</code>
</a>
is the same as either
<code class="literal">
a.c1
</code>
or
<code class="literal">
b.c1
</code>
because
both columns have the same value. With an outer join (such
as
<code class="literal">
LEFT JOIN
</code>
), one of the two columns can
be
<code class="literal">
NULL
</code>
. That column is omitted from the
result.
</p>
</li>
<li class="listitem">
<p>
An
<code class="literal">
ON
</code>
clause can refer only to its
operands.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa79013205"><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">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>i1 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t2 <span class="token punctuation">(</span>i2 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t3 <span class="token punctuation">(</span>i3 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">JOIN</span> t2 <span class="token keyword">ON</span> <span class="token punctuation">(</span>i1 <span class="token operator">=</span> i3<span class="token punctuation">)</span> <span class="token keyword">JOIN</span> t3<span class="token punctuation">;</span></code></pre>
</div>
<p>
The statement fails with an
<code class="literal">
Unknown column 'i3' in
'on clause'
</code>
error because
<code class="literal">
i3
</code>
is
a column in
<code class="literal">
t3
</code>
, which is not an operand
of the
<code class="literal">
ON
</code>
clause. To enable the join to
be processed, rewrite the statement as follows:
</p>
<a class="indexterm" name="idm46045180351760">
</a>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa43174518"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">JOIN</span> t2 <span class="token keyword">JOIN</span> t3 <span class="token keyword">ON</span> <span class="token punctuation">(</span>i1 <span class="token operator">=</span> i3<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
<code class="literal">
JOIN
</code>
has higher precedence than the comma
operator (
<code class="literal">
,
</code>
), so the join expression
<code class="literal">
t1, t2 JOIN t3
</code>
is interpreted as
<code class="literal">
(t1, (t2 JOIN t3))
</code>
, not as
<code class="literal">
((t1,
t2) JOIN t3)
</code>
. This affects statements that use an
<code class="literal">
ON
</code>
clause because that clause can refer
only to columns in the operands of the join, and the
precedence affects interpretation of what those operands
are.
</p>
<p>
Example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa22209856"><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">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>i1 <span class="token datatype">INT</span><span class="token punctuation">,</span> j1 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t2 <span class="token punctuation">(</span>i2 <span class="token datatype">INT</span><span class="token punctuation">,</span> j2 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t3 <span class="token punctuation">(</span>i3 <span class="token datatype">INT</span><span class="token punctuation">,</span> j3 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t1 <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t2 <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t3 <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1<span class="token punctuation">,</span> t2 <span class="token keyword">JOIN</span> t3 <span class="token keyword">ON</span> <span class="token punctuation">(</span>t1<span class="token punctuation">.</span>i1 <span class="token operator">=</span> t3<span class="token punctuation">.</span>i3<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The
<code class="literal">
JOIN
</code>
takes precedence over the comma
operator, so the operands for the
<code class="literal">
ON
</code>
clause are
<code class="literal">
t2
</code>
and
<code class="literal">
t3
</code>
.
Because
<code class="literal">
t1.i1
</code>
is not a column in either
of the operands, the result is an
<code class="literal">
Unknown column
't1.i1' in 'on clause'
</code>
error.
</p>
<a class="indexterm" name="idm46045180337984">
</a>
<p>
To enable the join to be processed, use either of these
strategies:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
Group the first two tables explicitly with parentheses
so that the operands for the
<code class="literal">
ON
</code>
clause are
<code class="literal">
(t1, t2)
</code>
and
<code class="literal">
t3
</code>
:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa2330367"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> <span class="token punctuation">(</span>t1<span class="token punctuation">,</span> t2<span class="token punctuation">)</span> <span class="token keyword">JOIN</span> t3 <span class="token keyword">ON</span> <span class="token punctuation">(</span>t1<span class="token punctuation">.</span>i1 <span class="token operator">=</span> t3<span class="token punctuation">.</span>i3<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Avoid the use of the comma operator and use
<code class="literal">
JOIN
</code>
instead:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa54307684"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">JOIN</span> t2 <span class="token keyword">JOIN</span> t3 <span class="token keyword">ON</span> <span class="token punctuation">(</span>t1<span class="token punctuation">.</span>i1 <span class="token operator">=</span> t3<span class="token punctuation">.</span>i3<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
</ul>
</div>
<p>
The same precedence interpretation also applies to
statements that mix the comma operator with
<code class="literal">
INNER
JOIN
</code>
,
<code class="literal">
CROSS JOIN
</code>
,
<code class="literal">
LEFT
JOIN
</code>
, and
<code class="literal">
RIGHT JOIN
</code>
, all of
which have higher precedence than the comma operator.
</p>
</li>
<li class="listitem">
<p>
A MySQL extension compared to the SQL:2003 standard is that
MySQL permits you to qualify the common (coalesced) columns
of
<code class="literal">
NATURAL
</code>
or
<code class="literal">
USING
</code>
joins, whereas the standard disallows that.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/gis-point-property-functions.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="gis-point-property-functions">
</a>
14.16.7.2 Point Property Functions
</h4>
</div>
</div>
</div>
<p>
A
<code class="literal">
Point
</code>
consists of X and Y coordinates,
which may be obtained using the
<a class="link" href="gis-point-property-functions.html#function_st-x">
<code class="literal">
ST_X()
</code>
</a>
and
<a class="link" href="gis-point-property-functions.html#function_st-y">
<code class="literal">
ST_Y()
</code>
</a>
functions, respectively.
These functions also permit an optional second argument that
specifies an X or Y coordinate value, in which case the function
result is the
<code class="literal">
Point
</code>
object from the first
argument with the appropriate coordinate modified to be equal to
the second argument.
</p>
<p>
For
<code class="literal">
Point
</code>
objects that have a geographic
spatial reference system (SRS), the longitude and latitude may
be obtained using the
<a class="link" href="gis-point-property-functions.html#function_st-longitude">
<code class="literal">
ST_Longitude()
</code>
</a>
and
<a class="link" href="gis-point-property-functions.html#function_st-latitude">
<code class="literal">
ST_Latitude()
</code>
</a>
functions,
respectively. These functions also permit an optional second
argument that specifies a longitude or latitude value, in which
case the function result is the
<code class="literal">
Point
</code>
object
from the first argument with the longitude or latitude modified
to be equal to the second argument.
</p>
<p>
Unless otherwise specified, functions in this section handle
their geometry arguments as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
If any argument is
<code class="literal">
NULL
</code>
, the return value
is
<code class="literal">
NULL
</code>
.
</p>
</li>
<li class="listitem">
<p>
If any geometry argument is a valid geometry but not a
<code class="literal">
Point
</code>
object, an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_unexpected_geometry_type" target="_top">
<code class="literal">
ER_UNEXPECTED_GEOMETRY_TYPE
</code>
</a>
error occurs.
</p>
</li>
<li class="listitem">
<p>
If any geometry argument is not a syntactically well-formed
geometry, an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_gis_invalid_data" target="_top">
<code class="literal">
ER_GIS_INVALID_DATA
</code>
</a>
error
occurs.
</p>
</li>
<li class="listitem">
<p>
If any geometry argument is a syntactically well-formed
geometry in an undefined spatial reference system (SRS), an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_srs_not_found" target="_top">
<code class="literal">
ER_SRS_NOT_FOUND
</code>
</a>
error
occurs.
</p>
</li>
<li class="listitem">
<p>
If an X or Y coordinate argument is provided and the value
is
<code class="literal">
-inf
</code>
,
<code class="literal">
+inf
</code>
, or
<code class="literal">
NaN
</code>
, an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_data_out_of_range" target="_top">
<code class="literal">
ER_DATA_OUT_OF_RANGE
</code>
</a>
error
occurs.
</p>
</li>
<li class="listitem">
<p>
If a longitude or latitude value is out of range, an error
occurs:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
If a longitude value is not in the range (−180,
180], an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_longitude_out_of_range" target="_top">
<code class="literal">
ER_LONGITUDE_OUT_OF_RANGE
</code>
</a>
error occurs.
</p>
</li>
<li class="listitem">
<p>
If a latitude value is not in the range [−90, 90],
an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_latitude_out_of_range" target="_top">
<code class="literal">
ER_LATITUDE_OUT_OF_RANGE
</code>
</a>
error occurs.
</p>
</li>
</ul>
</div>
<p>
Ranges shown are in degrees. The exact range limits deviate
slightly due to floating-point arithmetic.
</p>
</li>
<li class="listitem">
<p>
Otherwise, the return value is non-
<code class="literal">
NULL
</code>
.
</p>
</li>
</ul>
</div>
<p>
These functions are available for obtaining point properties:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<a name="function_st-latitude">
</a>
<p>
<a class="link" href="gis-point-property-functions.html#function_st-latitude">
<code class="literal">
ST_Latitude(
<em class="replaceable">
<code>
p
</code>
</em>
[,
<em class="replaceable">
<code>
new_latitude_val
</code>
</em>
])
</code>
</a>
</p>
<a class="indexterm" name="idm46045197401856">
</a>
<p>
With a single argument representing a valid
<code class="literal">
Point
</code>
object
<em class="replaceable">
<code>
p
</code>
</em>
that has a geographic spatial reference system (SRS),
<a class="link" href="gis-point-property-functions.html#function_st-latitude">
<code class="literal">
ST_Latitude()
</code>
</a>
returns the
latitude value of
<em class="replaceable">
<code>
p
</code>
</em>
as a
double-precision number.
</p>
<p>
With the optional second argument representing a valid
latitude value,
<a class="link" href="gis-point-property-functions.html#function_st-latitude">
<code class="literal">
ST_Latitude()
</code>
</a>
returns a
<code class="literal">
Point
</code>
object like the first
argument with its latitude equal to the second argument.
</p>
<p>
<a class="link" href="gis-point-property-functions.html#function_st-latitude">
<code class="literal">
ST_Latitude()
</code>
</a>
handles its
arguments as described in the introduction to this section,
with the addition that if the
<code class="literal">
Point
</code>
object is valid but does not have a geographic SRS, an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_srs_not_geographic" target="_top">
<code class="literal">
ER_SRS_NOT_GEOGRAPHIC
</code>
</a>
error
occurs.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa76961388"><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></span> <span class="token keyword">SET</span> <span class="token variable">@pt</span> <span class="token operator">=</span> <span class="token function">ST_GeomFromText</span><span class="token punctuation">(</span><span class="token string">'POINT(45 90)'</span><span class="token punctuation">,</span> <span class="token number">4326</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">ST_Latitude</span><span class="token punctuation">(</span><span class="token variable">@pt</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> ST_Latitude(@pt) <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>
<span class="token output"><span class="token punctuation">|</span> 45 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">ST_AsText</span><span class="token punctuation">(</span><span class="token function">ST_Latitude</span><span class="token punctuation">(</span><span class="token variable">@pt</span><span class="token punctuation">,</span> <span class="token number">10</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><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> ST_AsText(ST_Latitude(@pt, 10)) <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>
<span class="token output"><span class="token punctuation">|</span> POINT(10 90) <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></code></pre>
</div>
</li>
<li class="listitem">
<a name="function_st-longitude">
</a>
<p>
<a class="link" href="gis-point-property-functions.html#function_st-longitude">
<code class="literal">
ST_Longitude(
<em class="replaceable">
<code>
p
</code>
</em>
[,
<em class="replaceable">
<code>
new_longitude_val
</code>
</em>
])
</code>
</a>
</p>
<a class="indexterm" name="idm46045197380784">
</a>
<p>
With a single argument representing a valid
<code class="literal">
Point
</code>
object
<em class="replaceable">
<code>
p
</code>
</em>
that has a geographic spatial reference system (SRS),
<a class="link" href="gis-point-property-functions.html#function_st-longitude">
<code class="literal">
ST_Longitude()
</code>
</a>
returns the
longitude value of
<em class="replaceable">
<code>
p
</code>
</em>
as a
double-precision number.
</p>
<p>
With the optional second argument representing a valid
longitude value,
<a class="link" href="gis-point-property-functions.html#function_st-longitude">
<code class="literal">
ST_Longitude()
</code>
</a>
returns a
<code class="literal">
Point
</code>
object like the first argument with
its longitude equal to the second argument.
</p>
<p>
<a class="link" href="gis-point-property-functions.html#function_st-longitude">
<code class="literal">
ST_Longitude()
</code>
</a>
handles its
arguments as described in the introduction to this section,
with the addition that if the
<code class="literal">
Point
</code>
object is valid but does not have a geographic SRS, an
<a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_srs_not_geographic" target="_top">
<code class="literal">
ER_SRS_NOT_GEOGRAPHIC
</code>
</a>
error
occurs.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa42711574"><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></span> <span class="token keyword">SET</span> <span class="token variable">@pt</span> <span class="token operator">=</span> <span class="token function">ST_GeomFromText</span><span class="token punctuation">(</span><span class="token string">'POINT(45 90)'</span><span class="token punctuation">,</span> <span class="token number">4326</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">ST_Longitude</span><span class="token punctuation">(</span><span class="token variable">@pt</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> ST_Longitude(@pt) <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>
<span class="token output"><span class="token punctuation">|</span> 90 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">ST_AsText</span><span class="token punctuation">(</span><span class="token function">ST_Longitude</span><span class="token punctuation">(</span><span class="token variable">@pt</span><span class="token punctuation">,</span> <span class="token number">10</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><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> ST_AsText(ST_Longitude(@pt, 10)) <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>
<span class="token output"><span class="token punctuation">|</span> POINT(45 10) <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></code></pre>
</div>
</li>
<li class="listitem">
<a name="function_st-x">
</a>
<p>
<a class="link" href="gis-point-property-functions.html#function_st-x">
<code class="literal">
ST_X(
<em class="replaceable">
<code>
p
</code>
</em>
[,
<em class="replaceable">
<code>
new_x_val
</code>
</em>
])
</code>
</a>
</p>
<a class="indexterm" name="idm46045197359648">
</a>
<p>
With a single argument representing a valid
<code class="literal">
Point
</code>
object
<em class="replaceable">
<code>
p
</code>
</em>
,
<a class="link" href="gis-point-property-functions.html#function_st-x">
<code class="literal">
ST_X()
</code>
</a>
returns the
X-coordinate value of
<em class="replaceable">
<code>
p
</code>
</em>
as a
double-precision number. The X coordinate is considered to
refer to the axis that appears first in the
<code class="literal">
Point
</code>
spatial reference system (SRS)
definition.
</p>
<p>
With the optional second argument,
<a class="link" href="gis-point-property-functions.html#function_st-x">
<code class="literal">
ST_X()
</code>
</a>
returns a
<code class="literal">
Point
</code>
object like the first argument with
its X coordinate equal to the second argument. If the
<code class="literal">
Point
</code>
object has a geographic SRS, the
second argument must be in the proper range for longitude or
latitude values.
</p>
<p>
<a class="link" href="gis-point-property-functions.html#function_st-x">
<code class="literal">
ST_X()
</code>
</a>
handles its arguments
as described in the introduction to this section.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa66557193"><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></span> <span class="token keyword">SELECT</span> <span class="token function">ST_X</span><span class="token punctuation">(</span><span class="token function">Point</span><span class="token punctuation">(</span><span class="token number">56.7</span><span class="token punctuation">,</span> <span class="token number">53.34</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><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> ST_X(Point(56.7, 53.34)) <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>
<span class="token output"><span class="token punctuation">|</span> 56.7 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">ST_AsText</span><span class="token punctuation">(</span><span class="token function">ST_X</span><span class="token punctuation">(</span><span class="token function">Point</span><span class="token punctuation">(</span><span class="token number">56.7</span><span class="token punctuation">,</span> <span class="token number">53.34</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token number">10.5</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><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> ST_AsText(ST_X(Point(56.7, 53.34), 10.5)) <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>
<span class="token output"><span class="token punctuation">|</span> POINT(10.5 53.34) <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></code></pre>
</div>
</li>
<li class="listitem">
<a name="function_st-y">
</a>
<p>
<a class="link" href="gis-point-property-functions.html#function_st-y">
<code class="literal">
ST_Y(
<em class="replaceable">
<code>
p
</code>
</em>
[,
<em class="replaceable">
<code>
new_y_val
</code>
</em>
])
</code>
</a>
</p>
<a class="indexterm" name="idm46045197340112">
</a>
<p>
With a single argument representing a valid
<code class="literal">
Point
</code>
object
<em class="replaceable">
<code>
p
</code>
</em>
,
<a class="link" href="gis-point-property-functions.html#function_st-y">
<code class="literal">
ST_Y()
</code>
</a>
returns the
Y-coordinate value of
<em class="replaceable">
<code>
p
</code>
</em>
as a
double-precision number.The Y coordinate is considered to
refer to the axis that appears second in the
<code class="literal">
Point
</code>
spatial reference system (SRS)
definition.
</p>
<p>
With the optional second argument,
<a class="link" href="gis-point-property-functions.html#function_st-y">
<code class="literal">
ST_Y()
</code>
</a>
returns a
<code class="literal">
Point
</code>
object like the first argument with
its Y coordinate equal to the second argument. If the
<code class="literal">
Point
</code>
object has a geographic SRS, the
second argument must be in the proper range for longitude or
latitude values.
</p>
<p>
<a class="link" href="gis-point-property-functions.html#function_st-y">
<code class="literal">
ST_Y()
</code>
</a>
handles its arguments
as described in the introduction to this section.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa68352371"><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></span> <span class="token keyword">SELECT</span> <span class="token function">ST_Y</span><span class="token punctuation">(</span><span class="token function">Point</span><span class="token punctuation">(</span><span class="token number">56.7</span><span class="token punctuation">,</span> <span class="token number">53.34</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><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> ST_Y(Point(56.7, 53.34)) <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>
<span class="token output"><span class="token punctuation">|</span> 53.34 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">ST_AsText</span><span class="token punctuation">(</span><span class="token function">ST_Y</span><span class="token punctuation">(</span><span class="token function">Point</span><span class="token punctuation">(</span><span class="token number">56.7</span><span class="token punctuation">,</span> <span class="token number">53.34</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token number">10.5</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><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> ST_AsText(ST_Y(Point(56.7, 53.34), 10.5)) <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>
<span class="token output"><span class="token punctuation">|</span> POINT(56.7 10.5) <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></code></pre>
</div>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/replication-asynchronous-connection-failover.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="replication-asynchronous-connection-failover">
</a>
19.4.9 Switching Sources and Replicas with Asynchronous Connection Failover
</h3>
</div>
</div>
</div>
<div class="toc">
<dl class="toc">
<dt>
<span class="section">
<a href="replication-asynchronous-connection-failover-source.html">
19.4.9.1 Asynchronous Connection Failover for Sources
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="replication-asynchronous-connection-failover-replica.html">
19.4.9.2 Asynchronous Connection Failover for Replicas
</a>
</span>
</dt>
</dl>
</div>
<p>
You can use the asynchronous connection failover mechanism to
establish an asynchronous (source-to-replica) replication
connection to a new source automatically, after the existing
connection from a replica to its source fails. The asynchronous
connection failover mechanism can be used to keep a replica
synchronized with multiple MySQL servers or groups of servers that
share data. The list of potential source servers is stored on the
replica, and in the event of a connection failure, a new source is
selected from the list based on a weighted priority that you set.
</p>
<p>
The asynchronous connection failover mechanism also supports Group
Replication topologies, by automatically monitoring changes to
group membership and distinguishing between primary and secondary
servers. When you add a group member to the source list and define
it as part of a managed group, the asynchronous connection
failover mechanism updates the source list to keep it in line with
membership changes, adding and removing group members
automatically as they join or leave. Only online group members
that are in the majority are used for connections and obtaining
status. The last remaining member of a managed group is not
removed automatically even if it leaves the group, so that the
configuration of the managed group is kept. However, you can
delete a managed group manually if it is no longer needed.
</p>
<p>
The asynchronous connection failover mechanism also enables a
replica that is part of a managed replication group to
automatically reconnect to the sender if the current receiver (the
primary of the group) fails. This feature works with Group
Replication, on a group configured in single-primary mode, where
the group’s primary is a replica that has a replication channel
using the mechanism. The feature is designed for a group of
senders and a group of receivers to keep synchronized with each
other even when some members are temporarily unavailable. It also
synchronizes a group of receivers with one or more senders that
are not part of a managed group. A replica that is not part of a
replication group cannot use this feature.
</p>
<p>
The requirements for using the asynchronous connection failover
mechanism are as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
GTIDs must be in use on the source and the replica
(
<a class="link" href="replication-options-gtids.html#sysvar_gtid_mode">
<code class="literal">
gtid_mode=ON
</code>
</a>
), and the
<code class="literal">
SOURCE_AUTO_POSITION
</code>
option of the
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE TO
</code>
</a>
statement must be enabled on the replica, so that GTID
auto-positioning is used for the connection to the source.
</p>
</li>
<li class="listitem">
<p>
The same replication user account and password must exist on
all the source servers in the source list for the channel.
This account is used for the connection to each of the
sources. You can set up different accounts for different
channels.
</p>
</li>
<li class="listitem">
<p>
The replication user account must be given
<code class="literal">
SELECT
</code>
permissions on the Performance
Schema tables, for example, by issuing
<code class="literal">
GRANT SELECT
ON performance_schema.* TO
'
<em class="replaceable">
<code>
repl_user
</code>
</em>
';
</code>
</p>
</li>
<li class="listitem">
<p>
The replication user account and password cannot be specified
on the statement used to start replication, because they need
to be available on the automatic restart for the connection to
the alternative source. They must be set for the channel using
the
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE
TO
</code>
</a>
statement on the replica, and recorded in the
replication metadata repositories.
</p>
</li>
<li class="listitem">
<p>
If the channel where the asynchronous connection failover
mechanism is in use is on the primary of a Group Replication
single-primary mode group, asynchronous connection failover
between replicas is also active by default. In this situation,
the replication channel and the replication user account and
password for the channel must be set up on all the secondary
servers in the replication group, and on any new joining
members. If the new servers are provisioned using MySQL’s
clone functionality, this all happens automatically.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
If you do not want asynchronous connection failover to take
place between replicas in this situation, disable it by
disabling the member action
<code class="literal">
mysql_start_failover_channels_if_primary
</code>
for the group, using the
<a class="link" href="group-replication-functions-for-member-actions.html#function_group-replication-disable-member-action">
<code class="literal">
group_replication_disable_member_action
</code>
</a>
function. When the feature is disabled, you do not need to
configure the replication channel on the secondary group
members, but if the primary goes offline or into an error
state, replication stops for the channel.
</p>
</div>
</li>
</ul>
</div>
<p>
MySQL InnoDB ClusterSet is available to provide disaster
tolerance for InnoDB Cluster deployments by linking a primary
InnoDB Cluster with one or more replicas of itself in alternate
locations, such as different datacenters. Consider using this
solution instead to simplify the setup of a new multi-group
deployment for replication, failover, and disaster recovery. You
can adopt an existing Group Replication deployment as an
InnoDB Cluster.
</p>
<p>
InnoDB ClusterSet and InnoDB Cluster are designed to abstract
and simplify the procedures for setting up, managing, monitoring,
recovering, and repairing replication groups. InnoDB ClusterSet
automatically manages replication from a primary cluster to
replica clusters using a dedicated ClusterSet replication channel.
You can use administrator commands to trigger a controlled
switchover or emergency failover between groups if the primary
cluster is not functioning normally. Servers and groups can easily
be added to or removed from the InnoDB ClusterSet deployment
after the initial setup when demand changes. For more information,
see
<a class="ulink" href="/doc/mysql-shell/8.4/en/innodb-clusterset.html" target="_top">
MySQL InnoDB ClusterSet
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-ndbinfo-threads.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="mysql-cluster-ndbinfo-threads">
</a>
25.6.17.63 The ndbinfo threads Table
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045087559440">
</a>
<p>
The
<code class="literal">
threads
</code>
table provides information about
threads running in the
<code class="literal">
NDB
</code>
kernel.
</p>
<p>
The
<code class="literal">
threads
</code>
table contains the following
columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
node_id
</code>
</p>
<p>
ID of the node where the thread is running
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
thr_no
</code>
</p>
<p>
Thread ID (specific to this node)
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
thread_name
</code>
</p>
<p>
Thread name (type of thread)
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
thread_description
</code>
</p>
<p>
Thread (type) description
</p>
</li>
</ul>
</div>
<h5>
<a name="idm46045087546880">
</a>
Notes
</h5>
<p>
Sample output from a 2-node example cluster, including thread
descriptions, is shown here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa64249506"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> threads<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 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> node_id <span class="token punctuation">|</span> thr_no <span class="token punctuation">|</span> thread_name <span class="token punctuation">|</span> thread_description <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 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> 5 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> main <span class="token punctuation">|</span> main thread, schema and distribution handling <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 5 <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> rep <span class="token punctuation">|</span> rep thread, asynch replication and proxy block handling <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 5 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> ldm <span class="token punctuation">|</span> ldm thread, handling a set of data partitions <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 5 <span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> recv <span class="token punctuation">|</span> receive thread, performing receive and polling for new receives <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 6 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> main <span class="token punctuation">|</span> main thread, schema and distribution handling <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 6 <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> rep <span class="token punctuation">|</span> rep thread, asynch replication and proxy block handling <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 6 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> ldm <span class="token punctuation">|</span> ldm thread, handling a set of data partitions <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 6 <span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> recv <span class="token punctuation">|</span> receive thread, performing receive and polling for new receives <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 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">8 rows in set (0.01 sec)</span></code></pre>
</div>
<p>
It is also possible to set either of the
<a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbmtd-threadconfig">
<code class="literal">
ThreadConfig
</code>
</a>
arguments
<code class="literal">
main
</code>
or
<code class="literal">
rep
</code>
to 0 while
keeping the other at 1, in which case the thread name is
<code class="literal">
main_rep
</code>
and its description is
<code class="literal">
main
and rep thread, schema, distribution, proxy block and asynch
replication handling
</code>
. You can also set both
<code class="literal">
main
</code>
and
<code class="literal">
rep
</code>
to 0, in
which case the name of the resulting thread is shown in this
table as
<code class="literal">
main_rep_recv
</code>
, and its description
is
<code class="literal">
main, rep and recv thread, schema, distribution,
proxy block and asynch replication handling and handling receive
and polling for new receives
</code>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/performance-schema-table-descriptions.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="performance-schema-table-descriptions">
</a>
29.12 Performance Schema Table Descriptions
</h2>
</div>
</div>
</div>
<div class="toc">
<dl class="toc">
<dt>
<span class="section">
<a href="performance-schema-table-reference.html">
29.12.1 Performance Schema Table Reference
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-setup-tables.html">
29.12.2 Performance Schema Setup Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-instance-tables.html">
29.12.3 Performance Schema Instance Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-wait-tables.html">
29.12.4 Performance Schema Wait Event Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-stage-tables.html">
29.12.5 Performance Schema Stage Event Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-statement-tables.html">
29.12.6 Performance Schema Statement Event Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-transaction-tables.html">
29.12.7 Performance Schema Transaction Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-connection-tables.html">
29.12.8 Performance Schema Connection Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-connection-attribute-tables.html">
29.12.9 Performance Schema Connection Attribute Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-user-variable-tables.html">
29.12.10 Performance Schema User-Defined Variable Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-replication-tables.html">
29.12.11 Performance Schema Replication Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-ndb-cluster-tables.html">
29.12.12 Performance Schema NDB Cluster Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-lock-tables.html">
29.12.13 Performance Schema Lock Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-system-variable-tables.html">
29.12.14 Performance Schema System Variable Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-status-variable-tables.html">
29.12.15 Performance Schema Status Variable Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-thread-pool-tables.html">
29.12.16 Performance Schema Thread Pool Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-firewall-tables.html">
29.12.17 Performance Schema Firewall Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-keyring-tables.html">
29.12.18 Performance Schema Keyring Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-clone-tables.html">
29.12.19 Performance Schema Clone Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-summary-tables.html">
29.12.20 Performance Schema Summary Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-telemetry-tables.html">
29.12.21 Performance Schema Telemetry Tables
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="performance-schema-miscellaneous-tables.html">
29.12.22 Performance Schema Miscellaneous Tables
</a>
</span>
</dt>
</dl>
</div>
<p>
Tables in the
<code class="literal">
performance_schema
</code>
database can
be grouped as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Setup tables. These tables are used to configure and display
monitoring characteristics.
</p>
</li>
<li class="listitem">
<p>
Current events tables. The
<a class="link" href="performance-schema-events-waits-current-table.html" title="29.12.4.1 The events_waits_current Table">
<code class="literal">
events_waits_current
</code>
</a>
table
contains the most recent event for each thread. Other similar
tables contain current events at different levels of the event
hierarchy:
<a class="link" href="performance-schema-events-stages-current-table.html" title="29.12.5.1 The events_stages_current Table">
<code class="literal">
events_stages_current
</code>
</a>
for stage events,
<a class="link" href="performance-schema-events-statements-current-table.html" title="29.12.6.1 The events_statements_current Table">
<code class="literal">
events_statements_current
</code>
</a>
for
statement events, and
<a class="link" href="performance-schema-events-transactions-current-table.html" title="29.12.7.1 The events_transactions_current Table">
<code class="literal">
events_transactions_current
</code>
</a>
for
transaction events.
</p>
</li>
<li class="listitem">
<p>
History tables. These tables have the same structure as the
current events tables, but contain more rows. For example, for
wait events,
<a class="link" href="performance-schema-events-waits-history-table.html" title="29.12.4.2 The events_waits_history Table">
<code class="literal">
events_waits_history
</code>
</a>
table contains the most recent 10 events per thread.
<a class="link" href="performance-schema-events-waits-history-long-table.html" title="29.12.4.3 The events_waits_history_long Table">
<code class="literal">
events_waits_history_long
</code>
</a>
contains the most recent 10,000 events. Other similar tables
exist for stage, statement, and transaction histories.
</p>
<p>
To change the sizes of the history tables, set the appropriate
system variables at server startup. For example, to set the
sizes of the wait event history tables, set
<a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_events_waits_history_size">
<code class="literal">
performance_schema_events_waits_history_size
</code>
</a>
and
<a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_events_waits_history_long_size">
<code class="literal">
performance_schema_events_waits_history_long_size
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
Summary tables. These tables contain information aggregated
over groups of events, including those that have been
discarded from the history tables.
</p>
</li>
<li class="listitem">
<p>
Instance tables. These tables document what types of objects
are instrumented. An instrumented object, when used by the
server, produces an event. These tables provide event names
and explanatory notes or status information.
</p>
</li>
<li class="listitem">
<p>
Miscellaneous tables. These do not fall into any of the other
table groups.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/dynindex-sqlmode.html | <div id="docs-body">
<div class="index">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="dynindex-sqlmode">
</a>
SQL Modes Index
</h2>
</div>
</div>
</div>
<p>
<a name="sqlmode-index-top">
</a>
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-A" title="A">
A
</a>
|
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-E" title="E">
E
</a>
|
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-H" title="H">
H
</a>
|
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-I" title="I">
I
</a>
|
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-N" title="N">
N
</a>
|
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-O" title="O">
O
</a>
|
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-P" title="P">
P
</a>
|
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-R" title="R">
R
</a>
|
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-S" title="S">
S
</a>
|
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-T" title="T">
T
</a>
</p>
<div class="indexdiv">
<a name="sqlmode-index-A">
</a>
<h3 class="title">
A
</h3>
<p>
[
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-top">
index top
</a>
]
</p>
<dl>
<dt>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
ALLOW_INVALID_DATES
</h3>
<dl>
<dt>
<a class="xref" href="date-and-time-types.html" title="13.2 Date and Time Data Types">
Section 13.2, “Date and Time Data Types”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="date-and-time-functions.html" title="14.7 Date and Time Functions">
Section 14.7, “Date and Time Functions”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="using-date.html" title="B.3.4.2 Problems Using DATE Columns">
Section B.3.4.2, “Problems Using DATE Columns”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
Section 13.2.2, “The DATE, DATETIME, and TIMESTAMP Types”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
ANSI
</h3>
<dl>
<dt>
<a class="xref" href="function-resolution.html" title="11.2.5 Function Name Parsing and Resolution">
Section 11.2.5, “Function Name Parsing and Resolution”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="show-create-view.html" title="15.7.7.14 SHOW CREATE VIEW Statement">
Section 15.7.7.14, “SHOW CREATE VIEW Statement”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="information-schema-views-table.html" title="28.3.47 The INFORMATION_SCHEMA VIEWS Table">
Section 28.3.47, “The INFORMATION_SCHEMA VIEWS Table”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
ANSI_QUOTES
</h3>
<dl>
<dt>
<a class="xref" href="create-table-foreign-keys.html" title="15.1.20.5 FOREIGN KEY Constraints">
Section 15.1.20.5, “FOREIGN KEY Constraints”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="mysql-tips.html" title="6.5.1.6 mysql Client Tips">
Section 6.5.1.6, “mysql Client Tips”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="extensions-to-ansi.html" title="1.7.1 MySQL Extensions to Standard SQL">
Section 1.7.1, “MySQL Extensions to Standard SQL”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
Section 6.5.4, “mysqldump — A Database Backup Program”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="optimizer-hints.html" title="10.9.3 Optimizer Hints">
Section 10.9.3, “Optimizer Hints”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="identifiers.html" title="11.2 Schema Object Names">
Section 11.2, “Schema Object Names”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="string-literals.html" title="11.1.1 String Literals">
Section 11.1.1, “String Literals”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<a name="sqlmode-index-E">
</a>
<h3 class="title">
E
</h3>
<p>
[
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-top">
index top
</a>
]
</p>
<dl>
<dt>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
ERROR_FOR_DIVISION_BY_ZERO
</h3>
<dl>
<dt>
<a class="xref" href="precision-math-expressions.html" title="14.24.3 Expression Handling">
Section 14.24.3, “Expression Handling”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="faqs-sql-modes.html" title="A.3 MySQL 8.4 FAQ: Server SQL Mode">
Section A.3, “MySQL 8.4 FAQ: Server SQL Mode”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="precision-math-examples.html" title="14.24.5 Precision Math Examples">
Section 14.24.5, “Precision Math Examples”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<a name="sqlmode-index-H">
</a>
<h3 class="title">
H
</h3>
<p>
[
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-top">
index top
</a>
]
</p>
<dl>
<dt>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
HIGH_NOT_PRECEDENCE
</h3>
<dl>
<dt>
<a class="xref" href="expressions.html" title="11.5 Expressions">
Section 11.5, “Expressions”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="operator-precedence.html" title="14.4.1 Operator Precedence">
Section 14.4.1, “Operator Precedence”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<a name="sqlmode-index-I">
</a>
<h3 class="title">
I
</h3>
<p>
[
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-top">
index top
</a>
]
</p>
<dl>
<dt>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
IGNORE_SPACE
</h3>
<dl>
<dt>
<a class="xref" href="create-procedure.html" title="15.1.17 CREATE PROCEDURE and CREATE FUNCTION Statements">
Section 15.1.17, “CREATE PROCEDURE and CREATE FUNCTION Statements”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="function-resolution.html" title="11.2.5 Function Name Parsing and Resolution">
Section 11.2.5, “Function Name Parsing and Resolution”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="mysql-command-options.html" title="6.5.1.1 mysql Client Options">
Section 6.5.1.1, “mysql Client Options”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<a name="sqlmode-index-N">
</a>
<h3 class="title">
N
</h3>
<p>
[
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-top">
index top
</a>
]
</p>
<dl>
<dt>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
NO_AUTO_VALUE_ON_ZERO
</h3>
<dl>
<dt>
<a class="xref" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
Section 15.1.20, “CREATE TABLE Statement”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="numeric-type-attributes.html" title="13.1.6 Numeric Type Attributes">
Section 13.1.6, “Numeric Type Attributes”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="example-auto-increment.html" title="5.6.9 Using AUTO_INCREMENT">
Section 5.6.9, “Using AUTO_INCREMENT”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
NO_BACKSLASH_ESCAPES
</h3>
<dl>
<dt>
<a class="xref" href="json-modification-functions.html" title="14.17.4 Functions That Modify JSON Values">
Section 14.17.4, “Functions That Modify JSON Values”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="regexp.html" title="14.8.2 Regular Expressions">
Section 14.8.2, “Regular Expressions”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="string-comparison-functions.html" title="14.8.1 String Comparison Functions and Operators">
Section 14.8.1, “String Comparison Functions and Operators”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="string-literals.html" title="11.1.1 String Literals">
Section 11.1.1, “String Literals”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="json.html" title="13.5 The JSON Data Type">
Section 13.5, “The JSON Data Type”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
NO_DIR_IN_CREATE
</h3>
<dl>
<dt>
<a class="xref" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
Section 15.1.20, “CREATE TABLE Statement”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="replication-features-directory.html" title="19.5.1.10 Replication and DIRECTORY Table Options">
Section 19.5.1.10, “Replication and DIRECTORY Table Options”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="replication-features-variables.html" title="19.5.1.39 Replication and Variables">
Section 19.5.1.39, “Replication and Variables”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="binary-log.html" title="7.4.4 The Binary Log">
Section 7.4.4, “The Binary Log”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
NO_ENGINE_SUBSTITUTION
</h3>
<dl>
<dt>
<a class="xref" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
Section 15.1.9, “ALTER TABLE Statement”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
Section 15.1.20, “CREATE TABLE Statement”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="plugin-loading.html" title="7.6.1 Installing and Uninstalling Plugins">
Section 7.6.1, “Installing and Uninstalling Plugins”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="faqs-sql-modes.html" title="A.3 MySQL 8.4 FAQ: Server SQL Mode">
Section A.3, “MySQL 8.4 FAQ: Server SQL Mode”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="storage-engine-setting.html" title="18.1 Setting the Storage Engine">
Section 18.1, “Setting the Storage Engine”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="replication-solutions-diffengines.html" title="19.4.4 Using Replication with Different Source and Replica Storage Engines">
Section 19.4.4, “Using Replication with Different Source and Replica Storage Engines”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
NO_UNSIGNED_SUBTRACTION
</h3>
<dl>
<dt>
<a class="xref" href="arithmetic-functions.html" title="14.6.1 Arithmetic Operators">
Section 14.6.1, “Arithmetic Operators”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="cast-functions.html" title="14.10 Cast Functions and Operators">
Section 14.10, “Cast Functions and Operators”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="numeric-type-syntax.html" title="13.1.1 Numeric Data Type Syntax">
Section 13.1.1, “Numeric Data Type Syntax”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="out-of-range-and-overflow.html" title="13.1.7 Out-of-Range and Overflow Handling">
Section 13.1.7, “Out-of-Range and Overflow Handling”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="partitioning-limitations.html" title="26.6 Restrictions and Limitations on Partitioning">
Section 26.6, “Restrictions and Limitations on Partitioning”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
NO_ZERO_DATE
</h3>
<dl>
<dt>
<a class="xref" href="timestamp-initialization.html" title="13.2.5 Automatic Initialization and Updating for TIMESTAMP and DATETIME">
Section 13.2.5, “Automatic Initialization and Updating for TIMESTAMP and DATETIME”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="cast-functions.html" title="14.10 Cast Functions and Operators">
Section 14.10, “Cast Functions and Operators”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
Section 15.1.20, “CREATE TABLE Statement”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="date-and-time-types.html" title="13.2 Date and Time Data Types">
Section 13.2, “Date and Time Data Types”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="date-and-time-functions.html" title="14.7 Date and Time Functions">
Section 14.7, “Date and Time Functions”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="load-data.html" title="15.2.9 LOAD DATA Statement">
Section 15.2.9, “LOAD DATA Statement”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="faqs-sql-modes.html" title="A.3 MySQL 8.4 FAQ: Server SQL Mode">
Section A.3, “MySQL 8.4 FAQ: Server SQL Mode”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="using-date.html" title="B.3.4.2 Problems Using DATE Columns">
Section B.3.4.2, “Problems Using DATE Columns”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
Section 7.1.8, “Server System Variables”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
Section 13.2.2, “The DATE, DATETIME, and TIMESTAMP Types”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
NO_ZERO_IN_DATE
</h3>
<dl>
<dt>
<a class="xref" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
Section 15.1.20, “CREATE TABLE Statement”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="date-and-time-types.html" title="13.2 Date and Time Data Types">
Section 13.2, “Date and Time Data Types”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="load-data.html" title="15.2.9 LOAD DATA Statement">
Section 15.2.9, “LOAD DATA Statement”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="faqs-sql-modes.html" title="A.3 MySQL 8.4 FAQ: Server SQL Mode">
Section A.3, “MySQL 8.4 FAQ: Server SQL Mode”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="using-date.html" title="B.3.4.2 Problems Using DATE Columns">
Section B.3.4.2, “Problems Using DATE Columns”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<a name="sqlmode-index-O">
</a>
<h3 class="title">
O
</h3>
<p>
[
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-top">
index top
</a>
]
</p>
<dl>
<dt>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
ONLY_FULL_GROUP_BY
</h3>
<dl>
<dt>
<a class="xref" href="counting-rows.html" title="5.3.4.8 Counting Rows">
Section 5.3.4.8, “Counting Rows”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="group-by-modifiers.html" title="14.19.2 GROUP BY Modifiers">
Section 14.19.2, “GROUP BY Modifiers”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="miscellaneous-functions.html" title="14.23 Miscellaneous Functions">
Section 14.23, “Miscellaneous Functions”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="faqs-sql-modes.html" title="A.3 MySQL 8.4 FAQ: Server SQL Mode">
Section A.3, “MySQL 8.4 FAQ: Server SQL Mode”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="group-by-handling.html" title="14.19.3 MySQL Handling of GROUP BY">
Section 14.19.3, “MySQL Handling of GROUP BY”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<a name="sqlmode-index-P">
</a>
<h3 class="title">
P
</h3>
<p>
[
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-top">
index top
</a>
]
</p>
<dl>
<dt>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
PAD_CHAR_TO_FULL_LENGTH
</h3>
<dl>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="string-type-syntax.html" title="13.3.1 String Data Type Syntax">
Section 13.3.1, “String Data Type Syntax”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="char.html" title="13.3.2 The CHAR and VARCHAR Types">
Section 13.3.2, “The CHAR and VARCHAR Types”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
PIPES_AS_CONCAT
</h3>
<dl>
<dt>
<a class="xref" href="expressions.html" title="11.5 Expressions">
Section 11.5, “Expressions”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="logical-operators.html" title="14.4.3 Logical Operators">
Section 14.4.3, “Logical Operators”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="operator-precedence.html" title="14.4.1 Operator Precedence">
Section 14.4.1, “Operator Precedence”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<a name="sqlmode-index-R">
</a>
<h3 class="title">
R
</h3>
<p>
[
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-top">
index top
</a>
]
</p>
<dl>
<dt>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
REAL_AS_FLOAT
</h3>
<dl>
<dt>
<a class="xref" href="cast-functions.html" title="14.10 Cast Functions and Operators">
Section 14.10, “Cast Functions and Operators”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="numeric-type-syntax.html" title="13.1.1 Numeric Data Type Syntax">
Section 13.1.1, “Numeric Data Type Syntax”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="numeric-types.html" title="13.1 Numeric Data Types">
Section 13.1, “Numeric Data Types”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<a name="sqlmode-index-S">
</a>
<h3 class="title">
S
</h3>
<p>
[
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-top">
index top
</a>
]
</p>
<dl>
<dt>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
STRICT_ALL_TABLES
</h3>
<dl>
<dt>
<a class="xref" href="precision-math-expressions.html" title="14.24.3 Expression Handling">
Section 14.24.3, “Expression Handling”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="faqs-sql-modes.html" title="A.3 MySQL 8.4 FAQ: Server SQL Mode">
Section A.3, “MySQL 8.4 FAQ: Server SQL Mode”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
STRICT_TRANS_TABLES
</h3>
<dl>
<dt>
<a class="xref" href="precision-math-expressions.html" title="14.24.3 Expression Handling">
Section 14.24.3, “Expression Handling”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="faqs-sql-modes.html" title="A.3 MySQL 8.4 FAQ: Server SQL Mode">
Section A.3, “MySQL 8.4 FAQ: Server SQL Mode”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<a name="sqlmode-index-T">
</a>
<h3 class="title">
T
</h3>
<p>
[
<a class="link" href="dynindex-sqlmode.html#sqlmode-index-top">
index top
</a>
]
</p>
<dl>
<dt>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
TIME_TRUNCATE_FRACTIONAL
</h3>
<dl>
<dt>
<a class="xref" href="fractional-seconds.html" title="13.2.6 Fractional Seconds in Time Values">
Section 13.2.6, “Fractional Seconds in Time Values”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
<div class="indexdiv">
<h3 class="title">
TRADITIONAL
</h3>
<dl>
<dt>
<a class="xref" href="timestamp-initialization.html" title="13.2.5 Automatic Initialization and Updating for TIMESTAMP and DATETIME">
Section 13.2.5, “Automatic Initialization and Updating for TIMESTAMP and DATETIME”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="precision-math-expressions.html" title="14.24.3 Expression Handling">
Section 14.24.3, “Expression Handling”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="faqs-sql-modes.html" title="A.3 MySQL 8.4 FAQ: Server SQL Mode">
Section A.3, “MySQL 8.4 FAQ: Server SQL Mode”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="sql-mode.html" title="7.1.11 Server SQL Modes">
Section 7.1.11, “Server SQL Modes”
</a>
</dt>
<dd>
</dd>
<dt>
<a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
Section 7.1.8, “Server System Variables”
</a>
</dt>
<dd>
</dd>
</dl>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/fulltext-search-mecab.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="fulltext-search-mecab">
</a>
14.9.9 MeCab Full-Text Parser Plugin
</h3>
</div>
</div>
</div>
<p>
The built-in MySQL full-text parser uses the white space between
words as a delimiter to determine where words begin and end,
which is a limitation when working with ideographic languages
that do not use word delimiters. To address this limitation for
Japanese, MySQL provides a MeCab full-text parser plugin. The
MeCab full-text parser plugin is supported for use with
<a class="link" href="innodb-storage-engine.html" title="Chapter 17 The InnoDB Storage Engine">
<code class="literal">
InnoDB
</code>
</a>
and
<a class="link" href="myisam-storage-engine.html" title="18.2 The MyISAM Storage Engine">
<code class="literal">
MyISAM
</code>
</a>
.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
MySQL also provides an ngram full-text parser plugin that
supports Japanese. For more information, see
<a class="xref" href="fulltext-search-ngram.html" title="14.9.8 ngram Full-Text Parser">
Section 14.9.8, “ngram Full-Text Parser”
</a>
.
</p>
</div>
<p>
The MeCab full-text parser plugin is a full-text parser plugin
for Japanese that tokenizes a sequence of text into meaningful
words. For example, MeCab tokenizes
<span class="quote">
“
<span class="quote">
<span class="phrase" lang="ja">
データベース管理
</span>
</span>
”
</span>
(
<span class="quote">
“
<span class="quote">
Database Management
</span>
”
</span>
) into
<span class="quote">
“
<span class="quote">
<span class="phrase" lang="ja">
データベース
</span>
</span>
”
</span>
(
<span class="quote">
“
<span class="quote">
Database
</span>
”
</span>
) and
<span class="quote">
“
<span class="quote">
<span class="phrase" lang="ja">
管理
</span>
</span>
”
</span>
(
<span class="quote">
“
<span class="quote">
Management
</span>
”
</span>
). By comparison, the
<a class="link" href="fulltext-search-ngram.html" title="14.9.8 ngram Full-Text Parser">
ngram
</a>
full-text
parser tokenizes text into a contiguous sequence of
<em class="replaceable">
<code>
n
</code>
</em>
characters, where
<em class="replaceable">
<code>
n
</code>
</em>
represents a number between 1 and
10.
</p>
<p>
In addition to tokenizing text into meaningful words, MeCab
indexes are typically smaller than ngram indexes, and MeCab
full-text searches are generally faster. One drawback is that it
may take longer for the MeCab full-text parser to tokenize
documents, compared to the ngram full-text parser.
</p>
<p>
The full-text search syntax described in
<a class="xref" href="fulltext-search.html" title="14.9 Full-Text Search Functions">
Section 14.9, “Full-Text Search Functions”
</a>
applies to the MeCab parser
plugin. Differences in parsing behavior are described in this
section. Full-text related configuration options are also
applicable.
</p>
<p>
For additional information about the MeCab parser, refer to the
<a class="ulink" href="http://taku910.github.io/mecab/" target="_blank">
MeCab: Yet Another
Part-of-Speech and Morphological Analyzer
</a>
project on
Github.
</p>
<h4>
<a name="idm46045201195488">
</a>
Installing the MeCab Parser Plugin
</h4>
<p>
The MeCab parser plugin requires
<code class="filename">
mecab
</code>
and
<code class="filename">
mecab-ipadic
</code>
.
</p>
<p>
On supported Fedora, Debian and Ubuntu platforms (except Ubuntu
12.04 where the system
<code class="filename">
mecab
</code>
version is too
old), MySQL dynamically links to the system
<code class="filename">
mecab
</code>
installation if it is installed to
the default location. On other supported Unix-like platforms,
<code class="filename">
libmecab.so
</code>
is statically linked in
<code class="filename">
libpluginmecab.so
</code>
, which is located in the
MySQL plugin directory.
<code class="filename">
mecab-ipadic
</code>
is
included in MySQL binaries and is located in
<code class="filename">
<em class="replaceable">
<code>
MYSQL_HOME
</code>
</em>
\lib\mecab
</code>
.
</p>
<p>
You can install
<code class="filename">
mecab
</code>
and
<code class="filename">
mecab-ipadic
</code>
using a native package
management utility (on Fedora, Debian, and Ubuntu), or you can
build
<code class="filename">
mecab
</code>
and
<code class="filename">
mecab-ipadic
</code>
from source. For information
about installing
<code class="filename">
mecab
</code>
and
<code class="filename">
mecab-ipadic
</code>
using a native package
management utility, see
<a class="link" href="fulltext-search-mecab.html#install-mecab-binary" title="Installing MeCab From a Binary Distribution (Optional)">
Installing MeCab From a
Binary Distribution (Optional)
</a>
. If you want to build
<code class="filename">
mecab
</code>
and
<code class="literal">
mecab-ipadic
</code>
from source, see
<a class="link" href="fulltext-search-mecab.html#build-mecab-from-source" title="Installing MeCab From Source (Optional)">
Building MeCab From
Source (Optional)
</a>
.
</p>
<p>
On Windows,
<code class="filename">
libmecab.dll
</code>
is found in the
MySQL
<code class="filename">
bin
</code>
directory.
<code class="filename">
mecab-ipadic
</code>
is located in
<code class="filename">
<em class="replaceable">
<code>
MYSQL_HOME
</code>
</em>
/lib/mecab
</code>
.
</p>
<p>
To install and configure the MeCab parser plugin, perform the
following steps:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
In the MySQL configuration file, set the
<a class="link" href="server-system-variables.html#sysvar_mecab_rc_file">
<code class="literal">
mecab_rc_file
</code>
</a>
configuration
option to the location of the
<code class="literal">
mecabrc
</code>
configuration file, which is the configuration file for
MeCab. If you are using the MeCab package distributed with
MySQL, the
<code class="literal">
mecabrc
</code>
file is located in
<code class="filename">
MYSQL_HOME/lib/mecab/etc/
</code>
.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-ini"><div class="docs-select-all right" id="sa21672714"><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">loose-mecab-rc-file</span><span class="token attr-value"><span class="token punctuation">=</span>MYSQL_HOME/lib/mecab/etc/mecabrc</span></code></pre>
</div>
<p>
The
<code class="literal">
loose
</code>
prefix is an
<a class="link" href="option-modifiers.html" title="6.2.2.4 Program Option Modifiers">
option modifier
</a>
. The
<a class="link" href="server-system-variables.html#sysvar_mecab_rc_file">
<code class="literal">
mecab_rc_file
</code>
</a>
option is not
recognized by MySQL until the MeCaB parser plugin is
installed but it must be set before attempting to install
the MeCaB parser plugin. The
<code class="literal">
loose
</code>
prefix
allows you restart MySQL without encountering an error due
to an unrecognized variable.
</p>
<p>
If you use your own MeCab installation, or build MeCab from
source, the location of the
<code class="filename">
mecabrc
</code>
configuration file may differ.
</p>
<p>
For information about the MySQL configuration file and its
location, see
<a class="xref" href="option-files.html" title="6.2.2.2 Using Option Files">
Section 6.2.2.2, “Using Option Files”
</a>
.
</p>
</li>
<li class="listitem">
<p>
Also in the MySQL configuration file, set the minimum token
size to 1 or 2, which are the values recommended for use
with the MeCab parser. For
<code class="literal">
InnoDB
</code>
tables,
minimum token size is defined by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_ft_min_token_size">
<code class="literal">
innodb_ft_min_token_size
</code>
</a>
configuration option, which has a default value of 3. For
<code class="literal">
MyISAM
</code>
tables, minimum token size is
defined by
<a class="link" href="server-system-variables.html#sysvar_ft_min_word_len">
<code class="literal">
ft_min_word_len
</code>
</a>
,
which has a default value of 4.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-ini"><div class="docs-select-all right" id="sa32681041"><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">innodb_ft_min_token_size</span><span class="token attr-value"><span class="token punctuation">=</span>1</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Modify the
<code class="filename">
mecabrc
</code>
configuration file
to specify the dictionary you want to use. The
<code class="filename">
mecab-ipadic
</code>
package distributed with
MySQL binaries includes three dictionaries
(
<code class="literal">
ipadic_euc-jp
</code>
,
<code class="literal">
ipadic_sjis
</code>
, and
<code class="literal">
ipadic_utf-8
</code>
). The
<code class="filename">
mecabrc
</code>
configuration file packaged
with MySQL contains and entry similar to the following:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-ini"><div class="docs-select-all right" id="sa41879727"><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 constant">dicdir</span> <span class="token attr-value"><span class="token punctuation">=</span> /path/to/mysql/lib/mecab/lib/mecab/dic/ipadic_euc-jp</span></code></pre>
</div>
<p>
To use the
<code class="filename">
ipadic_utf-8
</code>
dictionary, for
example, modify the entry as follows:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-ini"><div class="docs-select-all right" id="sa56210312"><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 constant">dicdir</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">MYSQL_HOME</em>/lib/mecab/dic/ipadic_utf-8</span></code></pre>
</div>
<p>
If you are using your own MeCab installation or have built
MeCab from source, the default
<code class="literal">
dicdir
</code>
entry in the
<code class="filename">
mecabrc
</code>
file is likely to
differ, as are the dictionaries and their location.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
After the MeCab parser plugin is installed, you can use
the
<a class="link" href="server-status-variables.html#statvar_mecab_charset">
<code class="literal">
mecab_charset
</code>
</a>
status
variable to view the character set used with MeCab. The
three MeCab dictionaries provided with the MySQL binary
support the following character sets.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The
<code class="literal">
ipadic_euc-jp
</code>
dictionary
supports the
<code class="literal">
ujis
</code>
and
<code class="literal">
eucjpms
</code>
character sets.
</p>
</li>
<li class="listitem">
<p>
The
<code class="literal">
ipadic_sjis
</code>
dictionary supports
the
<code class="literal">
sjis
</code>
and
<code class="literal">
cp932
</code>
character sets.
</p>
</li>
<li class="listitem">
<p>
The
<code class="literal">
ipadic_utf-8
</code>
dictionary
supports the
<code class="literal">
utf8mb3
</code>
and
<code class="literal">
utf8mb4
</code>
character sets.
</p>
</li>
</ul>
</div>
<p>
<a class="link" href="server-status-variables.html#statvar_mecab_charset">
<code class="literal">
mecab_charset
</code>
</a>
only
reports the first supported character set. For example,
the
<code class="literal">
ipadic_utf-8
</code>
dictionary supports
both
<code class="literal">
utf8mb3
</code>
and
<code class="literal">
utf8mb4
</code>
.
<a class="link" href="server-status-variables.html#statvar_mecab_charset">
<code class="literal">
mecab_charset
</code>
</a>
always
reports
<code class="literal">
utf8
</code>
when this dictionary is in
use.
</p>
</div>
</li>
<li class="listitem">
<p>
Restart MySQL.
</p>
</li>
<li class="listitem">
<p>
Install the MeCab parser plugin:
</p>
<p>
The MeCab parser plugin is installed using
<a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
<code class="literal">
INSTALL PLUGIN
</code>
</a>
. The plugin
name is
<code class="filename">
mecab
</code>
, and the shared library
name is
<code class="filename">
libpluginmecab.so
</code>
. For
additional information about installing plugins, see
<a class="xref" href="plugin-loading.html" title="7.6.1 Installing and Uninstalling Plugins">
Section 7.6.1, “Installing and Uninstalling Plugins”
</a>
.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa56789476"><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">INSTALL</span> <span class="token keyword">PLUGIN</span> mecab <span class="token keyword">SONAME</span> <span class="token string">'libpluginmecab.so'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Once installed, the MeCab parser plugin loads at every
normal MySQL restart.
</p>
</li>
<li class="listitem">
<p>
Verify that the MeCab parser plugin is loaded using the
<a class="link" href="show-plugins.html" title="15.7.7.27 SHOW PLUGINS Statement">
<code class="literal">
SHOW PLUGINS
</code>
</a>
statement.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa77780615"><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></span> <span class="token keyword">SHOW</span> <span class="token keyword">PLUGINS</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
A
<code class="literal">
mecab
</code>
plugin should appear in the list
of plugins.
</p>
</li>
</ol>
</div>
<h4>
<a name="idm46045201115200">
</a>
Creating a FULLTEXT Index that uses the MeCab Parser
</h4>
<p>
To create a
<code class="literal">
FULLTEXT
</code>
index that uses the
mecab parser, specify
<code class="literal">
WITH PARSER ngram
</code>
with
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
</code>
</a>
,
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
, or
<a class="link" href="create-index.html" title="15.1.15 CREATE INDEX Statement">
<code class="literal">
CREATE INDEX
</code>
</a>
.
</p>
<p>
This example demonstrates creating a table with a
<code class="literal">
mecab
</code>
<code class="literal">
FULLTEXT
</code>
index,
inserting sample data, and viewing tokenized data in the
Information Schema
<a class="link" href="information-schema-innodb-ft-index-cache-table.html" title="28.4.18 The INFORMATION_SCHEMA INNODB_FT_INDEX_CACHE Table">
<code class="literal">
INNODB_FT_INDEX_CACHE
</code>
</a>
table:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa16584081"><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></span> <span class="token keyword">USE</span> test<span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> articles <span class="token punctuation">(</span>
id <span class="token datatype">INT</span> <span class="token keyword">UNSIGNED</span> <span class="token keyword">AUTO_INCREMENT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span><span class="token punctuation">,</span>
title <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">200</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
body <span class="token datatype">TEXT</span><span class="token punctuation">,</span>
<span class="token keyword">FULLTEXT</span> <span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">WITH</span> <span class="token keyword">PARSER</span> mecab
<span class="token punctuation">)</span> <span class="token keyword">ENGINE</span><span class="token operator">=</span>InnoDB <span class="token keyword">CHARACTER</span> <span class="token keyword">SET</span> utf8mb4<span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SET</span> <span class="token keyword">NAMES</span> utf8mb4<span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> articles <span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">VALUES</span>
<span class="token punctuation">(</span><span class="token string">'データベース管理'</span><span class="token punctuation">,</span><span class="token string">'このチュートリアルでは、私はどのようにデータベースを管理する方法を紹介します'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
<span class="token punctuation">(</span><span class="token string">'データベースアプリケーション開発'</span><span class="token punctuation">,</span><span class="token string">'データベースアプリケーションを開発することを学ぶ'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SET</span> <span class="token keyword">GLOBAL</span> innodb_ft_aux_table<span class="token operator">=</span><span class="token string">"test/articles"</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>INNODB_FT_INDEX_CACHE <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> doc_id<span class="token punctuation">,</span> position<span class="token punctuation">;</span></code></pre>
</div>
<p>
To add a
<code class="literal">
FULLTEXT
</code>
index to an existing table,
you can use
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
or
<a class="link" href="create-index.html" title="15.1.15 CREATE INDEX Statement">
<code class="literal">
CREATE INDEX
</code>
</a>
. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa85614482"><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">CREATE</span> <span class="token keyword">TABLE</span> articles <span class="token punctuation">(</span>
id <span class="token datatype">INT</span> <span class="token keyword">UNSIGNED</span> <span class="token keyword">AUTO_INCREMENT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span><span class="token punctuation">,</span>
title <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">200</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
body <span class="token datatype">TEXT</span>
<span class="token punctuation">)</span> <span class="token keyword">ENGINE</span><span class="token operator">=</span>InnoDB <span class="token keyword">CHARACTER</span> <span class="token keyword">SET</span> utf8mb4<span class="token punctuation">;</span>
<span class="token keyword">ALTER</span> <span class="token keyword">TABLE</span> articles <span class="token keyword">ADD</span> <span class="token keyword">FULLTEXT</span> <span class="token keyword">INDEX</span> ft_index <span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">WITH</span> <span class="token keyword">PARSER</span> mecab<span class="token punctuation">;</span>
<span class="token comment" spellcheck="true"># Or:</span>
<span class="token keyword">CREATE</span> <span class="token keyword">FULLTEXT</span> <span class="token keyword">INDEX</span> ft_index <span class="token keyword">ON</span> articles <span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">WITH</span> <span class="token keyword">PARSER</span> mecab<span class="token punctuation">;</span></code></pre>
</div>
<h4>
<a name="idm46045201098160">
</a>
MeCab Parser Space Handling
</h4>
<p>
The MeCab parser uses spaces as separators in query strings. For
example, the MeCab parser tokenizes
<span class="phrase" lang="ja">
データベース管理
</span>
as
<span class="phrase" lang="ja">
データベース
</span>
and
<span class="phrase" lang="ja">
管理
</span>
.
</p>
<h4>
<a name="idm46045201094832">
</a>
MeCab Parser Stopword Handling
</h4>
<p>
By default, the MeCab parser uses the default stopword list,
which contains a short list of English stopwords. For a stopword
list applicable to Japanese, you must create your own. For
information about creating stopword lists, see
<a class="xref" href="fulltext-stopwords.html" title="14.9.4 Full-Text Stopwords">
Section 14.9.4, “Full-Text Stopwords”
</a>
.
</p>
<h4>
<a name="idm46045201092768">
</a>
MeCab Parser Term Search
</h4>
<p>
For natural language mode search, the search term is converted
to a union of tokens. For example,
<span class="phrase" lang="ja">
データベース管理
</span>
is converted
to
<span class="phrase" lang="ja">
データベース 管理
</span>
.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa29048404"><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">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> articles
<span class="token keyword">WHERE</span> <span class="token operator">MATCH</span><span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">AGAINST</span><span class="token punctuation">(</span><span class="token string">'データベース管理'</span> <span class="token keyword">IN</span> <span class="token keyword">NATURAL</span> <span class="token keyword">LANGUAGE</span> <span class="token keyword">MODE</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
For boolean mode search, the search term is converted to a
search phrase. For example,
<span class="phrase" lang="ja">
データベース管理
</span>
is converted
to
<span class="phrase" lang="ja">
データベース 管理
</span>
.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa74483564"><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">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> articles
<span class="token keyword">WHERE</span> <span class="token operator">MATCH</span><span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">AGAINST</span><span class="token punctuation">(</span><span class="token string">'データベース管理'</span> <span class="token keyword">IN</span> <span class="token datatype">BOOLEAN</span> <span class="token keyword">MODE</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<h4>
<a name="idm46045201085872">
</a>
MeCab Parser Wildcard Search
</h4>
<p>
Wildcard search terms are not tokenized. A search on
<span class="phrase" lang="ja">
データベース管理*
</span>
is
performed on the prefix,
<span class="phrase" lang="ja">
データベース管理
</span>
.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa4484606"><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">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> articles
<span class="token keyword">WHERE</span> <span class="token operator">MATCH</span><span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">AGAINST</span><span class="token punctuation">(</span><span class="token string">'データベース*'</span> <span class="token keyword">IN</span> <span class="token datatype">BOOLEAN</span> <span class="token keyword">MODE</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<h4>
<a name="idm46045201082128">
</a>
MeCab Parser Phrase Search
</h4>
<p>
Phrases are tokenized. For example,
<span class="phrase" lang="ja">
データベース管理
</span>
is tokenized
as
<span class="phrase" lang="ja">
データベース 管理
</span>
.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa97886042"><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">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> articles
<span class="token keyword">WHERE</span> <span class="token operator">MATCH</span><span class="token punctuation">(</span>title<span class="token punctuation">,</span>body<span class="token punctuation">)</span> <span class="token keyword">AGAINST</span><span class="token punctuation">(</span><span class="token string">'"データベース管理"'</span> <span class="token keyword">IN</span> <span class="token datatype">BOOLEAN</span> <span class="token keyword">MODE</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<h4>
<a name="install-mecab-binary">
</a>
Installing MeCab From a Binary Distribution (Optional)
</h4>
<p>
This section describes how to install
<code class="filename">
mecab
</code>
and
<code class="filename">
mecab-ipadic
</code>
from a binary distribution
using a native package management utility. For example, on
Fedora, you can use Yum to perform the installation:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa24883745"><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">$> </span><span class="token command">yum</span> mecab-devel</code></pre>
</div>
<p>
On Debian or Ubuntu, you can perform an APT installation:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa91953721"><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">$> </span><span class="token command">apt-get</span> install mecab
<span class="token prompt">$> </span><span class="token command">apt-get</span> install mecab-ipadic</code></pre>
</div>
<h4>
<a name="build-mecab-from-source">
</a>
Installing MeCab From Source (Optional)
</h4>
<p>
If you want to build
<code class="filename">
mecab
</code>
and
<code class="filename">
mecab-ipadic
</code>
from source, basic
installation steps are provided below. For additional
information, refer to the MeCab documentation.
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Download the tar.gz packages for
<code class="filename">
mecab
</code>
and
<code class="filename">
mecab-ipadic
</code>
from
<a class="ulink" href="http://taku910.github.io/mecab/#download" target="_blank">
http://taku910.github.io/mecab/#download
</a>
. As
of February, 2016, the latest available packages are
<code class="filename">
mecab-0.996.tar.gz
</code>
and
<code class="filename">
mecab-ipadic-2.7.0-20070801.tar.gz
</code>
.
</p>
</li>
<li class="listitem">
<p>
Install
<code class="filename">
mecab
</code>
:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa28450425"><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">$> </span><span class="token command">tar</span> zxfv mecab-0<span class="token punctuation">.</span>996<span class="token punctuation">.</span>tar
<span class="token prompt">$> </span><span class="token command">cd</span> mecab-0<span class="token punctuation">.</span>996
<span class="token prompt">$> </span><span class="token command">./configure</span>
<span class="token prompt">$> </span><span class="token command">make</span>
<span class="token prompt">$> </span><span class="token command">make</span> check
<span class="token prompt">$> </span><span class="token command">su</span>
<span class="token prompt">$> </span><span class="token command">make</span> install</code></pre>
</div>
</li>
<li class="listitem">
<p>
Install
<code class="filename">
mecab-ipadic
</code>
:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa97614722"><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">$> </span><span class="token command">tar</span> zxfv mecab-ipadic-2<span class="token punctuation">.</span>7<span class="token punctuation">.</span>0-20070801<span class="token punctuation">.</span>tar
<span class="token prompt">$> </span><span class="token command">cd</span> mecab-ipadic-2<span class="token punctuation">.</span>7<span class="token punctuation">.</span>0-20070801
<span class="token prompt">$> </span><span class="token command">./configure</span>
<span class="token prompt">$> </span><span class="token command">make</span>
<span class="token prompt">$> </span><span class="token command">su</span>
<span class="token prompt">$> </span><span class="token command">make</span> install</code></pre>
</div>
</li>
<li class="listitem">
<p>
Compile MySQL using the
<a class="link" href="source-configuration-options.html#option_cmake_with_mecab">
<code class="option">
WITH_MECAB
</code>
</a>
CMake option. Set
the
<a class="link" href="source-configuration-options.html#option_cmake_with_mecab">
<code class="option">
WITH_MECAB
</code>
</a>
option to
<code class="literal">
system
</code>
if you have installed
<code class="filename">
mecab
</code>
and
<code class="filename">
mecab-ipadic
</code>
to the default location.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa69160808"><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 constant">-DWITH_MECAB</span><span class="token attr-value"><span class="token punctuation">=</span>system</span></code></pre>
</div>
<p>
If you defined a custom installation directory, set
<a class="link" href="source-configuration-options.html#option_cmake_with_mecab">
<code class="option">
WITH_MECAB
</code>
</a>
to the custom
directory. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa53886721"><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 constant">-DWITH_MECAB</span><span class="token attr-value"><span class="token punctuation">=</span>/path/to/mecab</span></code></pre>
</div>
</li>
</ol>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/sys-format-bytes.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="sys-format-bytes">
</a>
30.4.5.3 The format_bytes() Function
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045061019936">
</a>
<a class="indexterm" name="idm46045061018480">
</a>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
<a class="link" href="sys-format-bytes.html" title="30.4.5.3 The format_bytes() Function">
<code class="literal">
format_bytes()
</code>
</a>
is deprecated,
and subject to removal in a future MySQL version.
Applications that use it should be migrated to use the
built-in
<a class="link" href="performance-schema-functions.html#function_format-bytes">
<code class="literal">
FORMAT_BYTES()
</code>
</a>
function instead. See
<a class="xref" href="performance-schema-functions.html" title="14.21 Performance Schema Functions">
Section 14.21, “Performance Schema Functions”
</a>
</p>
</div>
<p>
Given a byte count, converts it to human-readable format and
returns a string consisting of a value and a units indicator.
Depending on the size of the value, the units part is
<code class="literal">
bytes
</code>
,
<code class="literal">
KiB
</code>
(kibibytes),
<code class="literal">
MiB
</code>
(mebibytes),
<code class="literal">
GiB
</code>
(gibibytes),
<code class="literal">
TiB
</code>
(tebibytes), or
<code class="literal">
PiB
</code>
(pebibytes).
</p>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="sys-format-bytes-parameters">
</a>
Parameters
</h5>
</div>
</div>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
bytes TEXT
</code>
: The byte count to format.
</p>
</li>
</ul>
</div>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="sys-format-bytes-return-value">
</a>
Return Value
</h5>
</div>
</div>
</div>
<p>
A
<code class="literal">
TEXT
</code>
value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="sys-format-bytes-example">
</a>
Example
</h5>
</div>
</div>
</div>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa28111559"><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></span> <span class="token keyword">SELECT</span> sys<span class="token punctuation">.</span>format_bytes<span class="token punctuation">(</span><span class="token number">512</span><span class="token punctuation">)</span><span class="token punctuation">,</span> sys<span class="token punctuation">.</span>format_bytes<span class="token punctuation">(</span><span class="token number">18446644073709551615</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> sys.format_bytes(512) <span class="token punctuation">|</span> sys.format_bytes(18446644073709551615) <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>
<span class="token output"><span class="token punctuation">|</span> 512 bytes <span class="token punctuation">|</span> 16383.91 PiB <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></code></pre>
</div>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/replication-features-create-alter-drop-server.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="replication-features-create-alter-drop-server">
</a>
19.5.1.5 Replication of CREATE SERVER, ALTER SERVER, and DROP SERVER
</h4>
</div>
</div>
</div>
<p>
The statements
<a class="link" href="create-server.html" title="15.1.18 CREATE SERVER Statement">
<code class="literal">
CREATE SERVER
</code>
</a>
,
<a class="link" href="alter-server.html" title="15.1.8 ALTER SERVER Statement">
<code class="literal">
ALTER SERVER
</code>
</a>
, and
<a class="link" href="drop-server.html" title="15.1.30 DROP SERVER Statement">
<code class="literal">
DROP SERVER
</code>
</a>
are not written to
the binary log, regardless of the binary logging format that is
in use.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/sys-host-summary-by-statement-type.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="sys-host-summary-by-statement-type">
</a>
30.4.3.6 The host_summary_by_statement_type and x$host_summary_by_statement_type
Views
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045063230960">
</a>
<a class="indexterm" name="idm46045063229504">
</a>
<a class="indexterm" name="idm46045063228000">
</a>
<a class="indexterm" name="idm46045063226496">
</a>
<p>
These views summarize information about statements executed,
grouped by host and statement type. By default, rows are
sorted by host and descending total latency.
</p>
<p>
The
<a class="link" href="sys-host-summary-by-statement-type.html" title="30.4.3.6 The host_summary_by_statement_type and x$host_summary_by_statement_type Views">
<code class="literal">
host_summary_by_statement_type
</code>
</a>
and
<a class="link" href="sys-host-summary-by-statement-type.html" title="30.4.3.6 The host_summary_by_statement_type and x$host_summary_by_statement_type Views">
<code class="literal">
x$host_summary_by_statement_type
</code>
</a>
views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
host
</code>
</p>
<p>
The host from which the client connected. Rows for which
the
<code class="literal">
HOST
</code>
column in the underlying
Performance Schema table is
<code class="literal">
NULL
</code>
are
assumed to be for background threads and are reported with
a host name of
<code class="literal">
background
</code>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
statement
</code>
</p>
<p>
The final component of the statement event name.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
total
</code>
</p>
<p>
The total number of occurrences of the statement event for
the host.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
total_latency
</code>
</p>
<p>
The total wait time of timed occurrences of the statement
event for the host.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
max_latency
</code>
</p>
<p>
The maximum single wait time of timed occurrences of the
statement event for the host.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
lock_latency
</code>
</p>
<p>
The total time waiting for locks by timed occurrences of
the statement event for the host.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
cpu_latency
</code>
</p>
<p>
The time spent on CPU for the current thread.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
rows_sent
</code>
</p>
<p>
The total number of rows returned by occurrences of the
statement event for the host.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
rows_examined
</code>
</p>
<p>
The total number of rows read from storage engines by
occurrences of the statement event for the host.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
rows_affected
</code>
</p>
<p>
The total number of rows affected by occurrences of the
statement event for the host.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
full_scans
</code>
</p>
<p>
The total number of full table scans by occurrences of the
statement event for the host.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/set-password.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="set-password">
</a>
15.7.1.10 SET PASSWORD Statement
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045172989584">
</a>
<a class="indexterm" name="idm46045172988512">
</a>
<a class="indexterm" name="idm46045172987024">
</a>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa58412185"><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">PASSWORD</span> <span class="token punctuation">[</span><span class="token keyword">FOR</span> <span class="token keyword"><em class="replaceable">user</em></span><span class="token punctuation">]</span> <em class="replaceable">auth_option</em>
<span class="token punctuation">[</span><span class="token keyword">REPLACE</span> <span class="token string">'<em class="replaceable">current_auth_string</em>'</span><span class="token punctuation">]</span>
<span class="token punctuation">[</span><span class="token keyword">RETAIN</span> <span class="token keyword">CURRENT</span> <span class="token keyword">PASSWORD</span><span class="token punctuation">]</span>
<em class="replaceable">auth_option</em>: {
<span class="token operator">=</span> <span class="token string">'<em class="replaceable">auth_string</em>'</span>
<span class="token operator">|</span> <span class="token keyword">TO</span> <span class="token keyword">RANDOM</span>
}</code></pre>
</div>
<p>
The
<a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement">
<code class="literal">
SET PASSWORD
</code>
</a>
statement
assigns a password to a MySQL user account. The password may be
either explicitly specified in the statement or randomly
generated by MySQL. The statement may also include a
password-verification clause that specifies the account current
password to be replaced, and a clause that manages whether an
account has a secondary password.
<code class="literal">
'
<em class="replaceable">
<code>
auth_string
</code>
</em>
'
</code>
and
<code class="literal">
'
<em class="replaceable">
<code>
current_auth_string
</code>
</em>
'
</code>
each represent a cleartext (unencrypted) password.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Rather than using
<a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement">
<code class="literal">
SET PASSWORD
</code>
</a>
to assign passwords,
<a class="link" href="alter-user.html" title="15.7.1.1 ALTER USER Statement">
<code class="literal">
ALTER USER
</code>
</a>
is the preferred statement for account alterations, including
assigning passwords. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa49293453"><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">ALTER</span> <span class="token keyword">USER</span> <span class="token keyword"><em class="replaceable">user</em></span> <span class="token keyword">IDENTIFIED</span> <span class="token keyword">BY</span> <span class="token string">'<em class="replaceable">auth_string</em>'</span><span class="token punctuation">;</span></code></pre>
</div>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Clauses for random password generation, password verification,
and secondary passwords apply only to accounts that use an
authentication plugin that stores credentials internally to
MySQL. For accounts that use a plugin that performs
authentication against a credentials system that is external
to MySQL, password management must be handled externally
against that system as well. For more information about
internal credentials storage, see
<a class="xref" href="password-management.html" title="8.2.15 Password Management">
Section 8.2.15, “Password Management”
</a>
.
</p>
</div>
<p>
The
<code class="literal">
REPLACE
'
<em class="replaceable">
<code>
current_auth_string
</code>
</em>
'
</code>
clause performs password verification. If given:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
REPLACE
</code>
specifies the account current
password to be replaced, as a cleartext (unencrypted)
string.
</p>
</li>
<li class="listitem">
<p>
The clause must be given if password changes for the account
are required to specify the current password, as
verification that the user attempting to make the change
actually knows the current password.
</p>
</li>
<li class="listitem">
<p>
The clause is optional if password changes for the account
may but need not specify the current password.
</p>
</li>
<li class="listitem">
<p>
The statement fails if the clause is given but does not
match the current password, even if the clause is optional.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
REPLACE
</code>
can be specified only when
changing the account password for the current user.
</p>
</li>
</ul>
</div>
<p>
For more information about password verification by specifying
the current password, see
<a class="xref" href="password-management.html" title="8.2.15 Password Management">
Section 8.2.15, “Password Management”
</a>
.
</p>
<p>
The
<code class="literal">
RETAIN CURRENT PASSWORD
</code>
clause implements
dual-password capability. If given:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
RETAIN CURRENT PASSWORD
</code>
retains an
account current password as its secondary password,
replacing any existing secondary password. The new password
becomes the primary password, but clients can use the
account to connect to the server using either the primary or
secondary password. (Exception: If the new password
specified by the
<a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement">
<code class="literal">
SET PASSWORD
</code>
</a>
statement is empty, the secondary password becomes empty as
well, even if
<code class="literal">
RETAIN CURRENT PASSWORD
</code>
is
given.)
</p>
</li>
<li class="listitem">
<p>
If you specify
<code class="literal">
RETAIN CURRENT PASSWORD
</code>
for an account that has an empty primary password, the
statement fails.
</p>
</li>
<li class="listitem">
<p>
If an account has a secondary password and you change its
primary password without specifying
<code class="literal">
RETAIN CURRENT
PASSWORD
</code>
, the secondary password remains
unchanged.
</p>
</li>
</ul>
</div>
<p>
For more information about use of dual passwords, see
<a class="xref" href="password-management.html" title="8.2.15 Password Management">
Section 8.2.15, “Password Management”
</a>
.
</p>
<p>
<a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement">
<code class="literal">
SET PASSWORD
</code>
</a>
permits these
<em class="replaceable">
<code>
auth_option
</code>
</em>
syntaxes:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
=
'
<em class="replaceable">
<code>
auth_string
</code>
</em>
'
</code>
</p>
<p>
Assigns the account the given literal password.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
TO RANDOM
</code>
</p>
<p>
Assigns the account a password randomly generated by MySQL.
The statement also returns the cleartext password in a
result set to make it available to the user or application
executing the statement.
</p>
<p>
For details about the result set and characteristics of
randomly generated passwords, see
<a class="xref" href="password-management.html#random-password-generation" title="Random Password Generation">
Random Password Generation
</a>
.
</p>
</li>
</ul>
</div>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
Under some circumstances,
<a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement">
<code class="literal">
SET
PASSWORD
</code>
</a>
may be recorded in server logs or on the
client side in a history file such as
<code class="filename">
~/.mysql_history
</code>
, which means that
cleartext passwords may be read by anyone having read access
to that information. For information about the conditions
under which this occurs for the server logs and how to control
it, see
<a class="xref" href="password-logging.html" title="8.1.2.3 Passwords and Logging">
Section 8.1.2.3, “Passwords and Logging”
</a>
. For similar
information about client-side logging, see
<a class="xref" href="mysql-logging.html" title="6.5.1.3 mysql Client Logging">
Section 6.5.1.3, “mysql Client Logging”
</a>
.
</p>
</div>
<p>
<a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement">
<code class="literal">
SET PASSWORD
</code>
</a>
can be used with or
without a
<code class="literal">
FOR
</code>
clause that explicitly names a
user account:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
With a
<code class="literal">
FOR
<em class="replaceable">
<code>
user
</code>
</em>
</code>
clause, the
statement sets the password for the named account, which
must exist:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa34770843"><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">PASSWORD</span> <span class="token keyword">FOR</span> <span class="token string">'jeffrey'</span>@<span class="token string">'localhost'</span> <span class="token operator">=</span> <span class="token string">'<em class="replaceable">auth_string</em>'</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
With no
<code class="literal">
FOR
<em class="replaceable">
<code>
user
</code>
</em>
</code>
clause, the
statement sets the password for the current user:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa12815858"><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">PASSWORD</span> <span class="token operator">=</span> <span class="token string">'<em class="replaceable">auth_string</em>'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Any client who connects to the server using a nonanonymous
account can change the password for that account. (In
particular, you can change your own password.) To see which
account the server authenticated you as, invoke the
<a class="link" href="information-functions.html#function_current-user">
<code class="literal">
CURRENT_USER()
</code>
</a>
function:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa22076336"><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">SELECT</span> <span class="token function">CURRENT_USER</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
</ul>
</div>
<p>
If a
<code class="literal">
FOR
<em class="replaceable">
<code>
user
</code>
</em>
</code>
clause is given, the account name uses the format described in
<a class="xref" href="account-names.html" title="8.2.4 Specifying Account Names">
Section 8.2.4, “Specifying Account Names”
</a>
. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa31058125"><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">PASSWORD</span> <span class="token keyword">FOR</span> <span class="token string">'bob'</span>@<span class="token string">'%.example.org'</span> <span class="token operator">=</span> <span class="token string">'<em class="replaceable">auth_string</em>'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The host name part of the account name, if omitted, defaults to
<code class="literal">
'%'
</code>
.
</p>
<p>
<a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement">
<code class="literal">
SET PASSWORD
</code>
</a>
interprets the
string as a cleartext string, passes it to the authentication
plugin associated with the account, and stores the result
returned by the plugin in the account row in the
<code class="literal">
mysql.user
</code>
system table. (The plugin is given
the opportunity to hash the value into the encryption format it
expects. The plugin may use the value as specified, in which
case no hashing occurs.)
</p>
<p>
Setting the password for a named account (with a
<code class="literal">
FOR
</code>
clause) requires the
<a class="link" href="privileges-provided.html#priv_update">
<code class="literal">
UPDATE
</code>
</a>
privilege for the
<code class="literal">
mysql
</code>
system schema. Setting the password for
yourself (for a nonanonymous account with no
<code class="literal">
FOR
</code>
clause) requires no special privileges.
</p>
<p>
Statements that modify secondary passwords require these
privileges:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The
<a class="link" href="privileges-provided.html#priv_application-password-admin">
<code class="literal">
APPLICATION_PASSWORD_ADMIN
</code>
</a>
privilege is required to use the
<code class="literal">
RETAIN CURRENT
PASSWORD
</code>
clause for
<a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement">
<code class="literal">
SET
PASSWORD
</code>
</a>
statements that apply to your own
account. The privilege is required to manipulate your own
secondary password because most users require only one
password.
</p>
</li>
<li class="listitem">
<p>
If an account is to be permitted to manipulate secondary
passwords for all accounts, it should be granted the
<a class="link" href="privileges-provided.html#priv_create-user">
<code class="literal">
CREATE USER
</code>
</a>
privilege rather
than
<a class="link" href="privileges-provided.html#priv_application-password-admin">
<code class="literal">
APPLICATION_PASSWORD_ADMIN
</code>
</a>
.
</p>
</li>
</ul>
</div>
<p>
When the
<a class="link" href="server-system-variables.html#sysvar_read_only">
<code class="literal">
read_only
</code>
</a>
system
variable is enabled,
<a class="link" href="set-password.html" title="15.7.1.10 SET PASSWORD Statement">
<code class="literal">
SET PASSWORD
</code>
</a>
requires the
<a class="link" href="privileges-provided.html#priv_connection-admin">
<code class="literal">
CONNECTION_ADMIN
</code>
</a>
privilege (or the deprecated
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege), in addition to
any other required privileges.
</p>
<p>
For additional information about setting passwords and
authentication plugins, see
<a class="xref" href="assigning-passwords.html" title="8.2.14 Assigning Account Passwords">
Section 8.2.14, “Assigning Account Passwords”
</a>
, and
<a class="xref" href="pluggable-authentication.html" title="8.2.17 Pluggable Authentication">
Section 8.2.17, “Pluggable Authentication”
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/group-replication-performance-message-fragmentation.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="group-replication-performance-message-fragmentation">
</a>
20.7.5 Message Fragmentation
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045132126000">
</a>
<p>
When an abnormally large message is sent between Group Replication
group members, it can result in some group members being reported
as failed and expelled from the group. This is because the single
thread used by Group Replication's group communication engine
(XCom, a Paxos variant) is occupied processing the message for too
long, so some of the group members might report the receiver as
failed. By default, large messages are automatically split into
fragments that are sent separately and reassembled by the
recipients.
</p>
<p>
The system variable
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_communication_max_message_size">
<code class="literal">
group_replication_communication_max_message_size
</code>
</a>
specifies a maximum message size for Group Replication
communications, above which messages are fragmented. The default
maximum message size is 10485760 bytes (10 MiB). The greatest
permitted value is the same as the maximum value of the
<a class="link" href="replication-options-replica.html#sysvar_replica_max_allowed_packet">
<code class="literal">
replica_max_allowed_packet
</code>
</a>
system
variable (1 GB).
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_communication_max_message_size">
<code class="literal">
group_replication_communication_max_message_size
</code>
</a>
must be less than
<a class="link" href="replication-options-replica.html#sysvar_replica_max_allowed_packet">
<code class="literal">
replica_max_allowed_packet
</code>
</a>
because the applier thread cannot handle message fragments larger
than the maximum permitted packet size. To switch off
fragmentation, specify a zero value for
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_communication_max_message_size">
<code class="literal">
group_replication_communication_max_message_size
</code>
</a>
.
</p>
<p>
As with most other Group Replication system variables, you must
restart the Group Replication plugin for the change to take
effect. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa3477290"><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">STOP</span> <span class="token keyword">GROUP_REPLICATION</span><span class="token punctuation">;</span>
<span class="token keyword">SET</span> <span class="token keyword">GLOBAL</span> group_replication_communication_max_message_size<span class="token operator">=</span> <span class="token number">5242880</span><span class="token punctuation">;</span>
<span class="token keyword">START</span> <span class="token keyword">GROUP_REPLICATION</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Message delivery for a fragmented message is considered complete
when all the fragments of the message have been received and
reassembled by all the group members. Fragmented messages include
information in their headers that enables a member joining during
message transmission to recover the earlier fragments that were
sent before it joined. If the joining member fails to recover the
fragments, it expels itself from the group.
</p>
<p>
The Group Replication communication protocol version in use by the
group must allow fragmentation. You can obtain the communication
protocol in use by a group using
<a class="link" href="group-replication-functions-for-communication-protocol.html#function_group-replication-get-communication-protocol">
<code class="literal">
group_replication_get_communication_protocol()
</code>
</a>
,
which returns the oldest MySQL Server version that the group
supports. If necessary, use
<a class="link" href="group-replication-functions-for-communication-protocol.html#function_group-replication-set-communication-protocol">
<code class="literal">
group_replication_set_communication_protocol()
</code>
</a>
to set the communication protocol version high enough (8.0.16 or
above) to allow fragmentation. For more information, see
<a class="xref" href="group-replication-communication-protocol.html" title="20.5.1.4 Setting a Group's Communication Protocol Version">
Section 20.5.1.4, “Setting a Group's Communication Protocol Version”
</a>
.
</p>
<p>
If a replication group cannot use fragmentation because some
members do not support it, the system variable
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_transaction_size_limit">
<code class="literal">
group_replication_transaction_size_limit
</code>
</a>
can be used to limit the maximum size of transactions the group
accepts. Transactions above this size are rolled back. You can
also use
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_member_expel_timeout">
<code class="literal">
group_replication_member_expel_timeout
</code>
</a>
to allow additional time (up to an hour) before a member under
suspicion of having failed is expelled from the group.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/selinux-context-tcp-port.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="selinux-context-tcp-port">
</a>
8.7.5 SELinux TCP Port Context
</h3>
</div>
</div>
</div>
<div class="toc">
<dl class="toc">
<dt>
<span class="section">
<a href="selinux-context-mysqld-tcp-port.html">
8.7.5.1 Setting the TCP Port Context for mysqld
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="selinux-context-mysql-feature-ports.html">
8.7.5.2 Setting the TCP Port Context for MySQL Features
</a>
</span>
</dt>
</dl>
</div>
<a class="indexterm" name="idm46045231564176">
</a>
<p>
The instructions that follow use the
<code class="literal">
semanage
</code>
binary to manage port context; on RHEL, it's part of the
<code class="literal">
policycoreutils-python-utils
</code>
package:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa85707004"><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">yum install <span class="token property">-y</span> policycoreutils-python-utils</code></pre>
</div>
<p>
After installing the
<code class="literal">
semanage
</code>
binary, you can
list ports defined with the
<code class="literal">
mysqld_port_t
</code>
context using
<code class="literal">
semanage
</code>
with the
<code class="literal">
port
</code>
option.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa86128358"><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">$> </span><span class="token command">semanage</span> port <span class="token property">-l</span> | grep mysqld
mysqld_port_t tcp 1186<span class="token punctuation">,</span> 3306<span class="token punctuation">,</span> 63132-63164</code></pre>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/data-masking.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="data-masking">
</a>
8.5 MySQL Enterprise Data Masking and De-Identification
</h2>
</div>
</div>
</div>
<div class="toc">
<dl class="toc">
<dt>
<span class="section">
<a href="data-masking-components-vs-plugin.html">
8.5.1 Data-Masking Components Versus the Data-Masking Plugin
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="data-masking-components.html">
8.5.2 MySQL Enterprise Data Masking and De-Identification Components
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="data-masking-plugin.html">
8.5.3 MySQL Enterprise Data Masking and De-Identification Plugin
</a>
</span>
</dt>
</dl>
</div>
<a class="indexterm" name="idm46045233534864">
</a>
<a class="indexterm" name="idm46045233533792">
</a>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
MySQL Enterprise Data Masking and De-Identification is an extension included in MySQL Enterprise Edition, a commercial product.
To learn more about commercial products,
<a class="ulink" href="https://www.mysql.com/products/" target="_blank">
https://www.mysql.com/products/
</a>
.
</p>
</div>
<p>
MySQL Enterprise Edition provides data masking and de-identification capabilities:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Transformation of existing data to mask it and remove
identifying characteristics, such as changing all digits of a
credit card number but the last four to
<code class="literal">
'X'
</code>
characters.
</p>
</li>
<li class="listitem">
<p>
Generation of random data, such as email addresses and payment
card numbers.
</p>
</li>
<li class="listitem">
<p>
Substitution of data by data from dictionaries stored in the
database. The dictionaries are easily replicated in a standard
way. Administration is restricted to authorized users who are
granted special privileges so that only they can create and
modify the dictionaries.
</p>
</li>
</ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
MySQL Enterprise Data Masking and De-Identification was implemented originally in MySQL as a plugin library.
As of MySQL 8.4, MySQL Enterprise Edition also provides components to
access data masking and de-identification capabilities. For
information about the similarities and differences, see
<a class="xref" href="data-masking-components-vs-plugin.html#data-masking-component-vs-plugin" title="Table 8.45 Comparison Between Data-Masking Components and Plugin Elements">
Table 8.45, “Comparison Between Data-Masking Components and Plugin Elements”
</a>
.
</p>
<p>
If you are using MySQL Enterprise Data Masking and De-Identification for the first time, consider installing
the components for access to the ongoing enhancements only
available with component infrastructure.
</p>
</div>
<p>
The way that applications use these capabilities depends on the
purpose for which the data is used and who accesses it:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Applications that use sensitive data may protect it by
performing data masking and permitting use of partially masked
data for client identification. Example: A call center may ask
for clients to provide their last four Social Security Number
digits.
</p>
</li>
<li class="listitem">
<p>
Applications that require properly formatted data, but not
necessarily the original data, can synthesize sample data.
Example: An application developer who is testing data validators
but has no access to original data may synthesize random data
with the same format.
</p>
</li>
<li class="listitem">
<p>
Applications that must substitute a real name with a dictionary
term to protect to protect sensitive information, but still
provide realistic content to application users. Example: A user
in training who is restricted from viewing addresses gets a
random term from dictionary
<code class="literal">
city names
</code>
instead of the real city name. A variant of this scenario may be
that the real city name is replaced only if it exists in
<code class="literal">
usa_city_names
</code>
.
</p>
</li>
</ul>
</div>
<p>
Example 1:
</p>
<p>
Medical research facilities can hold patient data that comprises a
mix of personal and medical data. This may include genetic sequences
(long strings), test results stored in JSON format, and other data
types. Although the data may be used mostly by automated analysis
software, access to genome data or test results of particular
patients is still possible. In such cases, data masking should be
used to render this information not personally identifiable.
</p>
<p>
Example 2:
</p>
<p>
A credit card processor company provides a set of services using
sensitive data, such as:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Processing a large number of financial transactions per second.
</p>
</li>
<li class="listitem">
<p>
Storing a large amount of transaction-related data.
</p>
</li>
<li class="listitem">
<p>
Protecting transaction-related data with strict requirements for
personal data.
</p>
</li>
<li class="listitem">
<p>
Handling client complaints about transactions using reversible
or partially masked data.
</p>
</li>
</ul>
</div>
<p>
A typical transaction may include many types of sensitive
information, including:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Credit card number.
</p>
</li>
<li class="listitem">
<p>
Transaction type and amount.
</p>
</li>
<li class="listitem">
<p>
Merchant type.
</p>
</li>
<li class="listitem">
<p>
Transaction cryptogram (to confirm transaction legitimacy).
</p>
</li>
<li class="listitem">
<p>
Geolocation of GPS-equipped terminal (for fraud detection).
</p>
</li>
</ul>
</div>
<p>
Those types of information may then be joined within a bank or other
card-issuing financial institution with client personal data, such
as:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Full client name (either person or company).
</p>
</li>
<li class="listitem">
<p>
Address.
</p>
</li>
<li class="listitem">
<p>
Date of birth.
</p>
</li>
<li class="listitem">
<p>
Social Security number.
</p>
</li>
<li class="listitem">
<p>
Email address.
</p>
</li>
<li class="listitem">
<p>
Phone number.
</p>
</li>
</ul>
</div>
<p>
Various employee roles within both the card processing company and
the financial institution require access to that data. Some of these
roles may require access only to masked data. Other roles may
require access to the original data on a case-to-case basis, which
is recorded in audit logs.
</p>
<p>
Masking and de-identification are core to regulatory compliance, so
MySQL Enterprise Data Masking and De-Identification can help application developers satisfy privacy
requirements:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
PCI – DSS: Payment Card Data.
</p>
</li>
<li class="listitem">
<p>
HIPAA: Privacy of Health Data, Health Information Technology for
Economic and Clinical Health Act (HITECH Act).
</p>
</li>
<li class="listitem">
<p>
EU General Data Protection Directive (GDPR): Protection of
Personal Data.
</p>
</li>
<li class="listitem">
<p>
Data Protection Act (UK): Protection of Personal Data.
</p>
</li>
<li class="listitem">
<p>
Sarbanes Oxley, GLBA, The USA Patriot Act, Identity Theft and
Assumption Deterrence Act of 1998.
</p>
</li>
<li class="listitem">
<p>
FERPA – Student Data, NASD, CA SB1386 and AB 1950, State Data
Protection Laws, Basel II.
</p>
</li>
</ul>
</div>
<p>
The following sections describe the elements of MySQL Enterprise Data Masking and De-Identification, discuss
how to install and use it, and provide reference information for its
elements.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/mysqldump-copying-to-other-server.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="mysqldump-copying-to-other-server">
</a>
9.4.5.2 Copy a Database from one Server to Another
</h4>
</div>
</div>
</div>
<p>
On Server 1:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa32281046"><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">$> </span><span class="token command">mysqldump</span> <span class="token property">--databases</span> db1 > dump<span class="token punctuation">.</span>sql</code></pre>
</div>
<p>
Copy the dump file from Server 1 to Server 2.
</p>
<p>
On Server 2:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa68841935"><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">$> </span><span class="token command">mysql</span> < dump<span class="token punctuation">.</span>sql</code></pre>
</div>
<p>
Use of
<a class="link" href="mysqldump.html#option_mysqldump_databases">
<code class="option">
--databases
</code>
</a>
with the
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
command line causes the dump file
to include
<a class="link" href="create-database.html" title="15.1.12 CREATE DATABASE Statement">
<code class="literal">
CREATE DATABASE
</code>
</a>
and
<a class="link" href="use.html" title="15.8.4 USE Statement">
<code class="literal">
USE
</code>
</a>
statements that create the
database if it does exist and make it the default database for
the reloaded data.
</p>
<p>
Alternatively, you can omit
<a class="link" href="mysqldump.html#option_mysqldump_databases">
<code class="option">
--databases
</code>
</a>
from the
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
command. Then you need to create
the database on Server 2 (if necessary) and specify it as the
default database when you reload the dump file.
</p>
<p>
On Server 1:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa94456459"><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">$> </span><span class="token command">mysqldump</span> db1 > dump<span class="token punctuation">.</span>sql</code></pre>
</div>
<p>
On Server 2:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa53504691"><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">$> </span><span class="token command">mysqladmin</span> create db1
<span class="token prompt">$> </span><span class="token command">mysql</span> db1 < dump<span class="token punctuation">.</span>sql</code></pre>
</div>
<p>
You can specify a different database name in this case, so
omitting
<a class="link" href="mysqldump.html#option_mysqldump_databases">
<code class="option">
--databases
</code>
</a>
from
the
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
command enables you to dump
data from one database and load it into another.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/information-schema-innodb-cmpmem-table.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="information-schema-innodb-cmpmem-table">
</a>
28.4.7 The INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET Tables
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045077254480">
</a>
<a class="indexterm" name="idm46045077253024">
</a>
<p>
The
<a class="link" href="information-schema-innodb-cmpmem-table.html" title="28.4.7 The INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET Tables">
<code class="literal">
INNODB_CMPMEM
</code>
</a>
and
<a class="link" href="information-schema-innodb-cmpmem-table.html" title="28.4.7 The INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET Tables">
<code class="literal">
INNODB_CMPMEM_RESET
</code>
</a>
tables provide
status information on compressed
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
within the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">
buffer
pool
</a>
.
</p>
<p>
The
<a class="link" href="information-schema-innodb-cmpmem-table.html" title="28.4.7 The INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET Tables">
<code class="literal">
INNODB_CMPMEM
</code>
</a>
and
<a class="link" href="information-schema-innodb-cmpmem-table.html" title="28.4.7 The INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET Tables">
<code class="literal">
INNODB_CMPMEM_RESET
</code>
</a>
tables have these
columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
PAGE_SIZE
</code>
</p>
<p>
The block size in bytes. Each record of this table describes
blocks of this size.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
BUFFER_POOL_INSTANCE
</code>
</p>
<p>
A unique identifier for the buffer pool instance.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PAGES_USED
</code>
</p>
<p>
The number of blocks of size
<code class="literal">
PAGE_SIZE
</code>
that
are currently in use.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PAGES_FREE
</code>
</p>
<p>
The number of blocks of size
<code class="literal">
PAGE_SIZE
</code>
that
are currently available for allocation. This column shows the
external fragmentation in the memory pool. Ideally, these
numbers should be at most 1.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
RELOCATION_OPS
</code>
</p>
<p>
The number of times a block of size
<code class="literal">
PAGE_SIZE
</code>
has been relocated. The buddy
system can relocate the allocated
<span class="quote">
“
<span class="quote">
buddy
neighbor
</span>
”
</span>
of a freed block when it tries to form a
bigger freed block. Reading from the
<a class="link" href="information-schema-innodb-cmpmem-table.html" title="28.4.7 The INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET Tables">
<code class="literal">
INNODB_CMPMEM_RESET
</code>
</a>
table resets
this count.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
RELOCATION_TIME
</code>
</p>
<p>
The total time in microseconds used for relocating blocks of
size
<code class="literal">
PAGE_SIZE
</code>
. Reading from the table
<code class="literal">
INNODB_CMPMEM_RESET
</code>
resets this count.
</p>
</li>
</ul>
</div>
<h4>
<a name="idm46045077225536">
</a>
Example
</h4>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa38165910"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>INNODB_CMPMEM\G
<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> 1. row <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>
page_size<span class="token punctuation">:</span> 1024
buffer_pool_instance<span class="token punctuation">:</span> 0
pages_used<span class="token punctuation">:</span> 0
pages_free<span class="token punctuation">:</span> 0
relocation_ops<span class="token punctuation">:</span> 0
relocation_time<span class="token punctuation">:</span> 0
<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> 2. row <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>
page_size<span class="token punctuation">:</span> 2048
buffer_pool_instance<span class="token punctuation">:</span> 0
pages_used<span class="token punctuation">:</span> 0
pages_free<span class="token punctuation">:</span> 0
relocation_ops<span class="token punctuation">:</span> 0
relocation_time<span class="token punctuation">:</span> 0
<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> 3. row <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>
page_size<span class="token punctuation">:</span> 4096
buffer_pool_instance<span class="token punctuation">:</span> 0
pages_used<span class="token punctuation">:</span> 0
pages_free<span class="token punctuation">:</span> 0
relocation_ops<span class="token punctuation">:</span> 0
relocation_time<span class="token punctuation">:</span> 0
<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> 4. row <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>
page_size<span class="token punctuation">:</span> 8192
buffer_pool_instance<span class="token punctuation">:</span> 0
pages_used<span class="token punctuation">:</span> 7673
pages_free<span class="token punctuation">:</span> 15
relocation_ops<span class="token punctuation">:</span> 4638
relocation_time<span class="token punctuation">:</span> 0
<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> 5. row <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>
page_size<span class="token punctuation">:</span> 16384
buffer_pool_instance<span class="token punctuation">:</span> 0
pages_used<span class="token punctuation">:</span> 0
pages_free<span class="token punctuation">:</span> 0
relocation_ops<span class="token punctuation">:</span> 0
relocation_time<span class="token punctuation">:</span> 0</span></code></pre>
</div>
<h4>
<a name="idm46045077222128">
</a>
Notes
</h4>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Use these tables to measure the effectiveness of
<code class="literal">
InnoDB
</code>
table
<a class="link" href="glossary.html#glos_compression" title="compression">
compression
</a>
in your
database.
</p>
</li>
<li class="listitem">
<p>
You must have the
<a class="link" href="privileges-provided.html#priv_process">
<code class="literal">
PROCESS
</code>
</a>
privilege to query this table.
</p>
</li>
<li class="listitem">
<p>
Use the
<code class="literal">
INFORMATION_SCHEMA
</code>
<a class="link" href="information-schema-columns-table.html" title="28.3.8 The INFORMATION_SCHEMA COLUMNS Table">
<code class="literal">
COLUMNS
</code>
</a>
table or the
<a class="link" href="show-columns.html" title="15.7.7.6 SHOW COLUMNS Statement">
<code class="literal">
SHOW COLUMNS
</code>
</a>
statement to view
additional information about the columns of this table,
including data types and default values.
</p>
</li>
<li class="listitem">
<p>
For usage information, see
<a class="xref" href="innodb-compression-tuning-monitoring.html" title="17.9.1.4 Monitoring InnoDB Table Compression at Runtime">
Section 17.9.1.4, “Monitoring InnoDB Table Compression at Runtime”
</a>
and
<a class="xref" href="innodb-information-schema-examples-compression-sect.html" title="17.15.1.3 Using the Compression Information Schema Tables">
Section 17.15.1.3, “Using the Compression Information Schema Tables”
</a>
.
For general information about
<code class="literal">
InnoDB
</code>
table
compression, see
<a class="xref" href="innodb-compression.html" title="17.9 InnoDB Table and Page Compression">
Section 17.9, “InnoDB Table and Page Compression”
</a>
.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/mrr-optimization.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="mrr-optimization">
</a>
10.2.1.11 Multi-Range Read Optimization
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045229324672">
</a>
<a class="indexterm" name="idm46045229323216">
</a>
<p>
Reading rows using a range scan on a secondary index can
result in many random disk accesses to the base table when the
table is large and not stored in the storage engine's
cache. With the Disk-Sweep Multi-Range Read (MRR)
optimization, MySQL tries to reduce the number of random disk
access for range scans by first scanning the index only and
collecting the keys for the relevant rows. Then the keys are
sorted and finally the rows are retrieved from the base table
using the order of the primary key. The motivation for
Disk-sweep MRR is to reduce the number of random disk accesses
and instead achieve a more sequential scan of the base table
data.
</p>
<p>
The Multi-Range Read optimization provides these benefits:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
MRR enables data rows to be accessed sequentially rather
than in random order, based on index tuples. The server
obtains a set of index tuples that satisfy the query
conditions, sorts them according to data row ID order, and
uses the sorted tuples to retrieve data rows in order.
This makes data access more efficient and less expensive.
</p>
</li>
<li class="listitem">
<p>
MRR enables batch processing of requests for key access
for operations that require access to data rows through
index tuples, such as range index scans and equi-joins
that use an index for the join attribute. MRR iterates
over a sequence of index ranges to obtain qualifying index
tuples. As these results accumulate, they are used to
access the corresponding data rows. It is not necessary to
acquire all index tuples before starting to read data
rows.
</p>
</li>
</ul>
</div>
<p>
The MRR optimization is not supported with secondary indexes
created on virtual generated columns.
<code class="literal">
InnoDB
</code>
supports secondary indexes on
virtual generated columns.
</p>
<p>
The following scenarios illustrate when MRR optimization can
be advantageous:
</p>
<p>
Scenario A: MRR can be used for
<code class="literal">
InnoDB
</code>
and
<code class="literal">
MyISAM
</code>
tables for index range scans and
equi-join operations.
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
A portion of the index tuples are accumulated in a buffer.
</p>
</li>
<li class="listitem">
<p>
The tuples in the buffer are sorted by their data row ID.
</p>
</li>
<li class="listitem">
<p>
Data rows are accessed according to the sorted index tuple
sequence.
</p>
</li>
</ol>
</div>
<p>
Scenario B: MRR can be used for
<a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
<code class="literal">
NDB
</code>
</a>
tables for multiple-range
index scans or when performing an equi-join by an attribute.
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
A portion of ranges, possibly single-key ranges, is
accumulated in a buffer on the central node where the
query is submitted.
</p>
</li>
<li class="listitem">
<p>
The ranges are sent to the execution nodes that access
data rows.
</p>
</li>
<li class="listitem">
<p>
The accessed rows are packed into packages and sent back
to the central node.
</p>
</li>
<li class="listitem">
<p>
The received packages with data rows are placed in a
buffer.
</p>
</li>
<li class="listitem">
<p>
Data rows are read from the buffer.
</p>
</li>
</ol>
</div>
<p>
When MRR is used, the
<code class="literal">
Extra
</code>
column in
<a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
<code class="literal">
EXPLAIN
</code>
</a>
output shows
<code class="literal">
Using MRR
</code>
.
</p>
<p>
<code class="literal">
InnoDB
</code>
and
<code class="literal">
MyISAM
</code>
do not
use MRR if full table rows need not be accessed to produce the
query result. This is the case if results can be produced
entirely on the basis on information in the index tuples
(through a
<a class="link" href="glossary.html#glos_covering_index" title="covering index">
covering
index
</a>
); MRR provides no benefit.
</p>
<p>
Two
<a class="link" href="server-system-variables.html#sysvar_optimizer_switch">
<code class="literal">
optimizer_switch
</code>
</a>
system
variable flags provide an interface to the use of MRR
optimization. The
<a class="link" href="switchable-optimizations.html#optflag_mrr">
<code class="literal">
mrr
</code>
</a>
flag
controls whether MRR is enabled. If
<a class="link" href="switchable-optimizations.html#optflag_mrr">
<code class="literal">
mrr
</code>
</a>
is enabled
(
<code class="literal">
on
</code>
), the
<a class="link" href="switchable-optimizations.html#optflag_mrr-cost-based">
<code class="literal">
mrr_cost_based
</code>
</a>
flag controls
whether the optimizer attempts to make a cost-based choice
between using and not using MRR (
<code class="literal">
on
</code>
) or
uses MRR whenever possible (
<code class="literal">
off
</code>
). By
default,
<a class="link" href="switchable-optimizations.html#optflag_mrr">
<code class="literal">
mrr
</code>
</a>
is
<code class="literal">
on
</code>
and
<a class="link" href="switchable-optimizations.html#optflag_mrr-cost-based">
<code class="literal">
mrr_cost_based
</code>
</a>
is
<code class="literal">
on
</code>
. See
<a class="xref" href="switchable-optimizations.html" title="10.9.2 Switchable Optimizations">
Section 10.9.2, “Switchable Optimizations”
</a>
.
</p>
<p>
For MRR, a storage engine uses the value of the
<a class="link" href="server-system-variables.html#sysvar_read_rnd_buffer_size">
<code class="literal">
read_rnd_buffer_size
</code>
</a>
system
variable as a guideline for how much memory it can allocate
for its buffer. The engine uses up to
<a class="link" href="server-system-variables.html#sysvar_read_rnd_buffer_size">
<code class="literal">
read_rnd_buffer_size
</code>
</a>
bytes
and determines the number of ranges to process in a single
pass.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/sys-user-summary-by-statement-type.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="sys-user-summary-by-statement-type">
</a>
30.4.3.46 The user_summary_by_statement_type and x$user_summary_by_statement_type
Views
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045061843680">
</a>
<a class="indexterm" name="idm46045061842224">
</a>
<a class="indexterm" name="idm46045061840720">
</a>
<a class="indexterm" name="idm46045061839216">
</a>
<p>
These views summarize information about statements executed,
grouped by user and statement type. By default, rows are
sorted by user and descending total latency.
</p>
<p>
The
<a class="link" href="sys-user-summary-by-statement-type.html" title="30.4.3.46 The user_summary_by_statement_type and x$user_summary_by_statement_type Views">
<code class="literal">
user_summary_by_statement_type
</code>
</a>
and
<a class="link" href="sys-user-summary-by-statement-type.html" title="30.4.3.46 The user_summary_by_statement_type and x$user_summary_by_statement_type Views">
<code class="literal">
x$user_summary_by_statement_type
</code>
</a>
views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
user
</code>
</p>
<p>
The client user name. Rows for which the
<code class="literal">
USER
</code>
column in the underlying
Performance Schema table is
<code class="literal">
NULL
</code>
are
assumed to be for background threads and are reported with
a host name of
<code class="literal">
background
</code>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
statement
</code>
</p>
<p>
The final component of the statement event name.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
total
</code>
</p>
<p>
The total number of occurrences of the statement event for
the user.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
total_latency
</code>
</p>
<p>
The total wait time of timed occurrences of the statement
event for the user.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
max_latency
</code>
</p>
<p>
The maximum single wait time of timed occurrences of the
statement event for the user.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
lock_latency
</code>
</p>
<p>
The total time waiting for locks by timed occurrences of
the statement event for the user.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
cpu_latency
</code>
</p>
<p>
The time spent on CPU for the current thread.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
rows_sent
</code>
</p>
<p>
The total number of rows returned by occurrences of the
statement event for the user.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
rows_examined
</code>
</p>
<p>
The total number of rows read from storage engines by
occurrences of the statement event for the user.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
rows_affected
</code>
</p>
<p>
The total number of rows affected by occurrences of the
statement event for the user.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
full_scans
</code>
</p>
<p>
The total number of full table scans by occurrences of the
statement event for the user.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/innodb-moving-data-files-offline.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="innodb-moving-data-files-offline">
</a>
17.6.3.6 Moving Tablespace Files While the Server is Offline
</h4>
</div>
</div>
</div>
<p>
The
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
variable,
which defines directories to scan at startup for tablespace files,
supports moving or restoring tablespace files to a new location
while the server is offline. During startup, discovered tablespace
files are used instead those referenced in the data dictionary,
and the data dictionary is updated to reference the relocated
files. If duplicate tablespace files are discovered by the scan,
startup fails with an error indicating that multiple files were
found for the same tablespace ID.
</p>
<p>
The directories defined by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_home_dir">
<code class="literal">
innodb_data_home_dir
</code>
</a>
,
<a class="link" href="innodb-parameters.html#sysvar_innodb_undo_directory">
<code class="literal">
innodb_undo_directory
</code>
</a>
, and
<a class="link" href="server-system-variables.html#sysvar_datadir">
<code class="literal">
datadir
</code>
</a>
variables are
automatically appended to the
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
argument
value. These directories are scanned at startup regardless of
whether an
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
setting is specified explicitly. The implicit addition of these
directories permits moving system tablespace files, the data
directory, or undo tablespace files without configuring the
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
setting.
However, settings must be updated when directories change. For
example, after relocating the data directory, you must update the
<a class="link" href="server-system-variables.html#sysvar_datadir">
<code class="literal">
--datadir
</code>
</a>
setting before
restarting the server.
</p>
<p>
The
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
variable
can be specified in a startup command or MySQL option file. Quotes
are used around the argument value because a semicolon (;) is
interpreted as a special character by some command interpreters.
(Unix shells treat it as a command terminator, for example.)
</p>
<p>
Startup command:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa31270760"><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">--innodb-directories</span>=<span class="token atrule">"<em class="replaceable">directory_path_1</em>;<em class="replaceable">directory_path_2</em>"</span></code></pre>
</div>
<p>
MySQL option file:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-ini"><div class="docs-select-all right" id="sa26245907"><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">innodb_directories</span><span class="token attr-value"><span class="token punctuation">=</span>"<em class="replaceable">directory_path_1</em>;<em class="replaceable">directory_path_2</em>"</span></code></pre>
</div>
<p>
The following procedure is applicable to moving individual
<a class="link" href="glossary.html#glos_file_per_table" title="file-per-table">
file-per-table
</a>
and
<a class="link" href="glossary.html#glos_general_tablespace" title="general tablespace">
general tablespace
</a>
files,
<a class="link" href="glossary.html#glos_system_tablespace" title="system tablespace">
system
tablespace
</a>
files,
<a class="link" href="glossary.html#glos_undo_tablespace" title="undo tablespace">
undo
tablespace
</a>
files, or the data directory. Before moving
files or directories, review the usage notes that follow.
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Stop the server.
</p>
</li>
<li class="listitem">
<p>
Move the tablespace files or directories to the desired
location.
</p>
</li>
<li class="listitem">
<p>
Make the new directory known to
<code class="literal">
InnoDB
</code>
.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
If moving individual
<a class="link" href="glossary.html#glos_file_per_table" title="file-per-table">
file-per-table
</a>
or
<a class="link" href="glossary.html#glos_general_tablespace" title="general tablespace">
general
tablespace
</a>
files, add unknown directories to the
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
value.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
The directories defined by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_home_dir">
<code class="literal">
innodb_data_home_dir
</code>
</a>
,
<a class="link" href="innodb-parameters.html#sysvar_innodb_undo_directory">
<code class="literal">
innodb_undo_directory
</code>
</a>
,
and
<a class="link" href="server-system-variables.html#sysvar_datadir">
<code class="literal">
datadir
</code>
</a>
variables
are automatically appended to the
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
argument value, so you need not specify these.
</p>
</li>
<li class="listitem">
<p>
A file-per-table tablespace file can only be moved to
a directory with same name as the schema. For example,
if the
<code class="literal">
actor
</code>
table belongs to the
<code class="literal">
sakila
</code>
schema, then the
<code class="filename">
actor.ibd
</code>
data file can only be
moved to a directory named
<code class="filename">
sakila
</code>
.
</p>
</li>
<li class="listitem">
<p>
General tablespace files cannot be moved to the data
directory or a subdirectory of the data directory.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
If moving system tablespace files, undo tablespaces, or
the data directory, update the
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_home_dir">
<code class="literal">
innodb_data_home_dir
</code>
</a>
,
<a class="link" href="innodb-parameters.html#sysvar_innodb_undo_directory">
<code class="literal">
innodb_undo_directory
</code>
</a>
,
and
<a class="link" href="server-system-variables.html#sysvar_datadir">
<code class="literal">
datadir
</code>
</a>
settings, as
necessary.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
Restart the server.
</p>
</li>
</ol>
</div>
<h5>
<a name="idm46045165033760">
</a>
Usage Notes
</h5>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Wildcard expressions cannot be used in the
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
argument
value.
</p>
</li>
<li class="listitem">
<p>
The
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
scan
also traverses subdirectories of specified directories.
Duplicate directories and subdirectories are discarded from
the list of directories to be scanned.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
supports
moving
<code class="literal">
InnoDB
</code>
tablespace files. Moving
files that belong to a storage engine other than
<code class="literal">
InnoDB
</code>
is not supported. This restriction
also applies when moving the entire data directory.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
supports
renaming of tablespace files when moving files to a scanned
directory. It also supports moving tablespaces files to other
supported operating systems.
</p>
</li>
<li class="listitem">
<p>
When moving tablespace files to a different operating system,
ensure that tablespace file names do not include prohibited
characters or characters with a special meaning on the
destination system.
</p>
</li>
<li class="listitem">
<p>
When moving a data directory from a Windows operating system
to a Linux operating system, modify the binary log file paths
in the binary log index file to use backward slashes instead
of forward slashes. By default, the binary log index file has
the same base name as the binary log file, with the extension
'
<code class="filename">
.index
</code>
'. The location of the binary log
index file is defined by
<a class="link" href="replication-options-binary-log.html#option_mysqld_log-bin">
<code class="option">
--log-bin
</code>
</a>
. The default location
is the data directory.
</p>
</li>
<li class="listitem">
<p>
If moving tablespace files to a different operating system
introduces cross-platform replication, it is the database
administrator's responsibility to ensure proper replication of
DDL statements that contain platform-specific directories.
Statements that permit specifying directories include
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE ...
DATA DIRECTORY
</code>
</a>
and
<a class="link" href="create-tablespace.html" title="15.1.21 CREATE TABLESPACE Statement">
<code class="literal">
CREATE
TABLESPACE ... ADD DATAFILE
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
Add the directories of file-per-table and general tablespaces
created with an absolute path or in a location outside of the
data directory to the
<a class="link" href="innodb-parameters.html#sysvar_innodb_directories">
<code class="literal">
innodb_directories
</code>
</a>
setting.
Otherwise,
<code class="literal">
InnoDB
</code>
is not able to locate the
files during recovery. For related information, see
<a class="xref" href="innodb-recovery.html#innodb-recovery-tablespace-discovery" title="Tablespace Discovery During Crash Recovery">
Tablespace Discovery During Crash Recovery
</a>
.
</p>
<p>
To view tablespace file locations, query the Information
Schema
<a class="link" href="information-schema-files-table.html" title="28.3.15 The INFORMATION_SCHEMA FILES Table">
<code class="literal">
FILES
</code>
</a>
table:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa98761713"><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></span> <span class="token keyword">SELECT</span> TABLESPACE_NAME<span class="token punctuation">,</span> FILE_NAME <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>FILES \G</code></pre>
</div>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/boolean-literals.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="boolean-literals">
</a>
11.1.6 Boolean Literals
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045220111536">
</a>
<a class="indexterm" name="idm46045220110048">
</a>
<a class="indexterm" name="idm46045220108976">
</a>
<a class="indexterm" name="idm46045220107904">
</a>
<p>
The constants
<code class="literal">
TRUE
</code>
and
<code class="literal">
FALSE
</code>
evaluate to
<code class="literal">
1
</code>
and
<code class="literal">
0
</code>
, respectively. The constant names can be
written in any lettercase.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa84673102"><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></span> <span class="token keyword">SELECT</span> <span class="token boolean">TRUE</span><span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token boolean">FALSE</span><span class="token punctuation">,</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
<span class="token prompt"> -></span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span></code></pre>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-ndbinfo-memory-per-fragment.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="mysql-cluster-ndbinfo-memory-per-fragment">
</a>
25.6.17.47 The ndbinfo memory_per_fragment Table
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045088840496">
</a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#mysql-cluster-ndbinfo-memory-per-fragment-notes" title="memory_per_fragment Table: Notes">
memory_per_fragment Table: Notes
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#mysql-cluster-ndbinfo-memory-per-fragment-examples" title="memory_per_fragment Table: Examples">
memory_per_fragment Table: Examples
</a>
</p>
</li>
</ul>
</div>
<p>
The
<code class="literal">
memory_per_fragment
</code>
table provides
information about the usage of memory by individual fragments.
See the
<a class="link" href="mysql-cluster-ndbinfo-memory-per-fragment.html#mysql-cluster-ndbinfo-memory-per-fragment-notes" title="memory_per_fragment Table: Notes">
Notes
</a>
later in this section to see how you can use this to find out
how much memory is used by
<code class="literal">
NDB
</code>
tables.
</p>
<p>
The
<code class="literal">
memory_per_fragment
</code>
table contains the
following columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
fq_name
</code>
</p>
<p>
Name of this fragment
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
parent_fq_name
</code>
</p>
<p>
Name of this fragment's parent
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
type
</code>
</p>
<p>
Dictionary object type
(
<a class="ulink" href="/doc/ndbapi/en/ndb-object.html#ndb-object-type" target="_top">
<code class="literal">
Object::Type
</code>
</a>
, in the NDB
API) used for this fragment; one of
<code class="literal">
System
table
</code>
,
<code class="literal">
User table
</code>
,
<code class="literal">
Unique hash index
</code>
,
<code class="literal">
Hash
index
</code>
,
<code class="literal">
Unique ordered index
</code>
,
<code class="literal">
Ordered index
</code>
,
<code class="literal">
Hash index
trigger
</code>
,
<code class="literal">
Subscription trigger
</code>
,
<code class="literal">
Read only constraint
</code>
,
<code class="literal">
Index
trigger
</code>
,
<code class="literal">
Reorganize trigger
</code>
,
<code class="literal">
Tablespace
</code>
,
<code class="literal">
Log file
group
</code>
,
<code class="literal">
Data file
</code>
,
<code class="literal">
Undo
file
</code>
,
<code class="literal">
Hash map
</code>
,
<code class="literal">
Foreign key definition
</code>
,
<code class="literal">
Foreign
key parent trigger
</code>
,
<code class="literal">
Foreign key child
trigger
</code>
, or
<code class="literal">
Schema transaction
</code>
.
</p>
<p>
You can also obtain this list by executing
<a class="link" href="table.html" title="15.2.16 TABLE Statement">
<code class="literal">
TABLE
</code>
</a>
<a class="link" href="mysql-cluster-ndbinfo-dict-obj-types.html" title="25.6.17.27 The ndbinfo dict_obj_types Table">
<code class="literal">
ndbinfo.dict_obj_types
</code>
</a>
in
the
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
client.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
table_id
</code>
</p>
<p>
Table ID for this table
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
node_id
</code>
</p>
<p>
Node ID for this node
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
block_instance
</code>
</p>
<p>
NDB kernel block instance ID; you can use this number to
obtain information about specific threads from the
<a class="link" href="mysql-cluster-ndbinfo-threadblocks.html" title="25.6.17.62 The ndbinfo threadblocks Table">
<code class="literal">
threadblocks
</code>
</a>
table.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
fragment_num
</code>
</p>
<p>
Fragment ID (number)
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
fixed_elem_alloc_bytes
</code>
</p>
<p>
Number of bytes allocated for fixed-sized elements
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
fixed_elem_free_bytes
</code>
</p>
<p>
Free bytes remaining in pages allocated to fixed-size
elements
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
fixed_elem_size_bytes
</code>
</p>
<p>
Length of each fixed-size element in bytes
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
fixed_elem_count
</code>
</p>
<p>
Number of fixed-size elements
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
fixed_elem_free_count
</code>
</p>
<p>
Number of free rows for fixed-size elements
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
var_elem_alloc_bytes
</code>
</p>
<p>
Number of bytes allocated for variable-size elements
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
var_elem_free_bytes
</code>
</p>
<p>
Free bytes remaining in pages allocated to variable-size
elements
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
var_elem_count
</code>
</p>
<p>
Number of variable-size elements
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
hash_index_alloc_bytes
</code>
</p>
<p>
Number of bytes allocated to hash indexes
</p>
</li>
</ul>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="mysql-cluster-ndbinfo-memory-per-fragment-notes">
</a>
memory_per_fragment Table: Notes
</h5>
</div>
</div>
</div>
<p>
The
<code class="literal">
memory_per_fragment
</code>
table contains one
row for every table fragment replica and every index fragment
replica in the system; this means that, for example, when
<a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-noofreplicas">
<code class="literal">
NoOfReplicas=2
</code>
</a>
, there
are normally two fragment replicas for each fragment. This is
true as long as all data nodes are running and connected to
the cluster; for a data node that is missing, there are no
rows for the fragment replicas that it hosts.
</p>
<p>
The columns of the
<code class="literal">
memory_per_fragment
</code>
table can be grouped according to their function or purpose as
follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<span class="emphasis">
<em>
Key columns
</em>
</span>
:
<code class="literal">
fq_name
</code>
,
<code class="literal">
type
</code>
,
<code class="literal">
table_id
</code>
,
<code class="literal">
node_id
</code>
,
<code class="literal">
block_instance
</code>
, and
<code class="literal">
fragment_num
</code>
</p>
</li>
<li class="listitem">
<p>
<span class="emphasis">
<em>
Relationship column
</em>
</span>
:
<code class="literal">
parent_fq_name
</code>
</p>
</li>
<li class="listitem">
<p>
<span class="emphasis">
<em>
Fixed-size storage columns
</em>
</span>
:
<code class="literal">
fixed_elem_alloc_bytes
</code>
,
<code class="literal">
fixed_elem_free_bytes
</code>
,
<code class="literal">
fixed_elem_size_bytes
</code>
,
<code class="literal">
fixed_elem_count
</code>
, and
<code class="literal">
fixed_elem_free_count
</code>
</p>
</li>
<li class="listitem">
<p>
<span class="emphasis">
<em>
Variable-sized storage columns
</em>
</span>
:
<code class="literal">
var_elem_alloc_bytes
</code>
,
<code class="literal">
var_elem_free_bytes
</code>
, and
<code class="literal">
var_elem_count
</code>
</p>
</li>
<li class="listitem">
<p>
<span class="emphasis">
<em>
Hash index column
</em>
</span>
:
<code class="literal">
hash_index_alloc_bytes
</code>
</p>
</li>
</ul>
</div>
<p>
The
<code class="literal">
parent_fq_name
</code>
and
<code class="literal">
fq_name
</code>
columns can be used to identify
indexes associated with a table. Similar schema object
hierarchy information is available in other
<code class="literal">
ndbinfo
</code>
tables.
</p>
<p>
Table and index fragment replicas allocate
<a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-datamemory">
<code class="literal">
DataMemory
</code>
</a>
in 32KB
pages. These memory pages are managed as listed here:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<span class="emphasis">
<em>
Fixed-size pages
</em>
</span>
: These store the
fixed-size parts of rows stored in a given fragment. Every
row has a fixed-size part.
</p>
</li>
<li class="listitem">
<p>
<span class="emphasis">
<em>
Variable-sized pages
</em>
</span>
: These store
variable-sized parts for rows in the fragment. Every row
having one or more variable-sized, one or more dynamic
columns (or both) has a variable-sized part.
</p>
</li>
<li class="listitem">
<p>
<span class="emphasis">
<em>
Hash index pages
</em>
</span>
: These are allocated
as 8 KB subpages, and store the primary key hash index
structure.
</p>
</li>
</ul>
</div>
<p>
Each row in an
<code class="literal">
NDB
</code>
table has a fixed-size
part, consisting of a row header, and one or more fixed-size
columns. The row may also contain one or more variable-size
part references, one or more disk part references, or both.
Each row also has a primary key hash index entry
(corresponding to the hidden primary key that is part of every
<code class="literal">
NDB
</code>
table).
</p>
<p>
From the foregoing we can see that each table fragment and
index fragment together allocate the amount of
<a class="link" href="mysql-cluster-ndbd-definition.html#ndbparam-ndbd-datamemory">
<code class="literal">
DataMemory
</code>
</a>
calculated
as shown here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-simple"><div class="docs-select-all right" id="sa34547039"><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-simple">DataMemory <span class="token operator">=</span>
<span class="token punctuation">(</span><em class="replaceable">number_of_fixed_pages</em> <span class="token operator">+</span> <em class="replaceable">number_of_var_pages</em><span class="token punctuation">)</span> <span class="token operator">*</span> 32KB
<span class="token operator">+</span> <em class="replaceable">number_of_hash_pages</em> <span class="token operator">*</span> 8KB</code></pre>
</div>
<p>
Since
<code class="literal">
fixed_elem_alloc_bytes
</code>
and
<code class="literal">
var_elem_alloc_bytes
</code>
are always multiples
of 32768 bytes, we can further determine that
<code class="literal">
<em class="replaceable">
<code>
number_of_fixed_pages
</code>
</em>
=
fixed_elem_alloc_bytes / 32768
</code>
and
<code class="literal">
<em class="replaceable">
<code>
number_of_var_pages
</code>
</em>
=
var_elem_alloc_bytes / 32768
</code>
.
<code class="literal">
hash_index_alloc_bytes
</code>
is always a multiple
of 8192 bytes, so
<code class="literal">
<em class="replaceable">
<code>
number_of_hash_pages
</code>
</em>
=
hash_index_alloc_bytes / 8192
</code>
.
</p>
<p>
A fixed size page has an internal header and a number of
fixed-size slots, each of which can contain one row's
fixed-size part. The size of a given row's fixed size
part is schema-dependent, and is provided by the
<code class="literal">
fixed_elem_size_bytes
</code>
column; the number of
fixed-size slots per page can be determined by calculating the
total number of slots and the total number of pages, like
this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-simple"><div class="docs-select-all right" id="sa33960448"><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-simple"><em class="replaceable">fixed_slots</em> <span class="token operator">=</span> fixed_elem_count <span class="token operator">+</span> fixed_elem_free_count
<em class="replaceable">fixed_pages</em> <span class="token operator">=</span> fixed_elem_alloc_bytes <span class="token operator">/</span> 32768
<em class="replaceable">slots_per_page</em> <span class="token operator">=</span> total_slots <span class="token operator">/</span> total_pages</code></pre>
</div>
<p>
<code class="literal">
fixed_elem_count
</code>
is in effect the row count
for a given table fragment, since each row has 1 fixed
element,
<code class="literal">
fixed_elem_free_count
</code>
is the total
number of free fixed-size slots across the allocated pages.
<code class="literal">
fixed_elem_free_bytes
</code>
is equal to
<code class="literal">
fixed_elem_free_count *
fixed_elem_size_bytes
</code>
.
</p>
<p>
A fragment can have any number of fixed-size pages; when the
last row on a fixed-size page is deleted, the page is released
to the
<code class="literal">
DataMemory
</code>
page pool. Fixed-size
pages can be fragmented, with more pages allocated than is
required by the number of fixed-size slots in use. You can
check whether this is the case by comparing the pages required
to the pages allocated, which you can calculate like this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-simple"><div class="docs-select-all right" id="sa2306486"><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-simple"><em class="replaceable">fixed_pages_required</em> <span class="token operator">=</span> 1 <span class="token operator">+</span> <span class="token punctuation">(</span>fixed_elem_count <span class="token operator">/</span> <em class="replaceable">slots_per_page</em><span class="token punctuation">)</span>
fixed_page_utilization <span class="token operator">=</span> <em class="replaceable">fixed_pages_required</em> <span class="token operator">/</span> <em class="replaceable">fixed_pages</em></code></pre>
</div>
<p>
A variable-sized page has an internal header and uses the
remaining space to store one or more variable-sized row parts;
the number of parts stored depends on the schema and the
actual data stored. Since not all schemas or rows have a
variable-sized part,
<code class="literal">
var_elem_count
</code>
can be
less than
<code class="literal">
fixed_elem_count
</code>
. The total free
space available on all variable-sized pages in the fragment is
shown by the
<code class="literal">
var_elem_free_bytes
</code>
column;
because this space may be spread over multiple pages, it
cannot necessarily be used to store an entry of a particular
size. Each variable-sized page is reorganized as needed to fit
the changing size of variable-sized row parts as they are
inserted, updated, and deleted; if a given row part grows too
large for the page it is in, it can be moved to a different
page.
</p>
<p>
Variable-sized page utilisation can be calculated as shown
here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-simple"><div class="docs-select-all right" id="sa57233307"><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-simple"><em class="replaceable">var_page_used_bytes</em> <span class="token operator">=</span> var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes
<em class="replaceable">var_page_utilisation</em> <span class="token operator">=</span> var_page_used_bytes <span class="token operator">/</span> var_elem_alloc_bytes
<em class="replaceable">avg_row_var_part_size</em> <span class="token operator">=</span> <em class="replaceable">var_page_used_bytes</em> <span class="token operator">/</span> fixed_elem_count</code></pre>
</div>
<p>
We can obtain the average variable part size per row like
this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-simple"><div class="docs-select-all right" id="sa20254537"><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-simple"><em class="replaceable">avg_row_var_part_size</em> <span class="token operator">=</span> <em class="replaceable">var_page_used_bytes</em> <span class="token operator">/</span> fixed_elem_count</code></pre>
</div>
<p>
Secondary unique indexes are implemented internally as
independent tables with the following schema:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<span class="emphasis">
<em>
Primary key
</em>
</span>
: Indexed columns in base
table.
</p>
</li>
<li class="listitem">
<p>
<span class="emphasis">
<em>
Values
</em>
</span>
: Primary key columns from base
table.
</p>
</li>
</ul>
</div>
<p>
These tables are distributed and fragmented as normal. This
means that their fragment replicas use fixed, variable, and
hash index pages as with any other
<code class="literal">
NDB
</code>
table.
</p>
<p>
Secondary ordered indexes are fragmented and distributed in
the same way as the base table. Ordered index fragments are
T-tree structures which maintain a balanced tree containing
row references in the order implied by the indexed columns.
Since the tree contains references rather than actual data,
the T-tree storage cost is not dependent on the size or number
of indexed columns, but is rather a function of the number of
rows. The tree is constructed using fixed-size node
structures, each of which may contain a number of row
references; the number of nodes required depends on the number
of rows in the table, and the tree structure necessary to
represent the ordering. In the
<code class="literal">
memory_per_fragment
</code>
table, we can see that
ordered indexes allocate only fixed-size pages, so as usual
the relevant columns from this table are as listed here:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
fixed_elem_alloc_bytes
</code>
: This is equal
to 32768 times the number of fixed-size pages.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
fixed_elem_count
</code>
: The number of T-tree
nodes in use.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
fixed_elem_size_bytes
</code>
: The number of
bytes per T-tree node.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
fixed_elem_free_count
</code>
: The number of
T-tree node slots available in the pages allocated.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
fixed_elem_free_bytes
</code>
: This is equal to
<code class="literal">
fixed_elem_free_count *
fixed_elem_size_bytes
</code>
.
</p>
</li>
</ul>
</div>
<p>
If free space in a page is fragmented, the page is
defragmented.
<a class="link" href="optimize-table.html" title="15.7.3.4 OPTIMIZE TABLE Statement">
<code class="literal">
OPTIMIZE TABLE
</code>
</a>
can be used to defragment a table's variable-sized pages;
this moves row variable-sized parts between pages so that some
whole pages can be freed for re-use.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="mysql-cluster-ndbinfo-memory-per-fragment-examples">
</a>
memory_per_fragment Table: Examples
</h5>
</div>
</div>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-memory-general" title="Getting general information about fragments and memory usage">
Getting general information about fragments and memory usage
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-table-indexes" title="Finding a table and its indexes">
Finding a table and its indexes
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-memory-allocated-per-element" title="Finding the memory allocated by schema elements">
Finding the memory allocated by schema elements
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-table-indexes-all" title="Finding the memory allocated for a table and all indexes">
Finding the memory allocated for a table and all indexes
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-total-per-row" title="Finding the memory allocated per row">
Finding the memory allocated per row
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-total-in-use-per-row" title="Finding the total memory in use per row">
Finding the total memory in use per row
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-allocated-per-element" title="Finding the memory allocated per element">
Finding the memory allocated per element
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-average-allocated-per-row-by-element" title="Finding the average memory allocated per row, by element">
Finding the average memory allocated per row, by element
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-average-allocated-per-row" title="Finding the average memory allocated per row">
Finding the average memory allocated per row
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-allocated-per-row-for-table" title="Finding the average memory allocated per row for a table">
Finding the average memory allocated per row for a table
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-in-use-per-element" title="Finding the memory in use by each schema element">
Finding the memory in use by each schema element
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-avaerage-in-use-per-element" title="Finding the average memory in use by each schema element">
Finding the average memory in use by each schema element
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-average-in-use-per-row-by-element" title="Finding the average memory in use per row, by element">
Finding the average memory in use per row, by element
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysql-cluster-ndbinfo-memory-per-fragment.html#memory-per-fragment-total-average-in-use-per-row" title="Finding the total average memory in use per row">
Finding the total average memory in use per row
</a>
</p>
</li>
</ul>
</div>
<p>
For the following examples, we create a simple table with
three integer columns, one of which has a primary key, one
having a unique index, and one with no indexes, as well as one
<a class="link" href="char.html" title="13.3.2 The CHAR and VARCHAR Types">
<code class="literal">
VARCHAR
</code>
</a>
column with no indexes,
as shown here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa94110982"><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></span> <span class="token keyword">CREATE</span> <span class="token keyword">DATABASE</span> <span class="token keyword">IF</span> <span class="token operator">NOT</span> <span class="token keyword">EXISTS</span> test<span class="token punctuation">;</span>
<span class="token output">Query OK, 1 row affected (0.06 sec)</span>
<span class="token prompt">mysql></span> <span class="token keyword">USE</span> test<span class="token punctuation">;</span>
<span class="token keyword">Database</span> <span class="token keyword">changed</span>
<span class="token prompt">mysql></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>
<span class="token prompt"> -></span> c1 <span class="token datatype">BIGINT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token keyword">AUTO_INCREMENT</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> c2 <span class="token datatype">INT</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> c3 <span class="token datatype">INT</span> <span class="token keyword">UNIQUE</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token punctuation">)</span> <span class="token keyword">ENGINE</span><span class="token operator">=</span><span class="token keyword">NDBCLUSTER</span><span class="token punctuation">;</span>
<span class="token output">Query OK, 0 rows affected (0.27 sec)</span></code></pre>
</div>
<p>
Following creation of the table, we insert 50,000 rows
containing random data; the precise method of generating and
inserting these rows makes no practical difference, and we
leave the method of accomplishing as an exercise for the user.
</p>
<h6>
<a name="memory-per-fragment-memory-general">
</a>
Getting general information about fragments and memory usage
</h6>
<p>
This query shows general information about memory usage for
each fragment:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa64282494"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> fq_name<span class="token punctuation">,</span> node_id<span class="token punctuation">,</span> block_instance<span class="token punctuation">,</span> fragment_num<span class="token punctuation">,</span> fixed_elem_alloc_bytes<span class="token punctuation">,</span>
<span class="token prompt"> -></span> fixed_elem_free_bytes<span class="token punctuation">,</span> fixed_elem_size_bytes<span class="token punctuation">,</span> fixed_elem_count<span class="token punctuation">,</span>
<span class="token prompt"> -></span> fixed_elem_free_count<span class="token punctuation">,</span> var_elem_alloc_bytes<span class="token punctuation">,</span> var_elem_free_bytes<span class="token punctuation">,</span>
<span class="token prompt"> -></span> var_elem_count
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">"test/def/t1"</span>\G
<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> 1. row <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>
fq_name<span class="token punctuation">:</span> test/def/t1
node_id<span class="token punctuation">:</span> 5
block_instance<span class="token punctuation">:</span> 1
fragment_num<span class="token punctuation">:</span> 0
fixed_elem_alloc_bytes<span class="token punctuation">:</span> 1114112
fixed_elem_free_bytes<span class="token punctuation">:</span> 11836
fixed_elem_size_bytes<span class="token punctuation">:</span> 44
fixed_elem_count<span class="token punctuation">:</span> 24925
fixed_elem_free_count<span class="token punctuation">:</span> 269
var_elem_alloc_bytes<span class="token punctuation">:</span> 1245184
var_elem_free_bytes<span class="token punctuation">:</span> 32552
var_elem_count<span class="token punctuation">:</span> 24925
<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> 2. row <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>
fq_name<span class="token punctuation">:</span> test/def/t1
node_id<span class="token punctuation">:</span> 5
block_instance<span class="token punctuation">:</span> 1
fragment_num<span class="token punctuation">:</span> 1
fixed_elem_alloc_bytes<span class="token punctuation">:</span> 1114112
fixed_elem_free_bytes<span class="token punctuation">:</span> 5236
fixed_elem_size_bytes<span class="token punctuation">:</span> 44
fixed_elem_count<span class="token punctuation">:</span> 25075
fixed_elem_free_count<span class="token punctuation">:</span> 119
var_elem_alloc_bytes<span class="token punctuation">:</span> 1277952
var_elem_free_bytes<span class="token punctuation">:</span> 54232
var_elem_count<span class="token punctuation">:</span> 25075
<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> 3. row <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>
fq_name<span class="token punctuation">:</span> test/def/t1
node_id<span class="token punctuation">:</span> 6
block_instance<span class="token punctuation">:</span> 1
fragment_num<span class="token punctuation">:</span> 0
fixed_elem_alloc_bytes<span class="token punctuation">:</span> 1114112
fixed_elem_free_bytes<span class="token punctuation">:</span> 11836
fixed_elem_size_bytes<span class="token punctuation">:</span> 44
fixed_elem_count<span class="token punctuation">:</span> 24925
fixed_elem_free_count<span class="token punctuation">:</span> 269
var_elem_alloc_bytes<span class="token punctuation">:</span> 1245184
var_elem_free_bytes<span class="token punctuation">:</span> 32552
var_elem_count<span class="token punctuation">:</span> 24925
<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> 4. row <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>
fq_name<span class="token punctuation">:</span> test/def/t1
node_id<span class="token punctuation">:</span> 6
block_instance<span class="token punctuation">:</span> 1
fragment_num<span class="token punctuation">:</span> 1
fixed_elem_alloc_bytes<span class="token punctuation">:</span> 1114112
fixed_elem_free_bytes<span class="token punctuation">:</span> 5236
fixed_elem_size_bytes<span class="token punctuation">:</span> 44
fixed_elem_count<span class="token punctuation">:</span> 25075
fixed_elem_free_count<span class="token punctuation">:</span> 119
var_elem_alloc_bytes<span class="token punctuation">:</span> 1277952
var_elem_free_bytes<span class="token punctuation">:</span> 54232
var_elem_count<span class="token punctuation">:</span> 25075
</span><span class="token output">4 rows in set (0.12 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-table-indexes">
</a>
Finding a table and its indexes
</h6>
<p>
This query can be used to find a specific table and its
indexes:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa91238365"><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></span> <span class="token keyword">SELECT</span> fq_name
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt"> -></span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<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>
<span class="token output"><span class="token punctuation">|</span> fq_name <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>
<span class="token output"><span class="token punctuation">|</span> test/def/t1 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <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>
<span class="token output">4 rows in set (0.13 sec)</span>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> t1<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>
<span class="token output"><span class="token punctuation">|</span> COUNT(*) <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>
<span class="token output"><span class="token punctuation">|</span> 50000 <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>
<span class="token output">1 row in set (0.00 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-memory-allocated-per-element">
</a>
Finding the memory allocated by schema elements
</h6>
<p>
This query shows the memory allocated by each schema element
(in total across all replicas):
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa36584843"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> fq_name <span class="token keyword">AS</span> <span class="token keyword">Name</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Fixed</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Var<span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Hash</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token operator">+</span>var_elem_alloc_bytes<span class="token operator">+</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Total
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt"> -></span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<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>
<span class="token output"><span class="token punctuation">|</span> Name <span class="token punctuation">|</span> Fixed <span class="token punctuation">|</span> Var <span class="token punctuation">|</span> Hash <span class="token punctuation">|</span> Total <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>
<span class="token output"><span class="token punctuation">|</span> test/def/t1 <span class="token punctuation">|</span> 4456448 <span class="token punctuation">|</span> 5046272 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span> 10928128 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY <span class="token punctuation">|</span> 1966080 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 1966080 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3 <span class="token punctuation">|</span> 1441792 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 1441792 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <span class="token punctuation">|</span> 3276800 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span> 4702208 <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>
<span class="token output">4 rows in set (0.11 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-table-indexes-all">
</a>
Finding the memory allocated for a table and all indexes
</h6>
<p>
The sum of memory allocated for the table and all its indexes
(in total across all replicas) can be obtained using the query
shown here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa80035681"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Fixed</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Var<span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Hash</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token operator">+</span>var_elem_alloc_bytes<span class="token operator">+</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Total
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</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>
<span class="token output"><span class="token punctuation">|</span> Fixed <span class="token punctuation">|</span> Var <span class="token punctuation">|</span> Hash <span class="token punctuation">|</span> Total <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>
<span class="token output"><span class="token punctuation">|</span> 11141120 <span class="token punctuation">|</span> 5046272 <span class="token punctuation">|</span> 2850816 <span class="token punctuation">|</span> 19038208 <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>
<span class="token output">1 row in set (0.12 sec)</span></code></pre>
</div>
<p>
This is an abbreviated version of the previous query which
shows only the total memory used by the table:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa64435497"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token operator">+</span>var_elem_alloc_bytes<span class="token operator">+</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Total
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</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>
<span class="token output"><span class="token punctuation">|</span> Total <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>
<span class="token output"><span class="token punctuation">|</span> 19038208 <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>
<span class="token output">1 row in set (0.12 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-total-per-row">
</a>
Finding the memory allocated per row
</h6>
<p>
The following query shows the total memory allocated per row
(across all replicas):
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa67195997"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token operator">+</span>var_elem_alloc_bytes<span class="token operator">+</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span> <span class="token keyword">AS</span> Total_alloc_per_row
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</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>
<span class="token output"><span class="token punctuation">|</span> Total_alloc_per_row <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>
<span class="token output"><span class="token punctuation">|</span> 109.2813 <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>
<span class="token output">1 row in set (0.12 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-total-in-use-per-row">
</a>
Finding the total memory in use per row
</h6>
<p>
To obtain the total memory in use per row (across all
replicas), we need the total memory used divided by the row
count, which is the
<code class="literal">
fixed_elem_count
</code>
for
the base table like this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa32700603"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">+</span> <span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">+</span> hash_index_alloc_bytes
<span class="token prompt"> -></span> <span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">AS</span> total_in_use_per_row
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</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>
<span class="token output"><span class="token punctuation">|</span> total_in_use_per_row <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>
<span class="token output"><span class="token punctuation">|</span> 107.2042 <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>
<span class="token output">1 row in set (0.12 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-allocated-per-element">
</a>
Finding the memory allocated per element
</h6>
<p>
The memory allocated by each schema element (in total across
all replicas) can be found using the following query:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa29148254"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> fq_name <span class="token keyword">AS</span> <span class="token keyword">Name</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Fixed</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> Var<span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token keyword">Hash</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">+</span> var_elem_alloc_bytes <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">AS</span> Total_alloc
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt"> -></span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<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>
<span class="token output"><span class="token punctuation">|</span> Name <span class="token punctuation">|</span> Fixed <span class="token punctuation">|</span> Var <span class="token punctuation">|</span> Hash <span class="token punctuation">|</span> Total_alloc <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>
<span class="token output"><span class="token punctuation">|</span> test/def/t1 <span class="token punctuation">|</span> 4456448 <span class="token punctuation">|</span> 5046272 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span> 10928128 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY <span class="token punctuation">|</span> 1966080 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 1966080 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3 <span class="token punctuation">|</span> 1441792 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 1441792 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <span class="token punctuation">|</span> 3276800 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span> 4702208 <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>
<span class="token output">4 rows in set (0.11 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-average-allocated-per-row-by-element">
</a>
Finding the average memory allocated per row, by element
</h6>
<p>
To obtain the average memory allocated per row by each schema
element (in total across all replicas), we use a subquery to
get the base table fixed element count each time to get an
average per row since
<code class="literal">
fixed_elem_count
</code>
for
the indexes is not necessarily the same as for the base table,
as shown here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa12825266"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> fq_name <span class="token keyword">AS</span> <span class="token keyword">Name</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Table_rows<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Avg_fixed_alloc<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">as</span> Avg_var_alloc<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">as</span> Avg_hash_alloc<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token operator">+</span>var_elem_alloc_bytes<span class="token operator">+</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">as</span> Avg_total_alloc
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">or</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt"> -></span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<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 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> Name <span class="token punctuation">|</span> Table_rows <span class="token punctuation">|</span> Avg_fixed_alloc <span class="token punctuation">|</span> Avg_var_alloc <span class="token punctuation">|</span> Avg_hash_alloc <span class="token punctuation">|</span> Avg_total_alloc <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 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> test/def/t1 <span class="token punctuation">|</span> 100000 <span class="token punctuation">|</span> 44.5645 <span class="token punctuation">|</span> 50.4627 <span class="token punctuation">|</span> 14.2541 <span class="token punctuation">|</span> 109.2813 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY <span class="token punctuation">|</span> 100000 <span class="token punctuation">|</span> 19.6608 <span class="token punctuation">|</span> 0.0000 <span class="token punctuation">|</span> 0.0000 <span class="token punctuation">|</span> 19.6608 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3 <span class="token punctuation">|</span> 100000 <span class="token punctuation">|</span> 14.4179 <span class="token punctuation">|</span> 0.0000 <span class="token punctuation">|</span> 0.0000 <span class="token punctuation">|</span> 14.4179 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <span class="token punctuation">|</span> 100000 <span class="token punctuation">|</span> 32.7680 <span class="token punctuation">|</span> 0.0000 <span class="token punctuation">|</span> 14.2541 <span class="token punctuation">|</span> 47.0221 <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 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">4 rows in set (0.70 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-average-allocated-per-row">
</a>
Finding the average memory allocated per row
</h6>
<p>
Average memory allocated per row (in total across all
replicas):
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa2229160"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Table_rows<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Avg_fixed_alloc<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Avg_var_alloc<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Avg_hash_alloc<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">+</span> var_elem_alloc_bytes <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> Avg_total_alloc
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</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 class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Table_rows <span class="token punctuation">|</span> Avg_fixed_alloc <span class="token punctuation">|</span> Avg_var_alloc <span class="token punctuation">|</span> Avg_hash_alloc <span class="token punctuation">|</span> Avg_total_alloc <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 class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 100000 <span class="token punctuation">|</span> 111.4112 <span class="token punctuation">|</span> 50.4627 <span class="token punctuation">|</span> 28.5082 <span class="token punctuation">|</span> 190.3821 <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 class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">1 row in set (0.71 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-allocated-per-row-for-table">
</a>
Finding the average memory allocated per row for a table
</h6>
<p>
To get the average amount of memory allocated per row for the
entire table across all replicas, we can use the query shown
here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa9219268"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> table_rows<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">+</span> var_elem_alloc_bytes <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_total_alloc
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</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>
<span class="token output"><span class="token punctuation">|</span> table_rows <span class="token punctuation">|</span> avg_total_alloc <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>
<span class="token output"><span class="token punctuation">|</span> 100000 <span class="token punctuation">|</span> 190.3821 <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>
<span class="token output">1 row in set (0.33 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-in-use-per-element">
</a>
Finding the memory in use by each schema element
</h6>
<p>
To obtain the memory in use per schema element across all
replicas, we need to sum the difference between allocated and
free memory for each element, like this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa64759478"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> fq_name <span class="token keyword">AS</span> <span class="token keyword">Name</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> fixed_inuse<span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes<span class="token operator">-</span>var_elem_free_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> var_inuse<span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> hash_memory<span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span> <span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">+</span> <span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span> <span class="token keyword">AS</span> total_alloc
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt"> -></span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<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>
<span class="token output"><span class="token punctuation">|</span> fq_name <span class="token punctuation">|</span> fixed_inuse <span class="token punctuation">|</span> var_inuse <span class="token punctuation">|</span> hash <span class="token punctuation">|</span> total_alloc <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>
<span class="token output"><span class="token punctuation">|</span> test/def/t1 <span class="token punctuation">|</span> 4422304 <span class="token punctuation">|</span> 4872704 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span> 10720416 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY <span class="token punctuation">|</span> 1950848 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 1950848 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3 <span class="token punctuation">|</span> 1428736 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 1428736 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <span class="token punctuation">|</span> 3212800 <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span> 1425408 <span class="token punctuation">|</span> 4638208 <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>
<span class="token output">4 rows in set (0.13 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-avaerage-in-use-per-element">
</a>
Finding the average memory in use by each schema element
</h6>
<p>
This query gets the average memory in use per schema element
across all replicas:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa75690478"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> fq_name <span class="token keyword">AS</span> <span class="token keyword">Name</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> table_rows<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_fixed_inuse<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_var_inuse<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_hash<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">+</span> <span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span> <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_total_inuse
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span>
<span class="token prompt"> -></span> <span class="token keyword">GROUP</span> <span class="token keyword">BY</span> fq_name<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 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> Name <span class="token punctuation">|</span> table_rows <span class="token punctuation">|</span> avg_fixed_inuse <span class="token punctuation">|</span> avg_var_inuse <span class="token punctuation">|</span> avg_hash <span class="token punctuation">|</span> avg_total_inuse <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 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> test/def/t1 <span class="token punctuation">|</span> 100000 <span class="token punctuation">|</span> 44.2230 <span class="token punctuation">|</span> 48.7270 <span class="token punctuation">|</span> 14.2541 <span class="token punctuation">|</span> 107.2042 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/PRIMARY <span class="token punctuation">|</span> 100000 <span class="token punctuation">|</span> 19.5085 <span class="token punctuation">|</span> 0.0000 <span class="token punctuation">|</span> 0.0000 <span class="token punctuation">|</span> 19.5085 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3 <span class="token punctuation">|</span> 100000 <span class="token punctuation">|</span> 14.2874 <span class="token punctuation">|</span> 0.0000 <span class="token punctuation">|</span> 0.0000 <span class="token punctuation">|</span> 14.2874 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sys/def/13/c3$unique <span class="token punctuation">|</span> 100000 <span class="token punctuation">|</span> 32.1280 <span class="token punctuation">|</span> 0.0000 <span class="token punctuation">|</span> 14.2541 <span class="token punctuation">|</span> 46.3821 <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 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">4 rows in set (0.72 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-average-in-use-per-row-by-element">
</a>
Finding the average memory in use per row, by element
</h6>
<p>
This query gets the average memory in use per row, by element,
across all replicas:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa33358374"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> table_rows<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_fixed_inuse<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_var_inuse<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_hash<span class="token punctuation">,</span>
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">+</span> <span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_total_inuse
<span class="token prompt"> -></span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</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>
<span class="token output"><span class="token punctuation">|</span> table_rows <span class="token punctuation">|</span> avg_fixed_inuse <span class="token punctuation">|</span> avg_var_inuse <span class="token punctuation">|</span> avg_hash <span class="token punctuation">|</span> avg_total_inuse <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>
<span class="token output"><span class="token punctuation">|</span> 100000 <span class="token punctuation">|</span> 110.1469 <span class="token punctuation">|</span> 48.7270 <span class="token punctuation">|</span> 28.5082 <span class="token punctuation">|</span> 187.3821 <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>
<span class="token output">1 row in set (0.68 sec)</span></code></pre>
</div>
<h6>
<a name="memory-per-fragment-total-average-in-use-per-row">
</a>
Finding the total average memory in use per row
</h6>
<p>
This query obtains the total average memory in use, per row:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa53759505"><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></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span>fixed_elem_alloc_bytes <span class="token operator">-</span> fixed_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">+</span> <span class="token punctuation">(</span>var_elem_alloc_bytes <span class="token operator">-</span> var_elem_free_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">+</span> hash_index_alloc_bytes<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token operator">/</span>
<span class="token prompt"> -></span> <span class="token punctuation">(</span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> <span class="token function">SUM</span><span class="token punctuation">(</span>fixed_elem_count<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> avg_total_in_use
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> ndbinfo<span class="token punctuation">.</span>memory_per_fragment
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> fq_name <span class="token operator">=</span> <span class="token string">'test/def/t1'</span> <span class="token operator">OR</span> parent_fq_name<span class="token operator">=</span><span class="token string">'test/def/t1'</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>
<span class="token output"><span class="token punctuation">|</span> avg_total_in_use <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>
<span class="token output"><span class="token punctuation">|</span> 187.3821 <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>
<span class="token output">1 row in set (0.24 sec)</span></code></pre>
</div>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/create-spatial-reference-system.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="create-spatial-reference-system">
</a>
15.1.19 CREATE SPATIAL REFERENCE SYSTEM Statement
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045187001552">
</a>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa43646271"><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">CREATE</span> <span class="token operator">OR</span> <span class="token keyword">REPLACE</span> <span class="token keyword">SPATIAL</span> <span class="token keyword">REFERENCE</span> <span class="token keyword">SYSTEM</span>
<span class="token keyword"><em class="replaceable">srid</em></span> <em class="replaceable">srs_attribute</em> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token keyword">CREATE</span> <span class="token keyword">SPATIAL</span> <span class="token keyword">REFERENCE</span> <span class="token keyword">SYSTEM</span>
<span class="token punctuation">[</span><span class="token keyword">IF</span> <span class="token operator">NOT</span> <span class="token keyword">EXISTS</span><span class="token punctuation">]</span>
<span class="token keyword"><em class="replaceable">srid</em></span> <em class="replaceable">srs_attribute</em> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<em class="replaceable">srs_attribute</em>: {
<span class="token keyword">NAME</span> <span class="token string">'<em class="replaceable">srs_name</em>'</span>
<span class="token operator">|</span> <span class="token keyword">DEFINITION</span> <span class="token string">'<em class="replaceable">definition</em>'</span>
<span class="token operator">|</span> <span class="token keyword">ORGANIZATION</span> <span class="token string">'<em class="replaceable">org_name</em>'</span> <span class="token keyword">IDENTIFIED</span> <span class="token keyword">BY</span> <em class="replaceable">org_id</em>
<span class="token operator">|</span> <span class="token keyword">DESCRIPTION</span> <span class="token string">'<em class="replaceable">description</em>'</span>
}
<span class="token keyword"><em class="replaceable">srid</em></span><span class="token punctuation">,</span> <em class="replaceable">org_id</em>: <span class="token number"></span><em class="replaceable"><span class="token number">32</span><span class="token operator">-</span><span class="token datatype">bit</span> <span class="token keyword">unsigned</span> <span class="token datatype">integer</span></em><span class="token datatype"></span></code></pre>
</div>
<p>
This statement creates a
<a class="link" href="spatial-reference-systems.html" title="13.4.5 Spatial Reference System Support">
spatial reference
system
</a>
(SRS) definition and stores it in the data
dictionary. It requires the
<a class="link" href="privileges-provided.html#priv_super">
<code class="literal">
SUPER
</code>
</a>
privilege. The resulting data dictionary entry can be inspected
using the
<code class="literal">
INFORMATION_SCHEMA
</code>
<a class="link" href="information-schema-st-spatial-reference-systems-table.html" title="28.3.36 The INFORMATION_SCHEMA ST_SPATIAL_REFERENCE_SYSTEMS Table">
<code class="literal">
ST_SPATIAL_REFERENCE_SYSTEMS
</code>
</a>
table.
</p>
<p>
SRID values must be unique, so if neither
<code class="literal">
OR
REPLACE
</code>
nor
<code class="literal">
IF NOT EXISTS
</code>
is
specified, an error occurs if an SRS definition with the given
<em class="replaceable">
<code>
srid
</code>
</em>
value already exists.
</p>
<p>
With
<code class="literal">
CREATE OR REPLACE
</code>
syntax, any existing SRS
definition with the same SRID value is replaced, unless the SRID
value is used by some column in an existing table. In that case,
an error occurs. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa75265186"><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></span> <span class="token keyword">CREATE</span> <span class="token operator">OR</span> <span class="token keyword">REPLACE</span> <span class="token keyword">SPATIAL</span> <span class="token keyword">REFERENCE</span> <span class="token keyword">SYSTEM</span> <span class="token number">4326</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">;</span>
<span class="token output">ERROR 3716 (SR005)<span class="token punctuation">:</span> Can't modify SRID 4326. There is at
least one column depending on it.</span></code></pre>
</div>
<p>
To identify which column or columns use the SRID, use this query,
replacing 4326 with the SRID of the definition you are trying to
create:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa68246508"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>ST_GEOMETRY_COLUMNS <span class="token keyword">WHERE</span> SRS_ID<span class="token operator">=</span><span class="token number">4326</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
With
<code class="literal">
CREATE ... IF NOT EXISTS
</code>
syntax, any
existing SRS definition with the same SRID value causes the new
definition to be ignored and a warning occurs.
</p>
<p>
SRID values must be in the range of 32-bit unsigned integers, with
these restrictions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
SRID 0 is a valid SRID but cannot be used with
<a class="link" href="create-spatial-reference-system.html" title="15.1.19 CREATE SPATIAL REFERENCE SYSTEM Statement">
<code class="literal">
CREATE SPATIAL REFERENCE
SYSTEM
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
If the value is in a reserved SRID range, a warning occurs.
Reserved ranges are [0, 32767] (reserved by EPSG),
[60,000,000, 69,999,999] (reserved by EPSG), and
[2,000,000,000, 2,147,483,647] (reserved by MySQL). EPSG
stands for the
<a class="ulink" href="http://epsg.org" target="_blank">
European Petroleum
Survey Group
</a>
.
</p>
</li>
<li class="listitem">
<p>
Users should not create SRSs with SRIDs in the reserved
ranges. Doing so runs the risk of the SRIDs conflicting with
future SRS definitions distributed with MySQL, with the result
that the new system-provided SRSs are not installed for MySQL
upgrades or that the user-defined SRSs are overwritten.
</p>
</li>
</ul>
</div>
<p>
Attributes for the statement must satisfy these conditions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Attributes can be given in any order, but no attribute can be
given more than once.
</p>
</li>
<li class="listitem">
<p>
The
<code class="literal">
NAME
</code>
and
<code class="literal">
DEFINITION
</code>
attributes are mandatory.
</p>
</li>
<li class="listitem">
<p>
The
<code class="literal">
NAME
</code>
<em class="replaceable">
<code>
srs_name
</code>
</em>
attribute value must be
unique. The combination of the
<code class="literal">
ORGANIZATION
</code>
<em class="replaceable">
<code>
org_name
</code>
</em>
and
<em class="replaceable">
<code>
org_id
</code>
</em>
attribute values must be
unique.
</p>
</li>
<li class="listitem">
<p>
The
<code class="literal">
NAME
</code>
<em class="replaceable">
<code>
srs_name
</code>
</em>
attribute value and
<code class="literal">
ORGANIZATION
</code>
<em class="replaceable">
<code>
org_name
</code>
</em>
attribute value cannot be
empty or begin or end with whitespace.
</p>
</li>
<li class="listitem">
<p>
String values in attribute specifications cannot contain
control characters, including newline.
</p>
</li>
<li class="listitem">
<p>
The following table shows the maximum lengths for string
attribute values.
</p>
<div class="table">
<a name="spatial-reference-system-attribute-length">
</a>
<p class="title">
<b>
Table 15.6 CREATE SPATIAL REFERENCE SYSTEM Attribute Lengths
</b>
</p>
<div class="table-contents">
<table summary="Maximum string attribute lengths for CREATE SPATIAL REFERENCE SYSTEM">
<colgroup>
<col style="width: 25%"/>
<col style="width: 50%"/>
</colgroup>
<thead>
<tr>
<th>
Attribute
</th>
<th>
Maximum Length (characters)
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="literal">
NAME
</code>
</td>
<td>
80
</td>
</tr>
<tr>
<td>
<code class="literal">
DEFINITION
</code>
</td>
<td>
4096
</td>
</tr>
<tr>
<td>
<code class="literal">
ORGANIZATION
</code>
</td>
<td>
256
</td>
</tr>
<tr>
<td>
<code class="literal">
DESCRIPTION
</code>
</td>
<td>
2048
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br class="table-break"/>
</li>
</ul>
</div>
<p>
Here is an example
<a class="link" href="create-spatial-reference-system.html" title="15.1.19 CREATE SPATIAL REFERENCE SYSTEM Statement">
<code class="literal">
CREATE SPATIAL REFERENCE
SYSTEM
</code>
</a>
statement. The
<code class="literal">
DEFINITION
</code>
value is reformatted across multiple lines for readability. (For
the statement to be legal, the value actually must be given on a
single line.)
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa34323421"><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">CREATE</span> <span class="token keyword">SPATIAL</span> <span class="token keyword">REFERENCE</span> <span class="token keyword">SYSTEM</span> <span class="token number">4120</span>
<span class="token keyword">NAME</span> <span class="token string">'Greek'</span>
<span class="token keyword">ORGANIZATION</span> <span class="token string">'EPSG'</span> <span class="token keyword">IDENTIFIED</span> <span class="token keyword">BY</span> <span class="token number">4120</span>
<span class="token keyword">DEFINITION</span>
<span class="token string">'GEOGCS["Greek",DATUM["Greek",SPHEROID["Bessel 1841",
6377397.155,299.1528128,AUTHORITY["EPSG","7004"]],
AUTHORITY["EPSG","6120"]],PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,
AUTHORITY["EPSG","9122"]],AXIS["Lat",NORTH],AXIS["Lon",EAST],
AUTHORITY["EPSG","4120"]]'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The grammar for SRS definitions is based on the grammar defined in
<em class="citetitle">
OpenGIS Implementation Specification: Coordinate
Transformation Services
</em>
, Revision 1.00, OGC 01-009,
January 12, 2001, Section 7.2. This specification is available at
<a class="ulink" href="http://www.opengeospatial.org/standards/ct" target="_blank">
http://www.opengeospatial.org/standards/ct
</a>
.
</p>
<p>
MySQL incorporates these changes to the specification:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Only the
<code class="literal">
<horz cs>
</code>
production rule is
implemented (that is, geographic and projected SRSs).
</p>
</li>
<li class="listitem">
<p>
There is an optional, nonstandard
<code class="literal">
<authority>
</code>
clause for
<code class="literal">
<parameter>
</code>
. This makes it possible
to recognize projection parameters by authority instead of
name.
</p>
</li>
<li class="listitem">
<p>
The specification does not make
<code class="literal">
AXIS
</code>
clauses mandatory in
<code class="literal">
GEOGCS
</code>
spatial
reference system definitions. However, if there are no
<code class="literal">
AXIS
</code>
clauses, MySQL cannot determine
whether a definition has axes in latitude-longitude order or
longitude-latitude order. MySQL enforces the nonstandard
requirement that each
<code class="literal">
GEOGCS
</code>
definition
must include two
<code class="literal">
AXIS
</code>
clauses. One must be
<code class="literal">
NORTH
</code>
or
<code class="literal">
SOUTH
</code>
, and the
other
<code class="literal">
EAST
</code>
or
<code class="literal">
WEST
</code>
. The
<code class="literal">
AXIS
</code>
clause order determines whether the
definition has axes in latitude-longitude order or
longitude-latitude order.
</p>
</li>
<li class="listitem">
<p>
SRS definitions may not contain newlines.
</p>
</li>
</ul>
</div>
<p>
If an SRS definition specifies an authority code for the
projection (which is recommended), an error occurs if the
definition is missing mandatory parameters. In this case, the
error message indicates what the problem is. The projection
methods and mandatory parameters that MySQL supports are shown in
<a class="xref" href="create-spatial-reference-system.html#supported-srs-projections-table" title="Table 15.7 Supported Spatial Reference System Projection Methods">
Table 15.7, “Supported Spatial Reference System Projection Methods”
</a>
and
<a class="xref" href="create-spatial-reference-system.html#srs-projection-parameters-table" title="Table 15.8 Spatial Reference System Projection Parameters">
Table 15.8, “Spatial Reference System Projection Parameters”
</a>
.
</p>
<p>
The following table shows the projection methods that MySQL
supports. MySQL permits unknown projection methods but cannot
check the definition for mandatory parameters and cannot convert
spatial data to or from an unknown projection. For detailed
explanations of how each projection works, including formulas, see
<a class="ulink" href="http://www.epsg.org/Portals/0/373-07-2.pdf" target="_blank">
EPSG
Guidance Note 7-2
</a>
.
</p>
<div class="table">
<a name="supported-srs-projections-table">
</a>
<p class="title">
<b>
Table 15.7 Supported Spatial Reference System Projection Methods
</b>
</p>
<div class="table-contents">
<table summary="Supported spatial reference system projection codes, names, and mandatory EPSG parameters.">
<colgroup>
<col style="width: 10%"/>
<col style="width: 45%"/>
<col style="width: 35%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
EPSG Code
</th>
<th scope="col">
Projection Name
</th>
<th scope="col">
Mandatory Parameters (EPSG Codes)
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
1024
</th>
<td>
Popular Visualisation Pseudo Mercator
</td>
<td>
8801, 8802, 8806, 8807
</td>
</tr>
<tr>
<th scope="row">
1027
</th>
<td>
Lambert Azimuthal Equal Area (Spherical)
</td>
<td>
8801, 8802, 8806, 8807
</td>
</tr>
<tr>
<th scope="row">
1028
</th>
<td>
Equidistant Cylindrical
</td>
<td>
8823, 8802, 8806, 8807
</td>
</tr>
<tr>
<th scope="row">
1029
</th>
<th>
Equidistant Cylindrical (Spherical)
</th>
<th>
8823, 8802, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
1041
</th>
<th>
Krovak (North Orientated)
</th>
<th>
8811, 8833, 1036, 8818, 8819, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
1042
</th>
<th>
Krovak Modified
</th>
<th>
8811, 8833, 1036, 8818, 8819, 8806, 8807, 8617, 8618, 1026, 1027, 1028,
1029, 1030, 1031, 1032, 1033, 1034, 1035
</th>
</tr>
<tr>
<th scope="row">
1043
</th>
<th>
Krovak Modified (North Orientated)
</th>
<th>
8811, 8833, 1036, 8818, 8819, 8806, 8807, 8617, 8618, 1026, 1027, 1028,
1029, 1030, 1031, 1032, 1033, 1034, 1035
</th>
</tr>
<tr>
<th scope="row">
1051
</th>
<th>
Lambert Conic Conformal (2SP Michigan)
</th>
<th>
8821, 8822, 8823, 8824, 8826, 8827, 1038
</th>
</tr>
<tr>
<th scope="row">
1052
</th>
<th>
Colombia Urban
</th>
<th>
8801, 8802, 8806, 8807, 1039
</th>
</tr>
<tr>
<th scope="row">
9801
</th>
<th>
Lambert Conic Conformal (1SP)
</th>
<th>
8801, 8802, 8805, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9802
</th>
<th>
Lambert Conic Conformal (2SP)
</th>
<th>
8821, 8822, 8823, 8824, 8826, 8827
</th>
</tr>
<tr>
<th scope="row">
9803
</th>
<th>
Lambert Conic Conformal (2SP Belgium)
</th>
<th>
8821, 8822, 8823, 8824, 8826, 8827
</th>
</tr>
<tr>
<th scope="row">
9804
</th>
<th>
Mercator (variant A)
</th>
<th>
8801, 8802, 8805, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9805
</th>
<th>
Mercator (variant B)
</th>
<th>
8823, 8802, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9806
</th>
<th>
Cassini-Soldner
</th>
<th>
8801, 8802, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9807
</th>
<th>
Transverse Mercator
</th>
<th>
8801, 8802, 8805, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9808
</th>
<th>
Transverse Mercator (South Orientated)
</th>
<th>
8801, 8802, 8805, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9809
</th>
<th>
Oblique Stereographic
</th>
<th>
8801, 8802, 8805, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9810
</th>
<th>
Polar Stereographic (variant A)
</th>
<th>
8801, 8802, 8805, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9811
</th>
<th>
New Zealand Map Grid
</th>
<th>
8801, 8802, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9812
</th>
<th>
Hotine Oblique Mercator (variant A)
</th>
<th>
8811, 8812, 8813, 8814, 8815, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9813
</th>
<th>
Laborde Oblique Mercator
</th>
<th>
8811, 8812, 8813, 8815, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9815
</th>
<th>
Hotine Oblique Mercator (variant B)
</th>
<th>
8811, 8812, 8813, 8814, 8815, 8816, 8817
</th>
</tr>
<tr>
<th scope="row">
9816
</th>
<th>
Tunisia Mining Grid
</th>
<th>
8821, 8822, 8826, 8827
</th>
</tr>
<tr>
<th scope="row">
9817
</th>
<th>
Lambert Conic Near-Conformal
</th>
<th>
8801, 8802, 8805, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9818
</th>
<th>
American Polyconic
</th>
<th>
8801, 8802, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9819
</th>
<th>
Krovak
</th>
<th>
8811, 8833, 1036, 8818, 8819, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9820
</th>
<th>
Lambert Azimuthal Equal Area
</th>
<th>
8801, 8802, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9822
</th>
<th>
Albers Equal Area
</th>
<th>
8821, 8822, 8823, 8824, 8826, 8827
</th>
</tr>
<tr>
<th scope="row">
9824
</th>
<th>
Transverse Mercator Zoned Grid System
</th>
<th>
8801, 8830, 8831, 8805, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9826
</th>
<th>
Lambert Conic Conformal (West Orientated)
</th>
<th>
8801, 8802, 8805, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9828
</th>
<th>
Bonne (South Orientated)
</th>
<th>
8801, 8802, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9829
</th>
<th>
Polar Stereographic (variant B)
</th>
<th>
8832, 8833, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9830
</th>
<th>
Polar Stereographic (variant C)
</th>
<th>
8832, 8833, 8826, 8827
</th>
</tr>
<tr>
<th scope="row">
9831
</th>
<th>
Guam Projection
</th>
<th>
8801, 8802, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9832
</th>
<th>
Modified Azimuthal Equidistant
</th>
<th>
8801, 8802, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9833
</th>
<th>
Hyperbolic Cassini-Soldner
</th>
<th>
8801, 8802, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9834
</th>
<th>
Lambert Cylindrical Equal Area (Spherical)
</th>
<th>
8823, 8802, 8806, 8807
</th>
</tr>
<tr>
<th scope="row">
9835
</th>
<td>
Lambert Cylindrical Equal Area
</td>
<td>
8823, 8802, 8806, 8807
</td>
</tr>
</tbody>
</table>
</div>
<div class="table-contents">
<table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
<thead>
<tr>
<th scope="col" style="width: 81.9844px;">
EPSG Code
</th>
<th scope="col" style="width: 369px;">
Projection Name
</th>
<th scope="col" style="width: 287.016px;">
Mandatory Parameters (EPSG Codes)
</th>
</tr>
</thead>
</table>
</div>
</div>
<br class="table-break"/>
<p>
The following table shows the projection parameters that MySQL
recognizes. Recognition occurs primarily by authority code. If
there is no authority code, MySQL falls back to case-insensitive
string matching on the parameter name. For details about each
parameter, look it up by code in the
<a class="ulink" href="https://www.epsg-registry.org" target="_blank">
EPSG Online
Registry
</a>
.
</p>
<div class="table">
<a name="srs-projection-parameters-table">
</a>
<p class="title">
<b>
Table 15.8 Spatial Reference System Projection Parameters
</b>
</p>
<div class="table-contents">
<table summary="Spatial reference system projection codes, fallback names, and EPSG names.">
<colgroup>
<col style="width: 10%"/>
<col style="width: 45%"/>
<col style="width: 35%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
EPSG Code
</th>
<th scope="col">
Fallback Name (Recognized by MySQL)
</th>
<th scope="col">
EPSG Name
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
1026
</th>
<th>
c1
</th>
<th>
C1
</th>
</tr>
<tr>
<th scope="row">
1027
</th>
<th>
c2
</th>
<th>
C2
</th>
</tr>
<tr>
<th scope="row">
1028
</th>
<th>
c3
</th>
<th>
C3
</th>
</tr>
<tr>
<th scope="row">
1029
</th>
<th>
c4
</th>
<th>
C4
</th>
</tr>
<tr>
<th scope="row">
1030
</th>
<th>
c5
</th>
<th>
C5
</th>
</tr>
<tr>
<th scope="row">
1031
</th>
<th>
c6
</th>
<th>
C6
</th>
</tr>
<tr>
<th scope="row">
1032
</th>
<th>
c7
</th>
<th>
C7
</th>
</tr>
<tr>
<th scope="row">
1033
</th>
<th>
c8
</th>
<th>
C8
</th>
</tr>
<tr>
<th scope="row">
1034
</th>
<th>
c9
</th>
<th>
C9
</th>
</tr>
<tr>
<th scope="row">
1035
</th>
<th>
c10
</th>
<th>
C10
</th>
</tr>
<tr>
<th scope="row">
1036
</th>
<th>
azimuth
</th>
<th>
Co-latitude of cone axis
</th>
</tr>
<tr>
<th scope="row">
1038
</th>
<th>
ellipsoid_scale_factor
</th>
<th>
Ellipsoid scaling factor
</th>
</tr>
<tr>
<th scope="row">
1039
</th>
<th>
projection_plane_height_at_origin
</th>
<th>
Projection plane origin height
</th>
</tr>
<tr>
<th scope="row">
8617
</th>
<th>
evaluation_point_ordinate_1
</th>
<th>
Ordinate 1 of evaluation point
</th>
</tr>
<tr>
<th scope="row">
8618
</th>
<th>
evaluation_point_ordinate_2
</th>
<th>
Ordinate 2 of evaluation point
</th>
</tr>
<tr>
<th scope="row">
8801
</th>
<th>
latitude_of_origin
</th>
<th>
Latitude of natural origin
</th>
</tr>
<tr>
<th scope="row">
8802
</th>
<th>
central_meridian
</th>
<th>
Longitude of natural origin
</th>
</tr>
<tr>
<th scope="row">
8805
</th>
<th>
scale_factor
</th>
<th>
Scale factor at natural origin
</th>
</tr>
<tr>
<th scope="row">
8806
</th>
<th>
false_easting
</th>
<th>
False easting
</th>
</tr>
<tr>
<th scope="row">
8807
</th>
<th>
false_northing
</th>
<th>
False northing
</th>
</tr>
<tr>
<th scope="row">
8811
</th>
<th>
latitude_of_center
</th>
<th>
Latitude of projection centre
</th>
</tr>
<tr>
<th scope="row">
8812
</th>
<th>
longitude_of_center
</th>
<th>
Longitude of projection centre
</th>
</tr>
<tr>
<th scope="row">
8813
</th>
<th>
azimuth
</th>
<th>
Azimuth of initial line
</th>
</tr>
<tr>
<th scope="row">
8814
</th>
<th>
rectified_grid_angle
</th>
<th>
Angle from Rectified to Skew Grid
</th>
</tr>
<tr>
<th scope="row">
8815
</th>
<th>
scale_factor
</th>
<th>
Scale factor on initial line
</th>
</tr>
<tr>
<th scope="row">
8816
</th>
<th>
false_easting
</th>
<th>
Easting at projection centre
</th>
</tr>
<tr>
<th scope="row">
8817
</th>
<th>
false_northing
</th>
<th>
Northing at projection centre
</th>
</tr>
<tr>
<th scope="row">
8818
</th>
<th>
pseudo_standard_parallel_1
</th>
<th>
Latitude of pseudo standard parallel
</th>
</tr>
<tr>
<th scope="row">
8819
</th>
<th>
scale_factor
</th>
<th>
Scale factor on pseudo standard parallel
</th>
</tr>
<tr>
<th scope="row">
8821
</th>
<th>
latitude_of_origin
</th>
<th>
Latitude of false origin
</th>
</tr>
<tr>
<th scope="row">
8822
</th>
<th>
central_meridian
</th>
<th>
Longitude of false origin
</th>
</tr>
<tr>
<th scope="row">
8823
</th>
<th>
standard_parallel_1, standard_parallel1
</th>
<th>
Latitude of 1st standard parallel
</th>
</tr>
<tr>
<th scope="row">
8824
</th>
<th>
standard_parallel_2, standard_parallel2
</th>
<th>
Latitude of 2nd standard parallel
</th>
</tr>
<tr>
<th scope="row">
8826
</th>
<th>
false_easting
</th>
<th>
Easting at false origin
</th>
</tr>
<tr>
<th scope="row">
8827
</th>
<th>
false_northing
</th>
<th>
Northing at false origin
</th>
</tr>
<tr>
<th scope="row">
8830
</th>
<th>
initial_longitude
</th>
<th>
Initial longitude
</th>
</tr>
<tr>
<th scope="row">
8831
</th>
<th>
zone_width
</th>
<th>
Zone width
</th>
</tr>
<tr>
<th scope="row">
8832
</th>
<th>
standard_parallel
</th>
<th>
Latitude of standard parallel
</th>
</tr>
<tr>
<th scope="row">
8833
</th>
<td>
longitude_of_center
</td>
<td>
Longitude of origin
</td>
</tr>
</tbody>
</table>
</div>
<div class="table-contents">
<table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
<thead>
<tr>
<th scope="col" style="width: 81.9844px;">
EPSG Code
</th>
<th scope="col" style="width: 369px;">
Fallback Name (Recognized by MySQL)
</th>
<th scope="col" style="width: 287.016px;">
EPSG Name
</th>
</tr>
</thead>
</table>
</div>
</div>
<br class="table-break"/>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/date-and-time-type-syntax.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="date-and-time-type-syntax">
</a>
13.2.1 Date and Time Data Type Syntax
</h3>
</div>
</div>
</div>
<p>
The date and time data types for representing temporal values
are
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATE
</code>
</a>
,
<a class="link" href="time.html" title="13.2.3 The TIME Type">
<code class="literal">
TIME
</code>
</a>
,
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATETIME
</code>
</a>
,
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
, and
<a class="link" href="year.html" title="13.2.4 The YEAR Type">
<code class="literal">
YEAR
</code>
</a>
.
</p>
<p>
For the
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATE
</code>
</a>
and
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATETIME
</code>
</a>
range descriptions,
<span class="quote">
“
<span class="quote">
supported
</span>
”
</span>
means that although earlier values
might work, there is no guarantee.
</p>
<a class="indexterm" name="idm46045213780064">
</a>
<a class="indexterm" name="idm46045213778976">
</a>
<p>
MySQL permits fractional seconds for
<a class="link" href="time.html" title="13.2.3 The TIME Type">
<code class="literal">
TIME
</code>
</a>
,
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATETIME
</code>
</a>
, and
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
values, with up to
microseconds (6 digits) precision. To define a column that
includes a fractional seconds part, use the syntax
<code class="literal">
<em class="replaceable">
<code>
type_name
</code>
</em>
(
<em class="replaceable">
<code>
fsp
</code>
</em>
)
</code>
,
where
<em class="replaceable">
<code>
type_name
</code>
</em>
is
<a class="link" href="time.html" title="13.2.3 The TIME Type">
<code class="literal">
TIME
</code>
</a>
,
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATETIME
</code>
</a>
, or
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
, and
<em class="replaceable">
<code>
fsp
</code>
</em>
is the fractional seconds
precision. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa42011298"><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">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>t <span class="token function">TIME</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">,</span> dt <span class="token datatype">DATETIME</span><span class="token punctuation">(</span><span class="token number">6</span><span class="token punctuation">)</span><span class="token punctuation">,</span> ts <span class="token function">TIMESTAMP</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The
<em class="replaceable">
<code>
fsp
</code>
</em>
value, if given, must be in
the range 0 to 6. A value of 0 signifies that there is no
fractional part. If omitted, the default precision is 0. (This
differs from the standard SQL default of 6, for compatibility
with previous MySQL versions.)
</p>
<p>
Any
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
or
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATETIME
</code>
</a>
column in a table can
have automatic initialization and updating properties; see
<a class="xref" href="timestamp-initialization.html" title="13.2.5 Automatic Initialization and Updating for TIMESTAMP and DATETIME">
Section 13.2.5, “Automatic Initialization and Updating for TIMESTAMP and DATETIME”
</a>
.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="indexterm" name="idm46045213758688">
</a>
<a class="indexterm" name="idm46045213757616">
</a>
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATE
</code>
</a>
</p>
<p>
A date. The supported range is
<code class="literal">
'1000-01-01'
</code>
to
<code class="literal">
'9999-12-31'
</code>
. MySQL displays
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATE
</code>
</a>
values in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
</code>
</em>
'
</code>
format, but permits assignment of values to
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATE
</code>
</a>
columns using either
strings or numbers.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045213746720">
</a>
<a class="indexterm" name="idm46045213745648">
</a>
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATETIME[(
<em class="replaceable">
<code>
fsp
</code>
</em>
)]
</code>
</a>
</p>
<p>
A date and time combination. The supported range is
<code class="literal">
'1000-01-01 00:00:00.000000'
</code>
to
<code class="literal">
'9999-12-31 23:59:59.499999'
</code>
. MySQL
displays
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATETIME
</code>
</a>
values in
<code class="literal">
'
<em class="replaceable">
<code>
YYYY-MM-DD
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format, but permits assignment of values to
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATETIME
</code>
</a>
columns using either
strings or numbers.
</p>
<p>
An optional
<em class="replaceable">
<code>
fsp
</code>
</em>
value in the
range from 0 to 6 may be given to specify fractional seconds
precision. A value of 0 signifies that there is no
fractional part. If omitted, the default precision is 0.
</p>
<p>
Automatic initialization and updating to the current date
and time for
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
DATETIME
</code>
</a>
columns
can be specified using
<code class="literal">
DEFAULT
</code>
and
<code class="literal">
ON UPDATE
</code>
column definition clauses, as
described in
<a class="xref" href="timestamp-initialization.html" title="13.2.5 Automatic Initialization and Updating for TIMESTAMP and DATETIME">
Section 13.2.5, “Automatic Initialization and Updating for TIMESTAMP and DATETIME”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045213728176">
</a>
<a class="indexterm" name="idm46045213727104">
</a>
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP[(
<em class="replaceable">
<code>
fsp
</code>
</em>
)]
</code>
</a>
</p>
<a class="indexterm" name="idm46045213723904">
</a>
<p>
A timestamp. The range is
<code class="literal">
'1970-01-01
00:00:01.000000'
</code>
UTC to
<code class="literal">
'2038-01-19
03:14:07.499999'
</code>
UTC.
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
values are stored
as the number of seconds since the epoch
(
<code class="literal">
'1970-01-01 00:00:00'
</code>
UTC). A
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
cannot represent
the value
<code class="literal">
'1970-01-01 00:00:00'
</code>
because
that is equivalent to 0 seconds from the epoch and the value
0 is reserved for representing
<code class="literal">
'0000-00-00
00:00:00'
</code>
, the
<span class="quote">
“
<span class="quote">
zero
</span>
”
</span>
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
value.
</p>
<p>
An optional
<em class="replaceable">
<code>
fsp
</code>
</em>
value in the
range from 0 to 6 may be given to specify fractional seconds
precision. A value of 0 signifies that there is no
fractional part. If omitted, the default precision is 0.
</p>
<p>
The way the server handles
<code class="literal">
TIMESTAMP
</code>
definitions depends on the value of the
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
system variable (see
<a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
Section 7.1.8, “Server System Variables”
</a>
).
</p>
<p>
If
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
is enabled, there is no automatic assignment of the
<code class="literal">
DEFAULT CURRENT_TIMESTAMP
</code>
or
<code class="literal">
ON
UPDATE CURRENT_TIMESTAMP
</code>
attributes to any
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
column. They must
be included explicitly in the column definition. Also, any
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
not explicitly
declared as
<code class="literal">
NOT NULL
</code>
permits
<code class="literal">
NULL
</code>
values.
</p>
<p>
If
<a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
<code class="literal">
explicit_defaults_for_timestamp
</code>
</a>
is disabled, the server handles
<code class="literal">
TIMESTAMP
</code>
as follows:
</p>
<p>
Unless specified otherwise, the first
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
column in a table
is defined to be automatically set to the date and time of
the most recent modification if not explicitly assigned a
value. This makes
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
useful for recording the timestamp of an
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
or
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
operation. You can
also set any
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
column
to the current date and time by assigning it a
<code class="literal">
NULL
</code>
value, unless it has been defined
with the
<code class="literal">
NULL
</code>
attribute to permit
<code class="literal">
NULL
</code>
values.
</p>
<p>
Automatic initialization and updating to the current date
and time can be specified using
<code class="literal">
DEFAULT
CURRENT_TIMESTAMP
</code>
and
<code class="literal">
ON UPDATE
CURRENT_TIMESTAMP
</code>
column definition clauses. By
default, the first
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
column has these properties, as previously noted. However,
any
<a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
<code class="literal">
TIMESTAMP
</code>
</a>
column in a
table can be defined to have these properties.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045213683376">
</a>
<a class="indexterm" name="idm46045213682304">
</a>
<a class="link" href="time.html" title="13.2.3 The TIME Type">
<code class="literal">
TIME[(
<em class="replaceable">
<code>
fsp
</code>
</em>
)]
</code>
</a>
</p>
<p>
A time. The range is
<code class="literal">
'-838:59:59.000000'
</code>
to
<code class="literal">
'838:59:59.000000'
</code>
. MySQL displays
<a class="link" href="time.html" title="13.2.3 The TIME Type">
<code class="literal">
TIME
</code>
</a>
values in
<code class="literal">
'
<em class="replaceable">
<code>
hh:mm:ss
</code>
</em>
[.
<em class="replaceable">
<code>
fraction
</code>
</em>
]'
</code>
format, but permits assignment of values to
<a class="link" href="time.html" title="13.2.3 The TIME Type">
<code class="literal">
TIME
</code>
</a>
columns using either
strings or numbers.
</p>
<p>
An optional
<em class="replaceable">
<code>
fsp
</code>
</em>
value in the
range from 0 to 6 may be given to specify fractional seconds
precision. A value of 0 signifies that there is no
fractional part. If omitted, the default precision is 0.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045213669584">
</a>
<a class="indexterm" name="idm46045213668512">
</a>
<a class="link" href="year.html" title="13.2.4 The YEAR Type">
<code class="literal">
YEAR[(4)]
</code>
</a>
</p>
<p>
A year in 4-digit format. MySQL displays
<a class="link" href="year.html" title="13.2.4 The YEAR Type">
<code class="literal">
YEAR
</code>
</a>
values in
<em class="replaceable">
<code>
YYYY
</code>
</em>
format, but permits
assignment of values to
<a class="link" href="year.html" title="13.2.4 The YEAR Type">
<code class="literal">
YEAR
</code>
</a>
columns using either strings or numbers. Values display as
<code class="literal">
1901
</code>
to
<code class="literal">
2155
</code>
, or
<code class="literal">
0000
</code>
.
</p>
<p>
For additional information about
<a class="link" href="year.html" title="13.2.4 The YEAR Type">
<code class="literal">
YEAR
</code>
</a>
display format and
interpretation of input values, see
<a class="xref" href="year.html" title="13.2.4 The YEAR Type">
Section 13.2.4, “The YEAR Type”
</a>
.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
The
<a class="link" href="year.html" title="13.2.4 The YEAR Type">
<code class="literal">
YEAR(4)
</code>
</a>
data type with
an explicit display width is deprecated; you should expect
support for it to be removed in a future version of MySQL.
Instead, use
<a class="link" href="year.html" title="13.2.4 The YEAR Type">
<code class="literal">
YEAR
</code>
</a>
without a
display width, which has the same meaning.
</p>
</div>
</li>
</ul>
</div>
<p>
The
<a class="link" href="aggregate-functions.html#function_sum">
<code class="literal">
SUM()
</code>
</a>
and
<a class="link" href="aggregate-functions.html#function_avg">
<code class="literal">
AVG()
</code>
</a>
aggregate functions do not
work with temporal values. (They convert the values to numbers,
losing everything after the first nonnumeric character.) To work
around this problem, convert to numeric units, perform the
aggregate operation, and convert back to a temporal value.
Examples:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa52181519"><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">SELECT</span> <span class="token function">SEC_TO_TIME</span><span class="token punctuation">(</span><span class="token function">SUM</span><span class="token punctuation">(</span><span class="token function">TIME_TO_SEC</span><span class="token punctuation">(</span><em class="replaceable">time_col</em><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> <em class="replaceable">tbl_name</em><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token function">FROM_DAYS</span><span class="token punctuation">(</span><span class="token function">SUM</span><span class="token punctuation">(</span><span class="token function">TO_DAYS</span><span class="token punctuation">(</span><em class="replaceable">date_col</em><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> <em class="replaceable">tbl_name</em><span class="token punctuation">;</span></code></pre>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/group-replication-restarting-group.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="group-replication-restarting-group">
</a>
20.5.2 Restarting a Group
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045133439136">
</a>
<p>
Group Replication is designed to ensure that the database service
is continuously available, even if some of the servers that form
the group are currently unable to participate in it due to planned
maintenance or unplanned issues. As long as the remaining members
are a majority of the group they can elect a new primary and
continue to function as a group. However, if every member of a
replication group leaves the group, and Group Replication is
stopped on every member by a
<a class="link" href="stop-group-replication.html" title="15.4.3.2 STOP GROUP_REPLICATION Statement">
<code class="literal">
STOP
GROUP_REPLICATION
</code>
</a>
statement or system shutdown, the
group now only exists in theory, as a configuration on the
members. In that situation, to re-create the group, it must be
started by bootstrapping as if it was being started for the first
time.
</p>
<p>
The difference between bootstrapping a group for the first time
and doing it for the second or subsequent times is that in the
latter situation, the members of a group that was shut down might
have different transaction sets from each other, depending on the
order in which they were stopped or failed. A member cannot join a
group if it has transactions that are not present on the other
group members. For Group Replication, this includes both
transactions that have been committed and applied, which are in
the
<a class="link" href="replication-options-gtids.html#sysvar_gtid_executed">
<code class="literal">
gtid_executed
</code>
</a>
GTID set, and
transactions that have been certified but not yet applied, which
are in the
<code class="literal">
group_replication_applier
</code>
channel.
The exact point at which a transaction is committed depends on the
transaction consistency level that is set for the group (see
<a class="xref" href="group-replication-consistency-guarantees.html" title="20.5.3 Transaction Consistency Guarantees">
Section 20.5.3, “Transaction Consistency Guarantees”
</a>
).
However, a Group Replication group member never removes a
transaction that has been certified, which is a declaration of the
member’s intent to commit the transaction.
</p>
<p>
The replication group must therefore be restarted beginning with
the most up to date member, that is, the member that has the most
transactions executed and certified. The members with fewer
transactions can then join and catch up with the transactions they
are missing through distributed recovery. It is not correct to
assume that the last known primary member of the group is the most
up to date member of the group, because a member that was shut
down later than the primary might have more transactions. You must
therefore restart each member to check the transactions, compare
all the transaction sets, and identify the most up to date member.
This member can then be used to bootstrap the group.
</p>
<p>
Follow this procedure to restart a replication group safely after
every member shuts down.
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
For each group member in turn, in any order:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="a">
<li class="listitem">
<p>
Connect a client to the group member. If Group Replication
is not already stopped, issue a
<a class="link" href="stop-group-replication.html" title="15.4.3.2 STOP GROUP_REPLICATION Statement">
<code class="literal">
STOP
GROUP_REPLICATION
</code>
</a>
statement and wait for Group
Replication to stop.
</p>
</li>
<li class="listitem">
<p>
Edit the MySQL Server configuration file (typically named
<code class="filename">
my.cnf
</code>
on Linux and Unix systems, or
<code class="filename">
my.ini
</code>
on Windows systems) and set
the system variable
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_start_on_boot">
<code class="literal">
group_replication_start_on_boot=OFF
</code>
</a>
.
This setting prevents Group Replication from starting when
MySQL Server is started, which is the default.
</p>
<p>
If you cannot change that setting on the system, you can
just allow the server to attempt to start Group
Replication, which will fail because the group has been
fully shut down and not yet bootstrapped. If you take that
approach, do not set
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_bootstrap_group">
<code class="literal">
group_replication_bootstrap_group=ON
</code>
</a>
on any server at this stage.
</p>
</li>
<li class="listitem">
<p>
Start the MySQL Server instance, and verify that Group
Replication has not been started (or has failed to start).
Do not start Group Replication at this stage.
</p>
</li>
<li class="listitem">
<p>
Collect the following information from the group member:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The contents of the
<a class="link" href="replication-options-gtids.html#sysvar_gtid_executed">
<code class="literal">
gtid_executed
</code>
</a>
GTID
set. You can get this by issuing the following
statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa55063351"><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></span> <span class="token keyword">SELECT</span> <span class="token variable">@@GLOBAL.GTID_EXECUTED</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
The set of certified transactions on the
<code class="literal">
group_replication_applier
</code>
channel.
You can get this by issuing the following statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa45808774"><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></span> <span class="token keyword">SELECT</span> received_transaction_set <span class="token keyword">FROM</span> \
performance_schema<span class="token punctuation">.</span>replication_connection_status <span class="token keyword">WHERE</span> \
channel_name<span class="token operator">=</span><span class="token string">"group_replication_applier"</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
</ul>
</div>
</li>
</ol>
</div>
</li>
<li class="listitem">
<p>
When you have collected the transaction sets from all the
group members, compare them to find which member has the
biggest transaction set overall, including both the executed
transactions (
<a class="link" href="replication-options-gtids.html#sysvar_gtid_executed">
<code class="literal">
gtid_executed
</code>
</a>
)
and the certified transactions (on the
<code class="literal">
group_replication_applier
</code>
channel). You can
do this manually by looking at the GTIDs, or you can compare
the GTID sets using stored functions, as described in
<a class="xref" href="replication-gtids-functions.html" title="19.1.3.8 Stored Function Examples to Manipulate GTIDs">
Section 19.1.3.8, “Stored Function Examples to Manipulate GTIDs”
</a>
.
</p>
</li>
<li class="listitem">
<p>
Use the member that has the biggest transaction set to
bootstrap the group, by connecting a client to the group
member and issuing the following statements:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa88989486"><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></span> <span class="token keyword">SET</span> <span class="token keyword">GLOBAL</span> group_replication_bootstrap_group<span class="token operator">=</span><span class="token keyword">ON</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">START</span> <span class="token keyword">GROUP_REPLICATION</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SET</span> <span class="token keyword">GLOBAL</span> group_replication_bootstrap_group<span class="token operator">=</span><span class="token keyword">OFF</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
It is important not to store the setting
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_bootstrap_group">
<code class="literal">
group_replication_bootstrap_group=ON
</code>
</a>
in the configuration file, otherwise when the server is
restarted again, a second group with the same name is set up.
</p>
</li>
<li class="listitem">
<p>
To verify that the group now exists with this founder member
in it, issue this statement on the member that bootstrapped
it:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa40705729"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>replication_group_members<span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Add each of the other members back into the group, in any
order, by issuing a
<a class="link" href="start-group-replication.html" title="15.4.3.1 START GROUP_REPLICATION Statement">
<code class="literal">
START
GROUP_REPLICATION
</code>
</a>
statement on each of them:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa35040007"><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></span> <span class="token keyword">START</span> <span class="token keyword">GROUP_REPLICATION</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
To verify that each member has joined the group, issue this
statement on any member:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa10213592"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>replication_group_members<span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
When the members have rejoined the group, if you edited their
configuration files to set
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_start_on_boot">
<code class="literal">
group_replication_start_on_boot=OFF
</code>
</a>
,
you can edit them again to set
<code class="literal">
ON
</code>
(or
remove the system variable, since
<code class="literal">
ON
</code>
is the
default).
</p>
</li>
</ol>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/mysql-shell-tutorial-python-documents-index.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="mysql-shell-tutorial-python-documents-index">
</a>
22.4.3.6 Create and Drop Indexes
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045126989920">
</a>
<p>
Indexes are used to find documents with specific field values
quickly. Without an index, MySQL must begin with the first
document and then read through the entire collection to find the
relevant fields. The larger the collection, the more this costs.
If a collection is large and queries on a specific field are
common, then consider creating an index on a specific field
inside a document.
</p>
<p>
For example, the following query performs better with an index
on the Population field:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa77747666"><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-mysqlsh"><span class="token prompt">mysql-py></span> db<span class="token punctuation">.</span>countryinfo<span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token string">"demographics.Population < 100"</span><span class="token punctuation">)</span>
<span class="token operator">...</span><span class="token punctuation">[</span><em>output removed</em><span class="token punctuation">]</span>
<span class="token output">8 documents in set (0.00 sec)</span></code></pre>
</div>
<p>
The
<code class="literal">
create_index()
</code>
method creates an index
that you can define with a JSON document that specifies which
fields to use. This section is a high level overview of
indexing. For more information see
<a class="ulink" href="/doc/x-devapi-userguide/en/collection-indexing.html" target="_top">
Indexing Collections
</a>
.
</p>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="mysql-shell-tutorial-python-nonunique-index">
</a>
Add a Nonunique Index
</h5>
</div>
</div>
</div>
<a class="indexterm" name="idm46045126981568">
</a>
<p>
To create a nonunique index, pass an index name and the index
information to the
<code class="literal">
create_index()
</code>
method.
Duplicate index names are prohibited.
</p>
<p>
The following example specifies an index named
<code class="literal">
popul
</code>
, defined against the
<code class="literal">
Population
</code>
field from the
<code class="literal">
demographics
</code>
object, indexed as an
<code class="literal">
Integer
</code>
numeric value. The final parameter
indicates whether the field should require the
<code class="literal">
NOT
NULL
</code>
constraint. If the value is
<code class="literal">
false
</code>
, the field can contain
<code class="literal">
NULL
</code>
values. The index information is a
JSON document with details of one or more fields to include in
the index. Each field definition must include the full
document path to the field, and specify the type of the field.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa10732819"><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-mysqlsh"><span class="token prompt">mysql-py></span> db<span class="token punctuation">.</span>countryinfo<span class="token punctuation">.</span><span class="token function">createIndex</span><span class="token punctuation">(</span><span class="token string">"popul"</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>fields<span class="token punctuation">:</span>
<span class="token punctuation">[</span><span class="token punctuation">{</span>field<span class="token punctuation">:</span> <span class="token string">'$.demographics.Population'</span><span class="token punctuation">,</span> type<span class="token punctuation">:</span> <span class="token string">'INTEGER'</span><span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">}</span><span class="token punctuation">)</span></code></pre>
</div>
<p>
Here, the index is created using an integer numeric value.
Further options are available, including options for use with
GeoJSON data. You can also specify the type of index, which
has been omitted here because the default type
<span class="quote">
“
<span class="quote">
index
</span>
”
</span>
is appropriate.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="mysql-shell-tutorial-python-unique-index">
</a>
Add a Unique Index
</h5>
</div>
</div>
</div>
<a class="indexterm" name="idm46045126968736">
</a>
<p>
To create a unique index, pass an index name, the index
definition, and the index type
<span class="quote">
“
<span class="quote">
unique
</span>
”
</span>
to the
<code class="literal">
create_index()
</code>
method. This example shows a
unique index created on the country name
(
<code class="literal">
"Name"
</code>
), which is another common field in
the
<code class="literal">
countryinfo
</code>
collection to index. In the
index field description,
<code class="literal">
"TEXT(40)"
</code>
represents the number of characters to index, and
<code class="literal">
"required": True
</code>
specifies that the field
is required to exist in the document.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa34610087"><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-mysqlsh"><span class="token prompt">mysql-py></span> db<span class="token punctuation">.</span>countryinfo<span class="token punctuation">.</span><span class="token function">create_index</span><span class="token punctuation">(</span><span class="token string">"name"</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span><span class="token string">"fields"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span><span class="token string">"field"</span><span class="token punctuation">:</span> <span class="token string">"$.Name"</span><span class="token punctuation">,</span> <span class="token string">"type"</span><span class="token punctuation">:</span> <span class="token string">"TEXT(40)"</span><span class="token punctuation">,</span> <span class="token string">"required"</span><span class="token punctuation">:</span> True<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token string">"unique"</span><span class="token punctuation">:</span> True<span class="token punctuation">}</span><span class="token punctuation">)</span></code></pre>
</div>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="mysql-shell-tutorial-python-drop-index">
</a>
Drop an Index
</h5>
</div>
</div>
</div>
<a class="indexterm" name="idm46045126959408">
</a>
<p>
To drop an index, pass the name of the index to drop to the
<code class="literal">
drop_index()
</code>
method. For example, you can
drop the
<span class="quote">
“
<span class="quote">
popul
</span>
”
</span>
index as follows:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-mysqlsh"><div class="docs-select-all right" id="sa92279514"><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-mysqlsh"><span class="token prompt">mysql-py></span> db<span class="token punctuation">.</span>countryinfo<span class="token punctuation">.</span><span class="token function">drop_index</span><span class="token punctuation">(</span><span class="token string">"popul"</span><span class="token punctuation">)</span></code></pre>
</div>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="idm46045126954464">
</a>
Related Information
</h5>
</div>
</div>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
See
<a class="ulink" href="/doc/x-devapi-userguide/en/collection-indexing.html" target="_top">
Indexing Collections
</a>
for more
information.
</p>
</li>
<li class="listitem">
<p>
See
<a class="ulink" href="/doc/x-devapi-userguide/en/collection-indexing.html#collection-index-definitions" target="_top">
Defining an Index
</a>
for
more information on the JSON document that defines an
index.
</p>
</li>
<li class="listitem">
<p>
See
<a class="ulink" href="/doc/x-devapi-userguide/en/crud-ebnf-collection-index-management-functions.html" target="_top">
Collection Index Management Functions
</a>
for the full syntax definition.
</p>
</li>
</ul>
</div>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/innodb-performance-compression-oltp.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="innodb-performance-compression-oltp">
</a>
17.9.1.6 Compression for OLTP Workloads
</h4>
</div>
</div>
</div>
<p>
Traditionally, the
<code class="literal">
InnoDB
</code>
<a class="link" href="glossary.html#glos_compression" title="compression">
compression
</a>
feature was
recommended primarily for read-only or read-mostly
<a class="link" href="glossary.html#glos_workload" title="workload">
workloads
</a>
, such as in a
<a class="link" href="glossary.html#glos_data_warehouse" title="data warehouse">
data warehouse
</a>
configuration. The rise of
<a class="link" href="glossary.html#glos_ssd" title="SSD">
SSD
</a>
storage devices, which are fast but relatively small and
expensive, makes compression attractive also for
<code class="literal">
OLTP
</code>
workloads: high-traffic, interactive
websites can reduce their storage requirements and their I/O
operations per second (
<a class="link" href="glossary.html#glos_iops" title="IOPS">
IOPS
</a>
) by
using compressed tables with applications that do frequent
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
,
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
, and
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
operations.
</p>
<p>
These configuration options let you adjust the way compression
works for a particular MySQL instance, with an emphasis on
performance and scalability for write-intensive operations:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="link" href="innodb-parameters.html#sysvar_innodb_compression_level">
<code class="literal">
innodb_compression_level
</code>
</a>
lets you turn the degree of compression up or down. A higher
value lets you fit more data onto a storage device, at the
expense of more CPU overhead during compression. A lower
value lets you reduce CPU overhead when storage space is not
critical, or you expect the data is not especially
compressible.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="innodb-parameters.html#sysvar_innodb_compression_failure_threshold_pct">
<code class="literal">
innodb_compression_failure_threshold_pct
</code>
</a>
specifies a cutoff point for
<a class="link" href="glossary.html#glos_compression_failure" title="compression failure">
compression
failures
</a>
during updates to a compressed table. When
this threshold is passed, MySQL begins to leave additional
free space within each new compressed page, dynamically
adjusting the amount of free space up to the percentage of
page size specified by
<a class="link" href="innodb-parameters.html#sysvar_innodb_compression_pad_pct_max">
<code class="literal">
innodb_compression_pad_pct_max
</code>
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="innodb-parameters.html#sysvar_innodb_compression_pad_pct_max">
<code class="literal">
innodb_compression_pad_pct_max
</code>
</a>
lets you adjust the maximum amount of space reserved within
each
<a class="link" href="glossary.html#glos_page" title="page">
page
</a>
to record changes
to compressed rows, without needing to compress the entire
page again. The higher the value, the more changes can be
recorded without recompressing the page. MySQL uses a
variable amount of free space for the pages within each
compressed table, only when a designated percentage of
compression operations
<span class="quote">
“
<span class="quote">
<a class="link" href="glossary.html#glos_compression_failure" title="compression failure">
fail
</a>
</span>
”
</span>
at runtime, requiring an expensive operation to split the
compressed page.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="innodb-parameters.html#sysvar_innodb_log_compressed_pages">
<code class="literal">
innodb_log_compressed_pages
</code>
</a>
lets you disable writing of images of
<a class="link" href="glossary.html#glos_compression" title="compression">
re-compressed
</a>
<a class="link" href="glossary.html#glos_page" title="page">
pages
</a>
to the
<a class="link" href="glossary.html#glos_redo_log" title="redo log">
redo log
</a>
.
Re-compression may occur when changes are made to compressed
data. This option is enabled by default to prevent
corruption that could occur if a different version of the
<code class="literal">
zlib
</code>
compression algorithm is used during
recovery. If you are certain that the
<code class="literal">
zlib
</code>
version is not subject to change,
disable
<a class="link" href="innodb-parameters.html#sysvar_innodb_log_compressed_pages">
<code class="literal">
innodb_log_compressed_pages
</code>
</a>
to reduce redo log generation for workloads that modify
compressed data.
</p>
</li>
</ul>
</div>
<p>
Because working with compressed data sometimes involves keeping
both compressed and uncompressed versions of a page in memory at
the same time, when using compression with an OLTP-style
workload, be prepared to increase the value of the
<a class="link" href="innodb-parameters.html#sysvar_innodb_buffer_pool_size">
<code class="literal">
innodb_buffer_pool_size
</code>
</a>
configuration option.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/perl-support.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="perl-support">
</a>
2.10 Perl Installation Notes
</h2>
</div>
</div>
</div>
<div class="toc">
<dl class="toc">
<dt>
<span class="section">
<a href="perl-installation.html">
2.10.1 Installing Perl on Unix
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="activestate-perl.html">
2.10.2 Installing ActiveState Perl on Windows
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="perl-support-problems.html">
2.10.3 Problems Using the Perl DBI/DBD Interface
</a>
</span>
</dt>
</dl>
</div>
<a class="indexterm" name="idm46045326528176">
</a>
<a class="indexterm" name="idm46045326526688">
</a>
<p>
The Perl
<code class="literal">
DBI
</code>
module provides a generic interface
for database access. You can write a
<code class="literal">
DBI
</code>
script
that works with many different database engines without change. To
use
<code class="literal">
DBI
</code>
, you must install the
<code class="literal">
DBI
</code>
module, as well as a DataBase Driver (DBD)
module for each type of database server you want to access. For
MySQL, this driver is the
<code class="literal">
DBD::mysql
</code>
module.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Perl support is not included with MySQL distributions. You can
obtain the necessary modules from
<a class="ulink" href="http://search.cpan.org" target="_blank">
http://search.cpan.org
</a>
for Unix, or by using the
ActiveState
<span class="command">
<strong>
ppm
</strong>
</span>
program on Windows. The
following sections describe how to do this.
</p>
</div>
<p>
The
<code class="literal">
DBI
</code>
/
<code class="literal">
DBD
</code>
interface requires
Perl 5.6.0, and 5.6.1 or later is preferred. DBI
<span class="emphasis">
<em>
does not
work
</em>
</span>
if you have an older version of Perl. You should use
<code class="literal">
DBD::mysql
</code>
4.009 or higher. Although earlier
versions are available, they do not support the full functionality
of MySQL 8.4.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/window-function-restrictions.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="window-function-restrictions">
</a>
14.20.5 Window Function Restrictions
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045191730624">
</a>
<a class="indexterm" name="idm46045191729136">
</a>
<p>
The SQL standard imposes a constraint on window functions that
they cannot be used in
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
or
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
statements to update rows.
Using such functions in a subquery of these statements (to
select rows) is permitted.
</p>
<p>
MySQL does not support these window function features:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
DISTINCT
</code>
syntax for aggregate window
functions.
</p>
</li>
<li class="listitem">
<p>
Nested window functions.
</p>
</li>
<li class="listitem">
<p>
Dynamic frame endpoints that depend on the value of the
current row.
</p>
</li>
</ul>
</div>
<p>
The parser recognizes these window constructs which nevertheless
are not supported:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The
<code class="literal">
GROUPS
</code>
frame units specifier is
parsed, but produces an error. Only
<code class="literal">
ROWS
</code>
and
<code class="literal">
RANGE
</code>
are supported.
</p>
</li>
<li class="listitem">
<p>
The
<code class="literal">
EXCLUDE
</code>
clause for frame
specification is parsed, but produces an error.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
IGNORE NULLS
</code>
is parsed, but produces an
error. Only
<code class="literal">
RESPECT NULLS
</code>
is supported.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
FROM LAST
</code>
is parsed, but produces an
error. Only
<code class="literal">
FROM FIRST
</code>
is supported.
</p>
</li>
</ul>
</div>
<p>
A maximum of 127 windows is supported for a given
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
. Note that a single query
may use multiple
<code class="literal">
SELECT
</code>
clauses, and each of
these clauses supports up to 127 windows. The number of distinct
windows is defined as the sum of the named windows and any
implicit windows specified as part of any window function's
<code class="literal">
OVER
</code>
clause. You should also be aware that
queries using very large numbers of windows may require
increasing the default thread stack size
(
<a class="link" href="server-system-variables.html#sysvar_thread_stack">
<code class="literal">
thread_stack
</code>
</a>
system variable).
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/information-schema-plugins-table.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="information-schema-plugins-table">
</a>
28.3.22 The INFORMATION_SCHEMA PLUGINS Table
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045079229232">
</a>
<p>
The
<a class="link" href="information-schema-plugins-table.html" title="28.3.22 The INFORMATION_SCHEMA PLUGINS Table">
<code class="literal">
PLUGINS
</code>
</a>
table provides
information about server plugins.
</p>
<p>
The
<a class="link" href="information-schema-plugins-table.html" title="28.3.22 The INFORMATION_SCHEMA PLUGINS Table">
<code class="literal">
PLUGINS
</code>
</a>
table has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
PLUGIN_NAME
</code>
</p>
<p>
The name used to refer to the plugin in statements such as
<a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
<code class="literal">
INSTALL PLUGIN
</code>
</a>
and
<a class="link" href="uninstall-plugin.html" title="15.7.4.6 UNINSTALL PLUGIN Statement">
<code class="literal">
UNINSTALL PLUGIN
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PLUGIN_VERSION
</code>
</p>
<p>
The version from the plugin's general type descriptor.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PLUGIN_STATUS
</code>
</p>
<p>
The plugin status, one of
<code class="literal">
ACTIVE
</code>
,
<code class="literal">
INACTIVE
</code>
,
<code class="literal">
DISABLED
</code>
,
<code class="literal">
DELETING
</code>
, or
<code class="literal">
DELETED
</code>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PLUGIN_TYPE
</code>
</p>
<p>
The type of plugin, such as
<code class="literal">
STORAGE ENGINE
</code>
,
<code class="literal">
INFORMATION_SCHEMA
</code>
, or
<code class="literal">
AUTHENTICATION
</code>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PLUGIN_TYPE_VERSION
</code>
</p>
<p>
The version from the plugin's type-specific descriptor.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PLUGIN_LIBRARY
</code>
</p>
<p>
The name of the plugin shared library file. This is the name
used to refer to the plugin file in statements such as
<a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
<code class="literal">
INSTALL PLUGIN
</code>
</a>
and
<a class="link" href="uninstall-plugin.html" title="15.7.4.6 UNINSTALL PLUGIN Statement">
<code class="literal">
UNINSTALL PLUGIN
</code>
</a>
. This file is
located in the directory named by the
<a class="link" href="server-system-variables.html#sysvar_plugin_dir">
<code class="literal">
plugin_dir
</code>
</a>
system variable.
If the library name is
<code class="literal">
NULL
</code>
, the plugin is
compiled in and cannot be uninstalled with
<a class="link" href="uninstall-plugin.html" title="15.7.4.6 UNINSTALL PLUGIN Statement">
<code class="literal">
UNINSTALL PLUGIN
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PLUGIN_LIBRARY_VERSION
</code>
</p>
<p>
The plugin API interface version.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PLUGIN_AUTHOR
</code>
</p>
<p>
The plugin author.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PLUGIN_DESCRIPTION
</code>
</p>
<p>
A short description of the plugin.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
PLUGIN_LICENSE
</code>
</p>
<p>
How the plugin is licensed (for example,
<code class="literal">
GPL
</code>
).
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
LOAD_OPTION
</code>
</p>
<p>
How the plugin was loaded. The value is
<code class="literal">
OFF
</code>
,
<code class="literal">
ON
</code>
,
<code class="literal">
FORCE
</code>
, or
<code class="literal">
FORCE_PLUS_PERMANENT
</code>
. See
<a class="xref" href="plugin-loading.html" title="7.6.1 Installing and Uninstalling Plugins">
Section 7.6.1, “Installing and Uninstalling Plugins”
</a>
.
</p>
</li>
</ul>
</div>
<h4>
<a name="idm46045079184656">
</a>
Notes
</h4>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="link" href="information-schema-plugins-table.html" title="28.3.22 The INFORMATION_SCHEMA PLUGINS Table">
<code class="literal">
PLUGINS
</code>
</a>
is a nonstandard
<code class="literal">
INFORMATION_SCHEMA
</code>
table.
</p>
</li>
<li class="listitem">
<p>
For plugins installed with
<a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
<code class="literal">
INSTALL
PLUGIN
</code>
</a>
, the
<code class="literal">
PLUGIN_NAME
</code>
and
<code class="literal">
PLUGIN_LIBRARY
</code>
values are also registered
in the
<code class="literal">
mysql.plugin
</code>
table.
</p>
</li>
<li class="listitem">
<p>
For information about plugin data structures that form the
basis of the information in the
<a class="link" href="information-schema-plugins-table.html" title="28.3.22 The INFORMATION_SCHEMA PLUGINS Table">
<code class="literal">
PLUGINS
</code>
</a>
table, see
<a class="ulink" href="/doc/extending-mysql/8.4/en/plugin-api.html" target="_top">
The MySQL Plugin API
</a>
.
</p>
</li>
</ul>
</div>
<p>
Plugin information is also available from the
<a class="link" href="show-plugins.html" title="15.7.7.27 SHOW PLUGINS Statement">
<code class="literal">
SHOW PLUGINS
</code>
</a>
statement. See
<a class="xref" href="show-plugins.html" title="15.7.7.27 SHOW PLUGINS Statement">
Section 15.7.7.27, “SHOW PLUGINS Statement”
</a>
. These statements are equivalent:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa82308959"><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">SELECT</span>
PLUGIN_NAME<span class="token punctuation">,</span> PLUGIN_STATUS<span class="token punctuation">,</span> PLUGIN_TYPE<span class="token punctuation">,</span>
PLUGIN_LIBRARY<span class="token punctuation">,</span> PLUGIN_LICENSE
<span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span><span class="token keyword">PLUGINS</span><span class="token punctuation">;</span>
<span class="token keyword">SHOW</span> <span class="token keyword">PLUGINS</span><span class="token punctuation">;</span></code></pre>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/multibyte-characters.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="multibyte-characters">
</a>
12.13.3 Multi-Byte Character Support for Complex Character Sets
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045215297712">
</a>
<a class="indexterm" name="idm46045215296256">
</a>
<p>
If you want to add support for a new character set named
<em class="replaceable">
<code>
MYSET
</code>
</em>
that includes multibyte
characters, you must use multibyte character functions in the
<code class="filename">
ctype-
<em class="replaceable">
<code>
MYSET
</code>
</em>
.c
</code>
source file in the
<code class="filename">
strings
</code>
directory.
</p>
<p>
The existing character sets provide the best documentation and
examples to show how these functions are implemented. Look at
the
<code class="filename">
ctype-*.c
</code>
files in the
<code class="filename">
strings
</code>
directory, such as the files for
the
<code class="literal">
euc_kr
</code>
,
<code class="literal">
gb2312
</code>
,
<code class="literal">
gbk
</code>
,
<code class="literal">
sjis
</code>
, and
<code class="literal">
ujis
</code>
character sets. Take a look at the
<code class="literal">
MY_CHARSET_HANDLER
</code>
structures to see how they
are used. See also the
<code class="filename">
CHARSET_INFO.txt
</code>
file in the
<code class="filename">
strings
</code>
directory for
additional information.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-programs-ndb-waiter.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="mysql-cluster-programs-ndb-waiter">
</a>
25.5.31 ndb_waiter — Wait for NDB Cluster to Reach a Given Status
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045095525648">
</a>
<p>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html" title="25.5.31 ndb_waiter — Wait for NDB Cluster to Reach a Given Status">
<span class="command">
<strong>
ndb_waiter
</strong>
</span>
</a>
repeatedly (each 100 milliseconds)
prints out the status of all cluster data nodes until either the
cluster reaches a given status or the
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_timeout">
<code class="option">
--timeout
</code>
</a>
limit is exceeded,
then exits. By default, it waits for the cluster to achieve
<code class="literal">
STARTED
</code>
status, in which all nodes have
started and connected to the cluster. This can be overridden
using the
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_no-contact">
<code class="option">
--no-contact
</code>
</a>
and
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_not-started">
<code class="option">
--not-started
</code>
</a>
options.
</p>
<p>
The node states reported by this utility are as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
NO_CONTACT
</code>
: The node cannot be contacted.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
UNKNOWN
</code>
: The node can be contacted, but
its status is not yet known. Usually, this means that the
node has received a
<a class="link" href="mysql-cluster-mgm-client-commands.html#ndbclient-start">
<code class="literal">
START
</code>
</a>
or
<a class="link" href="mysql-cluster-mgm-client-commands.html#ndbclient-restart">
<code class="literal">
RESTART
</code>
</a>
command from the
management server, but has not yet acted on it.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
NOT_STARTED
</code>
: The node has stopped, but
remains in contact with the cluster. This is seen when
restarting the node using the management client's
<code class="literal">
RESTART
</code>
command.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
STARTING
</code>
: The node's
<a class="link" href="mysql-cluster-programs-ndbd.html" title="25.5.1 ndbd — The NDB Cluster Data Node Daemon">
<span class="command">
<strong>
ndbd
</strong>
</span>
</a>
process has started, but the node
has not yet joined the cluster.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
STARTED
</code>
: The node is operational, and has
joined the cluster.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
SHUTTING_DOWN
</code>
: The node is shutting down.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
SINGLE USER MODE
</code>
: This is shown for all
cluster data nodes when the cluster is in single user mode.
</p>
</li>
</ul>
</div>
<p>
Options that can be used with
<a class="link" href="mysql-cluster-programs-ndb-waiter.html" title="25.5.31 ndb_waiter — Wait for NDB Cluster to Reach a Given Status">
<span class="command">
<strong>
ndb_waiter
</strong>
</span>
</a>
are
shown in the following table. Additional descriptions follow the
table.
</p>
<p>
</p>
<h4>
<a name="idm46045095499584">
</a>
Usage
</h4>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa52755169"><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">ndb_waiter <span class="token punctuation">[</span><span class="token property">-c</span> <em class="replaceable">connection_string</em><span class="token punctuation">]</span></code></pre>
</div>
<h4>
<a name="mysql-cluster-programs-ndb-waiter-additional-options">
</a>
Additional Options
</h4>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a name="option_ndb_waiter_character-sets-dir">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_character-sets-dir">
<code class="option">
--character-sets-dir
</code>
</a>
</p>
<a class="indexterm" name="idm46045095493808">
</a>
<a class="indexterm" name="idm46045095492352">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for character-sets-dir">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--character-sets-dir=path
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Directory containing character sets.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_connect-retries">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_connect-retries">
<code class="option">
--connect-retries
</code>
</a>
</p>
<a class="indexterm" name="idm46045095482560">
</a>
<a class="indexterm" name="idm46045095481072">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for connect-retries">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--connect-retries=#
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
12
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
12
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Number of times to retry connection before giving up.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_connect-retry-delay">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_connect-retry-delay">
<code class="option">
--connect-retry-delay
</code>
</a>
</p>
<a class="indexterm" name="idm46045095462048">
</a>
<a class="indexterm" name="idm46045095460592">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for connect-retry-delay">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--connect-retry-delay=#
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
5
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
5
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Number of seconds to wait between attempts to contact
management server.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_connect-string">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_connect-string">
<code class="option">
--connect-string
</code>
</a>
</p>
<a class="indexterm" name="idm46045095441472">
</a>
<a class="indexterm" name="idm46045095439984">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for connect-string">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--connect-string=connection_string
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
[none]
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Same as
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_ndb-connectstring">
<code class="option">
--ndb-connectstring
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_core-file">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_core-file">
<code class="option">
--core-file
</code>
</a>
</p>
<a class="indexterm" name="idm46045095424624">
</a>
<a class="indexterm" name="idm46045095423136">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for core-file">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--core-file
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Write core file on error; used in debugging.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_defaults-extra-file">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_defaults-extra-file">
<code class="option">
--defaults-extra-file
</code>
</a>
</p>
<a class="indexterm" name="idm46045095413424">
</a>
<a class="indexterm" name="idm46045095411968">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for defaults-extra-file">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--defaults-extra-file=path
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
[none]
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Read given file after global files are read.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_defaults-file">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_defaults-file">
<code class="option">
--defaults-file
</code>
</a>
</p>
<a class="indexterm" name="idm46045095397616">
</a>
<a class="indexterm" name="idm46045095396128">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for defaults-file">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--defaults-file=path
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
[none]
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Read default options from given file only.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_defaults-group-suffix">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_defaults-group-suffix">
<code class="option">
--defaults-group-suffix
</code>
</a>
</p>
<a class="indexterm" name="idm46045095381920">
</a>
<a class="indexterm" name="idm46045095380464">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for defaults-group-suffix">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--defaults-group-suffix=string
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
[none]
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Also read groups with concat(group, suffix).
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_login-path">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_login-path">
<code class="option">
--login-path
</code>
</a>
</p>
<a class="indexterm" name="idm46045095366112">
</a>
<a class="indexterm" name="idm46045095364624">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for login-path">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--login-path=path
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
[none]
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Read given path from login file.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_no-login-paths">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_no-login-paths">
<code class="option">
--no-login-paths
</code>
</a>
</p>
<a class="indexterm" name="idm46045095350464">
</a>
<a class="indexterm" name="idm46045095348976">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for no-login-paths">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--no-login-paths
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Skips reading options from the login path file.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_help">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_help">
<code class="option">
--help
</code>
</a>
</p>
<a class="indexterm" name="idm46045095339312">
</a>
<a class="indexterm" name="idm46045095337824">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for help">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--help
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Display help text and exit.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_ndb-connectstring">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_ndb-connectstring">
<code class="option">
--ndb-connectstring
</code>
</a>
</p>
<a class="indexterm" name="idm46045095328144">
</a>
<a class="indexterm" name="idm46045095326688">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ndb-connectstring">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ndb-connectstring=connection_string
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
[none]
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Set connection string for connecting to
<a class="link" href="mysql-cluster-programs-ndb-mgmd.html" title="25.5.4 ndb_mgmd — The NDB Cluster Management Server Daemon">
<span class="command">
<strong>
ndb_mgmd
</strong>
</span>
</a>
. Syntax:
<code class="literal">
[nodeid=
<em class="replaceable">
<code>
id
</code>
</em>
;][host=]
<em class="replaceable">
<code>
hostname
</code>
</em>
[:
<em class="replaceable">
<code>
port
</code>
</em>
]
</code>
.
Overrides entries in
<code class="literal">
NDB_CONNECTSTRING
</code>
and
<code class="filename">
my.cnf
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_ndb-mgm-tls">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_ndb-mgm-tls">
<code class="option">
--ndb-mgm-tls
</code>
</a>
</p>
<a class="indexterm" name="idm46045095307648">
</a>
<a class="indexterm" name="idm46045095306160">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ndb-mgm-tls">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ndb-mgm-tls=level
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Enumeration
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
relaxed
</code>
</td>
</tr>
<tr>
<th>
Valid Values
</th>
<td>
<p class="valid-value">
<code class="literal">
relaxed
</code>
</p>
<p class="valid-value">
<code class="literal">
strict
</code>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Sets the level of TLS support required to connect to the
management server; one of
<code class="literal">
relaxed
</code>
or
<code class="literal">
strict
</code>
.
<code class="literal">
relaxed
</code>
(the
default) means that a TLS connection is attempted, but
success is not required;
<code class="literal">
strict
</code>
means
that TLS is required to connect.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_ndb-mgmd-host">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_ndb-mgmd-host">
<code class="option">
--ndb-mgmd-host
</code>
</a>
</p>
<a class="indexterm" name="idm46045095285104">
</a>
<a class="indexterm" name="idm46045095283616">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ndb-mgmd-host">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ndb-mgmd-host=connection_string
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
String
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
[none]
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Same as
--
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_ndb-connectstring">
<code class="option">
ndb-connectstring
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_ndb-nodeid">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_ndb-nodeid">
<code class="option">
--ndb-nodeid
</code>
</a>
</p>
<a class="indexterm" name="idm46045095268432">
</a>
<a class="indexterm" name="idm46045095266944">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ndb-nodeid">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ndb-nodeid=#
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
[none]
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Set node ID for this node, overriding any ID set by
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_ndb-connectstring">
<code class="option">
--ndb-connectstring
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_ndb-optimized-node-selection">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_ndb-optimized-node-selection">
<code class="option">
--ndb-optimized-node-selection
</code>
</a>
</p>
<a class="indexterm" name="idm46045095251632">
</a>
<a class="indexterm" name="idm46045095250128">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ndb-optimized-node-selection">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ndb-optimized-node-selection
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Enable optimizations for selection of nodes for
transactions. Enabled by default; use
<code class="option">
--skip-ndb-optimized-node-selection
</code>
to
disable.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_ndb-tls-search-path">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_ndb-tls-search-path">
<code class="option">
--ndb-tls-search-path
</code>
</a>
</p>
<a class="indexterm" name="idm46045095239840">
</a>
<a class="indexterm" name="idm46045095238384">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for ndb-tls-search-path">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--ndb-tls-search-path=list
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Path name
</td>
</tr>
<tr>
<th>
Default Value (Unix)
</th>
<td>
<code class="literal">
$HOME/ndb-tls
</code>
</td>
</tr>
<tr>
<th>
Default Value (Windows)
</th>
<td>
<code class="literal">
$HOMEDIR/ndb-tls
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Specify a list of directories to search for a CA file. On
Unix platforms, the directory names are separated by colons
(
<code class="literal">
:
</code>
); on Windows systems, the semicolon
character (
<code class="literal">
;
</code>
) is used as the separator. A
directory reference may be relative or absolute; it may
contain one or more environment variables, each denoted by a
prefixed dollar sign (
<code class="literal">
$
</code>
), and expanded
prior to use.
</p>
<p>
Searching begins with the leftmost named directory and
proceeds from left to right until a file is found. An empty
string denotes an empty search path, which causes all
searches to fail. A string consisting of a single dot
(
<code class="literal">
.
</code>
) indicates that the search path
limited to the current working directory.
</p>
<p>
If no search path is supplied, the compiled-in default value
is used. This value depends on the platform used: On
Windows, this is
<code class="literal">
\ndb-tls
</code>
; on other
platforms (including Linux), it is
<code class="literal">
$HOME/ndb-tls
</code>
. This can be overridden by
compiling NDB Cluster using
<a class="link" href="source-configuration-options.html#option_cmake_with_ndb_tls_search_path">
<code class="option">
-DWITH_NDB_TLS_SEARCH_PATH
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_no-contact">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_no-contact">
<code class="option">
--no-contact
</code>
</a>
,
<code class="option">
-n
</code>
</p>
<a class="indexterm" name="idm46045095214320">
</a>
<a class="indexterm" name="idm46045095212832">
</a>
<p>
Instead of waiting for the
<code class="literal">
STARTED
</code>
state,
<a class="link" href="mysql-cluster-programs-ndb-waiter.html" title="25.5.31 ndb_waiter — Wait for NDB Cluster to Reach a Given Status">
<span class="command">
<strong>
ndb_waiter
</strong>
</span>
</a>
continues running until the
cluster reaches
<code class="literal">
NO_CONTACT
</code>
status before
exiting.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_no-defaults">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_no-defaults">
<code class="option">
--no-defaults
</code>
</a>
</p>
<a class="indexterm" name="idm46045095205744">
</a>
<a class="indexterm" name="idm46045095204256">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for no-defaults">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--no-defaults
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Do not read default options from any option file other than
login file.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_not-started">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_not-started">
<code class="option">
--not-started
</code>
</a>
</p>
<a class="indexterm" name="idm46045095194608">
</a>
<a class="indexterm" name="idm46045095193120">
</a>
<p>
Instead of waiting for the
<code class="literal">
STARTED
</code>
state,
<a class="link" href="mysql-cluster-programs-ndb-waiter.html" title="25.5.31 ndb_waiter — Wait for NDB Cluster to Reach a Given Status">
<span class="command">
<strong>
ndb_waiter
</strong>
</span>
</a>
continues running until the
cluster reaches
<code class="literal">
NOT_STARTED
</code>
status before
exiting.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_nowait-nodes">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_nowait-nodes">
<code class="option">
--nowait-nodes=
<em class="replaceable">
<code>
list
</code>
</em>
</code>
</a>
</p>
<a class="indexterm" name="idm46045095185808">
</a>
<a class="indexterm" name="idm46045095184320">
</a>
<p>
When this option is used,
<a class="link" href="mysql-cluster-programs-ndb-waiter.html" title="25.5.31 ndb_waiter — Wait for NDB Cluster to Reach a Given Status">
<span class="command">
<strong>
ndb_waiter
</strong>
</span>
</a>
does
not wait for the nodes whose IDs are listed. The list is
comma-delimited; ranges can be indicated by dashes, as shown
here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa41947607"><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">$> </span><span class="token command">ndb_waiter</span> <span class="token constant">--nowait-nodes</span><span class="token attr-value"><span class="token punctuation">=</span>1,3,7-9</span></code></pre>
</div>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
Do
<span class="emphasis">
<em>
not
</em>
</span>
use this option together with
the
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_wait-nodes">
<code class="option">
--wait-nodes
</code>
</a>
option.
</p>
</div>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_print-defaults">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_print-defaults">
<code class="option">
--print-defaults
</code>
</a>
</p>
<a class="indexterm" name="idm46045095174704">
</a>
<a class="indexterm" name="idm46045095173216">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for print-defaults">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--print-defaults
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Print program argument list and exit.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_timeout">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_timeout">
<code class="option">
--timeout=
<em class="replaceable">
<code>
seconds
</code>
</em>
</code>
</a>
,
<code class="option">
-t
<em class="replaceable">
<code>
seconds
</code>
</em>
</code>
</p>
<a class="indexterm" name="idm46045095162560">
</a>
<a class="indexterm" name="idm46045095161072">
</a>
<p>
Time to wait. The program exits if the desired state is not
achieved within this number of seconds. The default is 120
seconds (1200 reporting cycles).
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_single-user">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_single-user">
<code class="option">
--single-user
</code>
</a>
</p>
<a class="indexterm" name="idm46045095156624">
</a>
<a class="indexterm" name="idm46045095155136">
</a>
<p>
The program waits for the cluster to enter single user mode.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_usage">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_usage">
<code class="option">
--usage
</code>
</a>
</p>
<a class="indexterm" name="idm46045095150976">
</a>
<a class="indexterm" name="idm46045095149488">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for usage">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--usage
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Display help text and exit; same as
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_help">
<code class="option">
--help
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_verbose">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_verbose">
<code class="option">
--verbose
</code>
</a>
</p>
<a class="indexterm" name="idm46045095138720">
</a>
<a class="indexterm" name="idm46045095137232">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for verbose">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--verbose=#
</code>
</td>
</tr>
<tr>
<th>
Type
</th>
<td>
Integer
</td>
</tr>
<tr>
<th>
Default Value
</th>
<td>
<code class="literal">
2
</code>
</td>
</tr>
<tr>
<th>
Minimum Value
</th>
<td>
<code class="literal">
0
</code>
</td>
</tr>
<tr>
<th>
Maximum Value
</th>
<td>
<code class="literal">
2
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Controls verbosity level of printout. Possible levels and
their effects are listed here:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
0
</code>
: Do not print (return exit code
only; see following for exit codes).
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
1
</code>
: Print final connection status
only.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
2
</code>
: Print status each time it is
checked.
</p>
<p>
This is the same behavior as in versions of NDB Cluster
previous to 8.4.
</p>
</li>
</ul>
</div>
<p>
Exit codes returned by
<a class="link" href="mysql-cluster-programs-ndb-waiter.html" title="25.5.31 ndb_waiter — Wait for NDB Cluster to Reach a Given Status">
<span class="command">
<strong>
ndb_waiter
</strong>
</span>
</a>
are
listed here, with their meanings:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<code class="literal">
0
</code>
: Success.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
1
</code>
: Wait timed out.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
2
</code>
: Parameter error, such as an
invalid node ID.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
3
</code>
: Failed to connect to the
management server.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_version">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_version">
<code class="option">
--version
</code>
</a>
</p>
<a class="indexterm" name="idm46045095104528">
</a>
<a class="indexterm" name="idm46045095103040">
</a>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for version">
<colgroup>
<col style="width: 30%"/>
<col style="width: 70%"/>
</colgroup>
<tbody>
<tr>
<th>
Command-Line Format
</th>
<td>
<code class="literal">
--version
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
Display version information and exit.
</p>
</li>
<li class="listitem">
<p>
<a name="option_ndb_waiter_wait-nodes">
</a>
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_wait-nodes">
<code class="option">
--wait-nodes=
<em class="replaceable">
<code>
list
</code>
</em>
</code>
</a>
,
<code class="option">
-w
<em class="replaceable">
<code>
list
</code>
</em>
</code>
</p>
<a class="indexterm" name="idm46045095092464">
</a>
<a class="indexterm" name="idm46045095090976">
</a>
<p>
When this option is used,
<a class="link" href="mysql-cluster-programs-ndb-waiter.html" title="25.5.31 ndb_waiter — Wait for NDB Cluster to Reach a Given Status">
<span class="command">
<strong>
ndb_waiter
</strong>
</span>
</a>
waits only for the nodes whose IDs are listed. The list is
comma-delimited; ranges can be indicated by dashes, as shown
here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa52063494"><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">$> </span><span class="token command">ndb_waiter</span> <span class="token constant">--wait-nodes</span><span class="token attr-value"><span class="token punctuation">=</span>2,4-6,10</span></code></pre>
</div>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
Do
<span class="emphasis">
<em>
not
</em>
</span>
use this option together with
the
<a class="link" href="mysql-cluster-programs-ndb-waiter.html#option_ndb_waiter_nowait-nodes">
<code class="option">
--nowait-nodes
</code>
</a>
option.
</p>
</div>
</li>
</ul>
</div>
<p>
<b>
Sample Output.
</b>
Shown here is the output from
<a class="link" href="mysql-cluster-programs-ndb-waiter.html" title="25.5.31 ndb_waiter — Wait for NDB Cluster to Reach a Given Status">
<span class="command">
<strong>
ndb_waiter
</strong>
</span>
</a>
when run against a 4-node cluster in which two nodes have been
shut down and then started again manually. Duplicate reports
(indicated by
<code class="literal">
...
</code>
) are omitted.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa37247082"><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">$> </span><span class="token command">./ndb_waiter</span> <span class="token property">-c</span> localhost
Connecting to mgmsrv at <span class="token punctuation">(</span>localhost<span class="token punctuation">)</span>
State node 1 STARTED
State node 2 NO_CONTACT
State node 3 STARTED
State node 4 NO_CONTACT
Waiting for cluster enter state STARTED
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
State node 1 STARTED
State node 2 UNKNOWN
State node 3 STARTED
State node 4 NO_CONTACT
Waiting for cluster enter state STARTED
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
State node 1 STARTED
State node 2 STARTING
State node 3 STARTED
State node 4 NO_CONTACT
Waiting for cluster enter state STARTED
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
State node 1 STARTED
State node 2 STARTING
State node 3 STARTED
State node 4 UNKNOWN
Waiting for cluster enter state STARTED
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
State node 1 STARTED
State node 2 STARTING
State node 3 STARTED
State node 4 STARTING
Waiting for cluster enter state STARTED
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
State node 1 STARTED
State node 2 STARTED
State node 3 STARTED
State node 4 STARTING
Waiting for cluster enter state STARTED
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
State node 1 STARTED
State node 2 STARTED
State node 3 STARTED
State node 4 STARTED
Waiting for cluster enter state STARTED</code></pre>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
If no connection string is specified, then
<a class="link" href="mysql-cluster-programs-ndb-waiter.html" title="25.5.31 ndb_waiter — Wait for NDB Cluster to Reach a Given Status">
<span class="command">
<strong>
ndb_waiter
</strong>
</span>
</a>
tries to connect to a management
on
<code class="literal">
localhost
</code>
, and reports
<code class="literal">
Connecting to mgmsrv at (null)
</code>
.
</p>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/mysqlbinlog-backup.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="mysqlbinlog-backup">
</a>
6.6.9.3 Using mysqlbinlog to Back Up Binary Log Files
</h4>
</div>
</div>
</div>
<p>
By default,
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
reads binary log
files and displays their contents in text format. This enables
you to examine events within the files more easily and to
re-execute them (for example, by using the output as input to
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
).
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
can
read log files directly from the local file system, or, with the
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_read-from-remote-server">
<code class="option">
--read-from-remote-server
</code>
</a>
option, it can connect to a server and request binary log
contents from that server.
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
writes
text output to its standard output, or to the file named as the
value of the
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file=
<em class="replaceable">
<code>
file_name
</code>
</em>
</code>
</a>
option if that option is given.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="xref" href="mysqlbinlog-backup.html#mysqlbinlog-backup-capabilities" title="mysqlbinlog Backup Capabilities">
mysqlbinlog Backup Capabilities
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysqlbinlog-backup.html#mysqlbinlog-backup-options" title="mysqlbinlog Backup Options">
mysqlbinlog Backup Options
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysqlbinlog-backup.html#mysqlbinlog-backup-static-live" title="Static and Live Backups">
Static and Live Backups
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysqlbinlog-backup.html#mysqlbinlog-backup-output-file-naming" title="Output File Naming">
Output File Naming
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysqlbinlog-backup.html#mysqlbinlog-backup-example" title="Example: mysqldump + mysqlbinlog for Backup and Restore">
Example: mysqldump + mysqlbinlog for Backup and Restore
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="mysqlbinlog-backup.html#mysqlbinlog-backup-restrictions" title="mysqlbinlog Backup Restrictions">
mysqlbinlog Backup Restrictions
</a>
</p>
</li>
</ul>
</div>
<h5>
<a name="mysqlbinlog-backup-capabilities">
</a>
mysqlbinlog Backup Capabilities
</h5>
<p>
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
can read binary log files and
write new files containing the same content—that is, in
binary format rather than text format. This capability enables
you to easily back up a binary log in its original format.
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
can make a static backup, backing
up a set of log files and stopping when the end of the last file
is reached. It can also make a continuous (
<span class="quote">
“
<span class="quote">
live
</span>
”
</span>
)
backup, staying connected to the server when it reaches the end
of the last log file and continuing to copy new events as they
are generated. In continuous-backup operation,
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
runs until the connection ends
(for example, when the server exits) or
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
is forcibly terminated. When the
connection ends,
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
does not wait
and retry the connection, unlike a replica server. To continue a
live backup after the server has been restarted, you must also
restart
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
can back up both encrypted and
unencrypted binary log files . However, copies of encrypted
binary log files that are generated using
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
are stored in an unencrypted
format.
</p>
</div>
<h5>
<a name="mysqlbinlog-backup-options">
</a>
mysqlbinlog Backup Options
</h5>
<p>
Binary log backup requires that you invoke
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
with two options at minimum:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_read-from-remote-server">
<code class="option">
--read-from-remote-server
</code>
</a>
(or
<code class="option">
-R
</code>
) option tells
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
to connect to a server and
request its binary log. (This is similar to a replica server
connecting to its replication source server.)
</p>
</li>
<li class="listitem">
<p>
The
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_raw">
<code class="option">
--raw
</code>
</a>
option tells
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
to write raw (binary) output,
not text output.
</p>
</li>
</ul>
</div>
<p>
Along with
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_read-from-remote-server">
<code class="option">
--read-from-remote-server
</code>
</a>
,
it is common to specify other options:
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_host">
<code class="option">
--host
</code>
</a>
indicates where the
server is running, and you may also need to specify connection
options such as
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_user">
<code class="option">
--user
</code>
</a>
and
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_password">
<code class="option">
--password
</code>
</a>
.
</p>
<p>
Several other options are useful in conjunction with
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_raw">
<code class="option">
--raw
</code>
</a>
:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_stop-never">
<code class="option">
--stop-never
</code>
</a>
: Stay
connected to the server after reaching the end of the last
log file and continue to read new events.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_connection-server-id">
<code class="option">
--connection-server-id=
<em class="replaceable">
<code>
id
</code>
</em>
</code>
</a>
:
The server ID that
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
reports
when it connects to a server. When
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_stop-never">
<code class="option">
--stop-never
</code>
</a>
is used,
the default reported server ID is 1. If this causes a
conflict with the ID of a replica server or another
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
process, use
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_connection-server-id">
<code class="option">
--connection-server-id
</code>
</a>
to specify an alternative server ID. See
<a class="xref" href="mysqlbinlog-server-id.html" title="6.6.9.4 Specifying the mysqlbinlog Server ID">
Section 6.6.9.4, “Specifying the mysqlbinlog Server ID”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file
</code>
</a>
: A prefix
for output file names, as described later.
</p>
</li>
</ul>
</div>
<h5>
<a name="mysqlbinlog-backup-static-live">
</a>
Static and Live Backups
</h5>
<p>
To back up a server's binary log files with
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
, you must specify file names that
actually exist on the server. If you do not know the names,
connect to the server and use the
<a class="link" href="show-binary-logs.html" title="15.7.7.2 SHOW BINARY LOGS Statement">
<code class="literal">
SHOW
BINARY LOGS
</code>
</a>
statement to see the current names.
Suppose that the statement produces this output:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa7187544"><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></span> <span class="token keyword">SHOW</span> <span class="token datatype">BINARY</span> <span class="token keyword">LOGS</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>
<span class="token output"><span class="token punctuation">|</span> Log_name <span class="token punctuation">|</span> File_size <span class="token punctuation">|</span> Encrypted <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>
<span class="token output"><span class="token punctuation">|</span> binlog.000130 <span class="token punctuation">|</span> 27459 <span class="token punctuation">|</span> No <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000131 <span class="token punctuation">|</span> 13719 <span class="token punctuation">|</span> No <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog.000132 <span class="token punctuation">|</span> 43268 <span class="token punctuation">|</span> No <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></code></pre>
</div>
<p>
With that information, you can use
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
to back up the binary log to the
current directory as follows (enter each command on a single
line):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
To make a static backup of
<code class="filename">
binlog.000130
</code>
through
<code class="filename">
binlog.000132
</code>
, use either of these
commands:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa68537448"><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">mysqlbinlog <span class="token property">--read-from-remote-server</span> <span class="token constant">--host</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">host_name</em></span> <span class="token property">--raw</span>
binlog<span class="token punctuation">.</span>000130 binlog<span class="token punctuation">.</span>000131 binlog<span class="token punctuation">.</span>000132
mysqlbinlog <span class="token property">--read-from-remote-server</span> <span class="token constant">--host</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">host_name</em></span> <span class="token property">--raw</span>
<span class="token property">--to-last-log</span> binlog<span class="token punctuation">.</span>000130</code></pre>
</div>
<p>
The first command specifies every file name explicitly. The
second names only the first file and uses
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_to-last-log">
<code class="option">
--to-last-log
</code>
</a>
to read
through the last. A difference between these commands is
that if the server happens to open
<code class="filename">
binlog.000133
</code>
before
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
reaches the end of
<code class="filename">
binlog.000132
</code>
, the first command does
not read it, but the second command does.
</p>
</li>
<li class="listitem">
<p>
To make a live backup in which
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
starts with
<code class="filename">
binlog.000130
</code>
to copy existing log
files, then stays connected to copy new events as the server
generates them:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa61316480"><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">mysqlbinlog <span class="token property">--read-from-remote-server</span> <span class="token constant">--host</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">host_name</em></span> <span class="token property">--raw</span>
<span class="token property">--stop-never</span> binlog<span class="token punctuation">.</span>000130</code></pre>
</div>
<p>
With
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_stop-never">
<code class="option">
--stop-never
</code>
</a>
, it is
not necessary to specify
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_to-last-log">
<code class="option">
--to-last-log
</code>
</a>
to read to
the last log file because that option is implied.
</p>
</li>
</ul>
</div>
<h5>
<a name="mysqlbinlog-backup-output-file-naming">
</a>
Output File Naming
</h5>
<p>
Without
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_raw">
<code class="option">
--raw
</code>
</a>
,
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
produces text output and the
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file
</code>
</a>
option, if
given, specifies the name of the single file to which all output
is written. With
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_raw">
<code class="option">
--raw
</code>
</a>
,
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
writes one binary output file for
each log file transferred from the server. By default,
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
writes the files in the current
directory with the same names as the original log files. To
modify the output file names, use the
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file
</code>
</a>
option. In
conjunction with
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_raw">
<code class="option">
--raw
</code>
</a>
, the
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file
</code>
</a>
option value
is treated as a prefix that modifies the output file names.
</p>
<p>
Suppose that a server currently has binary log files named
<code class="filename">
binlog.000999
</code>
and up. If you use
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog --raw
</strong>
</span>
</a>
to back up the files, the
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file
</code>
</a>
option
produces output file names as shown in the following table. You
can write the files to a specific directory by beginning the
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file
</code>
</a>
value with the
directory path. If the
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file
</code>
</a>
value consists
only of a directory name, the value must end with the pathname
separator character. Output files are overwritten if they exist.
</p>
<div class="informaltable">
<table summary="mysqlbinlog --result-file options and corresponding output file names, as described in the example in the preceding text.">
<colgroup>
<col style="width: 50%"/>
<col style="width: 50%"/>
</colgroup>
<thead>
<tr>
<th>
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file
</code>
</a>
Option
</th>
<th>
Output File Names
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file=x
</code>
</a>
</td>
<td>
<code class="filename">
xbinlog.000999
</code>
and up
</td>
</tr>
<tr>
<td>
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file=/tmp/
</code>
</a>
</td>
<td>
<code class="filename">
/tmp/binlog.000999
</code>
and up
</td>
</tr>
<tr>
<td>
<a class="link" href="mysqlbinlog.html#option_mysqlbinlog_result-file">
<code class="option">
--result-file=/tmp/x
</code>
</a>
</td>
<td>
<code class="filename">
/tmp/xbinlog.000999
</code>
and up
</td>
</tr>
</tbody>
</table>
</div>
<h5>
<a name="mysqlbinlog-backup-example">
</a>
Example: mysqldump + mysqlbinlog for Backup and Restore
</h5>
<p>
The following example describes a simple scenario that shows how
to use
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
and
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
together to back up a server's
data and binary log, and how to use the backup to restore the
server if data loss occurs. The example assumes that the server
is running on host
<em class="replaceable">
<code>
host_name
</code>
</em>
and its
first binary log file is named
<code class="filename">
binlog.000999
</code>
. Enter each command on a
single line.
</p>
<p>
Use
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
to make a continuous backup
of the binary log:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa50150666"><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">mysqlbinlog <span class="token property">--read-from-remote-server</span> <span class="token constant">--host</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">host_name</em></span> <span class="token property">--raw</span>
<span class="token property">--stop-never</span> binlog<span class="token punctuation">.</span>000999</code></pre>
</div>
<p>
Use
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
to create a dump file as a
snapshot of the server's data. Use
<a class="link" href="mysqldump.html#option_mysqldump_all-databases">
<code class="option">
--all-databases
</code>
</a>
,
<a class="link" href="mysqldump.html#option_mysqldump_events">
<code class="option">
--events
</code>
</a>
, and
<a class="link" href="mysqldump.html#option_mysqldump_routines">
<code class="option">
--routines
</code>
</a>
to back up all
data, and
<a class="link" href="mysqldump.html#option_mysqldump_source-data">
<code class="option">
--source-data=2
</code>
</a>
to
include the current binary log coordinates in the dump file.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa51824947"><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">mysqldump <span class="token constant">--host</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">host_name</em></span> <span class="token property">--all-databases</span> <span class="token property">--events</span> <span class="token property">--routines</span> <span class="token constant">--source-data</span><span class="token attr-value"><span class="token punctuation">=</span>2></span> <em class="replaceable">dump_file</em></code></pre>
</div>
<p>
Execute the
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
command periodically to
create newer snapshots as desired.
</p>
<p>
If data loss occurs (for example, if the server unexpectedly
exits), use the most recent dump file to restore the data:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa17086222"><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">mysql <span class="token constant">--host</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">host_name</em></span> <span class="token property">-u</span> root <span class="token property">-p</span> < <em class="replaceable">dump_file</em></code></pre>
</div>
<p>
Then use the binary log backup to re-execute events that were
written after the coordinates listed in the dump file. Suppose
that the coordinates in the file look like this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-none"><div class="docs-select-all right" id="sa17083675"><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-none">-- CHANGE REPLICATION SOURCE TO SOURCE_LOG_FILE='binlog.001002', SOURCE_LOG_POS=27284;</code></pre>
</div>
<p>
If the most recent backed-up log file is named
<code class="filename">
binlog.001004
</code>
, re-execute the log events
like this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa89097034"><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">mysqlbinlog <span class="token constant">--start-position</span><span class="token attr-value"><span class="token punctuation">=</span>27284</span> binlog<span class="token punctuation">.</span>001002 binlog<span class="token punctuation">.</span>001003 binlog<span class="token punctuation">.</span>001004
| mysql <span class="token constant">--host</span><span class="token attr-value"><span class="token punctuation">=</span><em class="replaceable">host_name</em></span> <span class="token property">-u</span> root <span class="token property">-p</span></code></pre>
</div>
<p>
You might find it easier to copy the backup files (dump file and
binary log files) to the server host to make it easier to
perform the restore operation, or if MySQL does not allow remote
<code class="literal">
root
</code>
access.
</p>
<h5>
<a name="mysqlbinlog-backup-restrictions">
</a>
mysqlbinlog Backup Restrictions
</h5>
<p>
Binary log backups with
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
are
subject to these restrictions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
does not automatically
reconnect to the MySQL server if the connection is lost (for
example, if a server restart occurs or there is a network
outage).
</p>
</li>
<li class="listitem">
<p>
The delay for a backup is similar to the delay for a replica
server.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/programs-overview.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="programs-overview">
</a>
6.1 Overview of MySQL Programs
</h2>
</div>
</div>
</div>
<p>
There are many different programs in a MySQL installation. This
section provides a brief overview of them. Later sections provide
a more detailed description of each one, with the exception of NDB
Cluster programs. Each program's description indicates its
invocation syntax and the options that it supports.
<a class="xref" href="mysql-cluster-programs.html" title="25.5 NDB Cluster Programs">
Section 25.5, “NDB Cluster Programs”
</a>
, describes programs
specific to NDB Cluster.
</p>
<p>
Most MySQL distributions include all of these programs, except for
those programs that are platform-specific. (For example, the
server startup scripts are not used on Windows.) The exception is
that RPM distributions are more specialized. There is one RPM for
the server, another for client programs, and so forth. If you
appear to be missing one or more programs, see
<a class="xref" href="installing.html" title="Chapter 2 Installing MySQL">
Chapter 2,
<i>
Installing MySQL
</i>
</a>
, for information on types of
distributions and what they contain. It may be that you have a
distribution that does not include all programs and you need to
install an additional package.
</p>
<p>
Each MySQL program takes many different options. Most programs
provide a
<code class="option">
--help
</code>
option that you can use to get a
description of the program's different options. For example, try
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql --help
</strong>
</span>
</a>
.
</p>
<p>
You can override default option values for MySQL programs by
specifying options on the command line or in an option file. See
<a class="xref" href="programs-using.html" title="6.2 Using MySQL Programs">
Section 6.2, “Using MySQL Programs”
</a>
, for general information on
invoking programs and specifying program options.
</p>
<p>
The MySQL server,
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
, is the main program
that does most of the work in a MySQL installation. The server is
accompanied by several related scripts that assist you in starting
and stopping the server:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324479552">
</a>
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
</p>
<p>
The SQL daemon (that is, the MySQL server). To use client
programs,
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
must be running, because
clients gain access to databases by connecting to the server.
See
<a class="xref" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
Section 6.3.1, “mysqld — The MySQL Server”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324474016">
</a>
<a class="link" href="mysqld-safe.html" title="6.3.2 mysqld_safe — MySQL Server Startup Script">
<span class="command">
<strong>
mysqld_safe
</strong>
</span>
</a>
</p>
<p>
A server startup script.
<a class="link" href="mysqld-safe.html" title="6.3.2 mysqld_safe — MySQL Server Startup Script">
<span class="command">
<strong>
mysqld_safe
</strong>
</span>
</a>
attempts to start
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
. See
<a class="xref" href="mysqld-safe.html" title="6.3.2 mysqld_safe — MySQL Server Startup Script">
Section 6.3.2, “mysqld_safe — MySQL Server Startup Script”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324467392">
</a>
<a class="link" href="mysql-server.html" title="6.3.3 mysql.server — MySQL Server Startup Script">
<span class="command">
<strong>
mysql.server
</strong>
</span>
</a>
</p>
<p>
A server startup script. This script is used on systems that
use System V-style run directories containing scripts that
start system services for particular run levels. It invokes
<a class="link" href="mysqld-safe.html" title="6.3.2 mysqld_safe — MySQL Server Startup Script">
<span class="command">
<strong>
mysqld_safe
</strong>
</span>
</a>
to start the MySQL server. See
<a class="xref" href="mysql-server.html" title="6.3.3 mysql.server — MySQL Server Startup Script">
Section 6.3.3, “mysql.server — MySQL Server Startup Script”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324461792">
</a>
<a class="link" href="mysqld-multi.html" title="6.3.4 mysqld_multi — Manage Multiple MySQL Servers">
<span class="command">
<strong>
mysqld_multi
</strong>
</span>
</a>
</p>
<p>
A server startup script that can start or stop multiple
servers installed on the system. See
<a class="xref" href="mysqld-multi.html" title="6.3.4 mysqld_multi — Manage Multiple MySQL Servers">
Section 6.3.4, “mysqld_multi — Manage Multiple MySQL Servers”
</a>
.
</p>
</li>
</ul>
</div>
<p>
Several programs perform setup operations during MySQL
installation or upgrading:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324456672">
</a>
<a class="link" href="comp-err.html" title="6.4.1 comp_err — Compile MySQL Error Message File">
<span class="command">
<strong>
comp_err
</strong>
</span>
</a>
</p>
<p>
This program is used during the MySQL build/installation
process. It compiles error message files from the error source
files. See
<a class="xref" href="comp-err.html" title="6.4.1 comp_err — Compile MySQL Error Message File">
Section 6.4.1, “comp_err — Compile MySQL Error Message File”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324452224">
</a>
<a class="link" href="mysql-secure-installation.html" title="6.4.2 mysql_secure_installation — Improve MySQL Installation Security">
<span class="command">
<strong>
mysql_secure_installation
</strong>
</span>
</a>
</p>
<p>
This program enables you to improve the security of your MySQL
installation. See
<a class="xref" href="mysql-secure-installation.html" title="6.4.2 mysql_secure_installation — Improve MySQL Installation Security">
Section 6.4.2, “mysql_secure_installation — Improve MySQL Installation Security”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324447872">
</a>
<a class="link" href="mysql-tzinfo-to-sql.html" title="6.4.3 mysql_tzinfo_to_sql — Load the Time Zone Tables">
<span class="command">
<strong>
mysql_tzinfo_to_sql
</strong>
</span>
</a>
</p>
<p>
This program loads the time zone tables in the
<code class="literal">
mysql
</code>
database using the contents of the
host system
<span class="firstterm">
zoneinfo
</span>
database (the set of files describing time zones). See
<a class="xref" href="mysql-tzinfo-to-sql.html" title="6.4.3 mysql_tzinfo_to_sql — Load the Time Zone Tables">
Section 6.4.3, “mysql_tzinfo_to_sql — Load the Time Zone Tables”
</a>
.
</p>
</li>
</ul>
</div>
<p>
MySQL client programs that connect to the MySQL server:
</p>
<a class="indexterm" name="idm46045324441984">
</a>
<a class="indexterm" name="idm46045324440912">
</a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324438656">
</a>
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
</p>
<p>
The command-line tool for interactively entering SQL
statements or executing them from a file in batch mode. See
<a class="xref" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
Section 6.5.1, “mysql — The MySQL Command-Line Client”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324434400">
</a>
<a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
<span class="command">
<strong>
mysqladmin
</strong>
</span>
</a>
</p>
<p>
A client that performs administrative operations, such as
creating or dropping databases, reloading the grant tables,
flushing tables to disk, and reopening log files.
<a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
<span class="command">
<strong>
mysqladmin
</strong>
</span>
</a>
can also be used to retrieve
version, process, and status information from the server. See
<a class="xref" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
Section 6.5.2, “mysqladmin — A MySQL Server Administration Program”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324428752">
</a>
<a class="link" href="mysqlcheck.html" title="6.5.3 mysqlcheck — A Table Maintenance Program">
<span class="command">
<strong>
mysqlcheck
</strong>
</span>
</a>
</p>
<p>
A table-maintenance client that checks, repairs, analyzes, and
optimizes tables. See
<a class="xref" href="mysqlcheck.html" title="6.5.3 mysqlcheck — A Table Maintenance Program">
Section 6.5.3, “mysqlcheck — A Table Maintenance Program”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324424528">
</a>
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
</p>
<p>
A client that dumps a MySQL database into a file as SQL, text,
or XML. See
<a class="xref" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
Section 6.5.4, “mysqldump — A Database Backup Program”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324420320">
</a>
<a class="link" href="mysqlimport.html" title="6.5.5 mysqlimport — A Data Import Program">
<span class="command">
<strong>
mysqlimport
</strong>
</span>
</a>
</p>
<p>
A client that imports text files into their respective tables
using
<a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
<code class="literal">
LOAD DATA
</code>
</a>
. See
<a class="xref" href="mysqlimport.html" title="6.5.5 mysqlimport — A Data Import Program">
Section 6.5.5, “mysqlimport — A Data Import Program”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324414880">
</a>
<span class="command">
<strong>
mysqlsh
</strong>
</span>
</p>
<p>
MySQL Shell is an advanced client and code editor for MySQL
Server. See
<a class="ulink" href="/doc/mysql-shell/8.4/en/" target="_top">
MySQL Shell 8.4
</a>
. In addition to the
provided SQL functionality, similar to
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
, MySQL Shell provides scripting
capabilities for JavaScript and Python and includes APIs for
working with MySQL. X DevAPI enables you to work with both
relational and document data, see
<a class="xref" href="document-store.html" title="Chapter 22 Using MySQL as a Document Store">
Chapter 22,
<i>
Using MySQL as a Document Store
</i>
</a>
. AdminAPI enables you to
work with InnoDB Cluster, see
<a class="ulink" href="/doc/mysql-shell/8.4/en/admin-api-userguide.html" target="_top">
MySQL AdminAPI
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324408096">
</a>
<a class="link" href="mysqlshow.html" title="6.5.6 mysqlshow — Display Database, Table, and Column Information">
<span class="command">
<strong>
mysqlshow
</strong>
</span>
</a>
</p>
<p>
A client that displays information about databases, tables,
columns, and indexes. See
<a class="xref" href="mysqlshow.html" title="6.5.6 mysqlshow — Display Database, Table, and Column Information">
Section 6.5.6, “mysqlshow — Display Database, Table, and Column Information”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324403872">
</a>
<a class="link" href="mysqlslap.html" title="6.5.7 mysqlslap — A Load Emulation Client">
<span class="command">
<strong>
mysqlslap
</strong>
</span>
</a>
</p>
<p>
A client that is designed to emulate client load for a MySQL
server and report the timing of each stage. It works as if
multiple clients are accessing the server. See
<a class="xref" href="mysqlslap.html" title="6.5.7 mysqlslap — A Load Emulation Client">
Section 6.5.7, “mysqlslap — A Load Emulation Client”
</a>
.
</p>
</li>
</ul>
</div>
<p>
MySQL administrative and utility programs:
</p>
<a class="indexterm" name="idm46045324399312">
</a>
<a class="indexterm" name="idm46045324398240">
</a>
<a class="indexterm" name="idm46045324396752">
</a>
<a class="indexterm" name="idm46045324395680">
</a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324393424">
</a>
<a class="link" href="innochecksum.html" title="6.6.2 innochecksum — Offline InnoDB File Checksum Utility">
<span class="command">
<strong>
innochecksum
</strong>
</span>
</a>
</p>
<p>
An offline
<code class="literal">
InnoDB
</code>
offline file checksum
utility. See
<a class="xref" href="innochecksum.html" title="6.6.2 innochecksum — Offline InnoDB File Checksum Utility">
Section 6.6.2, “innochecksum — Offline InnoDB File Checksum Utility”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324388416">
</a>
<a class="link" href="myisam-ftdump.html" title="6.6.3 myisam_ftdump — Display Full-Text Index information">
<span class="command">
<strong>
myisam_ftdump
</strong>
</span>
</a>
</p>
<p>
A utility that displays information about full-text indexes in
<code class="literal">
MyISAM
</code>
tables. See
<a class="xref" href="myisam-ftdump.html" title="6.6.3 myisam_ftdump — Display Full-Text Index information">
Section 6.6.3, “myisam_ftdump — Display Full-Text Index information”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324383328">
</a>
<a class="link" href="myisamchk.html" title="6.6.4 myisamchk — MyISAM Table-Maintenance Utility">
<span class="command">
<strong>
myisamchk
</strong>
</span>
</a>
</p>
<p>
A utility to describe, check, optimize, and repair
<code class="literal">
MyISAM
</code>
tables. See
<a class="xref" href="myisamchk.html" title="6.6.4 myisamchk — MyISAM Table-Maintenance Utility">
Section 6.6.4, “myisamchk — MyISAM Table-Maintenance Utility”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324378416">
</a>
<a class="link" href="myisamlog.html" title="6.6.5 myisamlog — Display MyISAM Log File Contents">
<span class="command">
<strong>
myisamlog
</strong>
</span>
</a>
</p>
<p>
A utility that processes the contents of a
<code class="literal">
MyISAM
</code>
log file. See
<a class="xref" href="myisamlog.html" title="6.6.5 myisamlog — Display MyISAM Log File Contents">
Section 6.6.5, “myisamlog — Display MyISAM Log File Contents”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324373328">
</a>
<a class="link" href="myisampack.html" title="6.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables">
<span class="command">
<strong>
myisampack
</strong>
</span>
</a>
</p>
<p>
A utility that compresses
<code class="literal">
MyISAM
</code>
tables to
produce smaller read-only tables. See
<a class="xref" href="myisampack.html" title="6.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables">
Section 6.6.6, “myisampack — Generate Compressed, Read-Only MyISAM Tables”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324368240">
</a>
<a class="link" href="mysql-config-editor.html" title="6.6.7 mysql_config_editor — MySQL Configuration Utility">
<span class="command">
<strong>
mysql_config_editor
</strong>
</span>
</a>
</p>
<p>
A utility that enables you to store authentication credentials
in a secure, encrypted login path file named
<code class="filename">
.mylogin.cnf
</code>
. See
<a class="xref" href="mysql-config-editor.html" title="6.6.7 mysql_config_editor — MySQL Configuration Utility">
Section 6.6.7, “mysql_config_editor — MySQL Configuration Utility”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="mysql-migrate-keyring.html" title="6.6.8 mysql_migrate_keyring — Keyring Key Migration Utility">
<span class="command">
<strong>
mysql_migrate_keyring
</strong>
</span>
</a>
</p>
<a class="indexterm" name="idm46045324361680">
</a>
<p>
A utility for migrating keys between one keyring component and
another. See
<a class="xref" href="mysql-migrate-keyring.html" title="6.6.8 mysql_migrate_keyring — Keyring Key Migration Utility">
Section 6.6.8, “mysql_migrate_keyring — Keyring Key Migration Utility”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324358800">
</a>
<a class="link" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
<span class="command">
<strong>
mysqlbinlog
</strong>
</span>
</a>
</p>
<p>
A utility for reading statements from a binary log. The log of
executed statements contained in the binary log files can be
used to help recover from a crash. See
<a class="xref" href="mysqlbinlog.html" title="6.6.9 mysqlbinlog — Utility for Processing Binary Log Files">
Section 6.6.9, “mysqlbinlog — Utility for Processing Binary Log Files”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324354304">
</a>
<a class="link" href="mysqldumpslow.html" title="6.6.10 mysqldumpslow — Summarize Slow Query Log Files">
<span class="command">
<strong>
mysqldumpslow
</strong>
</span>
</a>
</p>
<p>
A utility to read and summarize the contents of a slow query
log. See
<a class="xref" href="mysqldumpslow.html" title="6.6.10 mysqldumpslow — Summarize Slow Query Log Files">
Section 6.6.10, “mysqldumpslow — Summarize Slow Query Log Files”
</a>
.
</p>
</li>
</ul>
</div>
<p>
MySQL program-development utilities:
</p>
<a class="indexterm" name="idm46045324349856">
</a>
<a class="indexterm" name="idm46045324348768">
</a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="link" href="mysql-config.html" title="6.7.1 mysql_config — Display Options for Compiling Clients">
<span class="command">
<strong>
mysql_config
</strong>
</span>
</a>
</p>
<p>
A shell script that produces the option values needed when
compiling MySQL programs. See
<a class="xref" href="mysql-config.html" title="6.7.1 mysql_config — Display Options for Compiling Clients">
Section 6.7.1, “mysql_config — Display Options for Compiling Clients”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324343360">
</a>
<a class="link" href="my-print-defaults.html" title="6.7.2 my_print_defaults — Display Options from Option Files">
<span class="command">
<strong>
my_print_defaults
</strong>
</span>
</a>
</p>
<p>
A utility that shows which options are present in option
groups of option files. See
<a class="xref" href="my-print-defaults.html" title="6.7.2 my_print_defaults — Display Options from Option Files">
Section 6.7.2, “my_print_defaults — Display Options from Option Files”
</a>
.
</p>
</li>
</ul>
</div>
<p>
Miscellaneous utilities:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="indexterm" name="idm46045324338144">
</a>
<a class="link" href="perror.html" title="6.8.1 perror — Display MySQL Error Message Information">
<span class="command">
<strong>
perror
</strong>
</span>
</a>
</p>
<p>
A utility that displays the meaning of system or MySQL error
codes. See
<a class="xref" href="perror.html" title="6.8.1 perror — Display MySQL Error Message Information">
Section 6.8.1, “perror — Display MySQL Error Message Information”
</a>
.
</p>
</li>
</ul>
</div>
<p>
Oracle Corporation also provides the
<a class="link" href="workbench.html" title="Chapter 33 MySQL Workbench">
MySQL Workbench
</a>
GUI tool, which
is used to administer MySQL servers and databases, to create,
execute, and evaluate queries, and to migrate schemas and data
from other relational database management systems for use with
MySQL.
</p>
<a class="indexterm" name="idm46045324332640">
</a>
<a class="indexterm" name="idm46045324331568">
</a>
<p>
MySQL client programs that communicate with the server using the
MySQL client/server library use the following environment
variables.
</p>
<a class="indexterm" name="idm46045324329520">
</a>
<a class="indexterm" name="idm46045324328432">
</a>
<a class="indexterm" name="idm46045324326944">
</a>
<a class="indexterm" name="idm46045324325856">
</a>
<a class="indexterm" name="idm46045324324368">
</a>
<a class="indexterm" name="idm46045324323280">
</a>
<a class="indexterm" name="idm46045324321792">
</a>
<a class="indexterm" name="idm46045324320704">
</a>
<div class="informaltable">
<table summary="Environment variables used by MySQL client programs that communicate with the server using the MySQL client/server library.">
<colgroup>
<col style="width: 25%"/>
<col style="width: 75%"/>
</colgroup>
<thead>
<tr>
<th>
Environment Variable
</th>
<th>
Meaning
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="literal">
MYSQL_UNIX_PORT
</code>
</td>
<td>
The default Unix socket file; used for connections to
<code class="literal">
localhost
</code>
</td>
</tr>
<tr>
<td>
<code class="literal">
MYSQL_TCP_PORT
</code>
</td>
<td>
The default port number; used for TCP/IP connections
</td>
</tr>
<tr>
<td>
<code class="literal">
MYSQL_DEBUG
</code>
</td>
<td>
Debug trace options when debugging
</td>
</tr>
<tr>
<td>
<code class="literal">
TMPDIR
</code>
</td>
<td>
The directory where temporary tables and files are created
</td>
</tr>
</tbody>
</table>
</div>
<p>
For a full list of environment variables used by MySQL programs,
see
<a class="xref" href="environment-variables.html" title="6.9 Environment Variables">
Section 6.9, “Environment Variables”
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/data-masking-components-installation.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="data-masking-components-installation">
</a>
8.5.2.1 MySQL Enterprise Data Masking and De-Identification Component Installation
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045233427440">
</a>
<a class="indexterm" name="idm46045233425952">
</a>
<a class="indexterm" name="idm46045233424496">
</a>
<a class="indexterm" name="idm46045233423008">
</a>
<a class="indexterm" name="idm46045233421504">
</a>
<a class="indexterm" name="idm46045233420000">
</a>
<a class="indexterm" name="idm46045233418512">
</a>
<p>
Components provide expanded access to MySQL Enterprise Data Masking and De-Identification functionality.
Previously, MySQL implemented masking and de-identification
capabilities as a plugin library file containing a plugin and
several loadable functions. Before you begin the component
installation, remove the
<code class="literal">
data_masking
</code>
plugin
and all of its loadable functions to avoid conflicts. For
instructions, see
<a class="xref" href="data-masking-plugin-installation.html" title="8.5.3.1 MySQL Enterprise Data Masking and De-Identification Plugin Installation">
Section 8.5.3.1, “MySQL Enterprise Data Masking and De-Identification Plugin Installation”
</a>
.
</p>
<p>
MySQL Enterprise Data Masking and De-Identification database table and components are:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
masking_dictionaries
</code>
table
</p>
<p>
Purpose: A table that provides persistent storage for
masking dictionaries and terms. While the
<code class="literal">
mysql
</code>
system schema is the traditional
storage option, creating a dedicated schema for this purpose
is also permitted. A dedicated schema might be preferable
for these reasons:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
The
<code class="literal">
mysql
</code>
system schema is not backed
up by a logical backup, such as
<a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
<span class="command">
<strong>
mysqldump
</strong>
</span>
</a>
or load operations.
</p>
</li>
<li class="listitem">
<p>
A dedicated schema makes outbound replication easier.
</p>
</li>
<li class="listitem">
<p>
A user or role requires no
<code class="literal">
mysql
</code>
schema privileges when preforming related data-masking
tasks in the dedicated schema.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<code class="literal">
component_masking
</code>
component
</p>
<p>
Purpose: The component implements the core of the masking
functionality and exposes it as services.
</p>
<p>
URN:
<code class="literal">
file://component_masking
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
component_masking_functions
</code>
component
</p>
<p>
Purpose: The component exposes all functionality of the
<code class="literal">
component_masking
</code>
component as loadable
functions. Some of the functions require the
<a class="link" href="privileges-provided.html#priv_masking-dictionaries-admin">
<code class="literal">
MASKING_DICTIONARIES_ADMIN
</code>
</a>
dynamic privilege.
</p>
<p>
URN:
<code class="literal">
file://component_masking_functions
</code>
</p>
</li>
</ul>
</div>
<p>
If the components and functions are used on a replication source
server, install them on all replica servers as well to avoid
replication issues. While the components are loaded, information
about them is available as described in
<a class="xref" href="obtaining-component-information.html" title="7.5.2 Obtaining Component Information">
Section 7.5.2, “Obtaining Component Information”
</a>
. For general
information about installing or uninstalling components, see
<a class="xref" href="component-loading.html" title="7.5.1 Installing and Uninstalling Components">
Section 7.5.1, “Installing and Uninstalling Components”
</a>
.
</p>
<p>
MySQL Enterprise Data Masking and De-Identification supports these setup and removal procedures:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="xref" href="data-masking-components-installation.html#data-masking-components-installation-mysql" title="Install Using the mysql System Schema">
Install Using the mysql System Schema
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="data-masking-components-installation.html#data-masking-components-installation-dedicated" title="Install Using a Dedicated Schema">
Install Using a Dedicated Schema
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="data-masking-components-installation.html#data-masking-components-uninstall" title="Uninstall MySQL Enterprise Data Masking and De-Identification Components">
Uninstall MySQL Enterprise Data Masking and De-Identification Components
</a>
</p>
</li>
</ul>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="data-masking-components-installation-mysql">
</a>
Install Using the mysql System Schema
</h5>
</div>
</div>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Consider using a dedicated schema to store data-masking
dictionaries (see
<a class="xref" href="data-masking-components-installation.html#data-masking-components-installation-dedicated" title="Install Using a Dedicated Schema">
Install Using a Dedicated Schema
</a>
).
</p>
</div>
<p>
To set up MySQL Enterprise Data Masking and De-Identification:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Run
<code class="filename">
masking_functions_install.sql
</code>
to
add the
<code class="literal">
masking_dictionaries
</code>
table to
the
<code class="literal">
mysql
</code>
schema and install the
components. The script is located in the
<code class="filename">
share
</code>
directory of your MySQL
installation.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa87958442"><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">$> </span><span class="token command">mysql</span> <span class="token property">-u</span> root <span class="token property">-p</span> <span class="token property">-D</span> mysql < <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">[</span>path/<span class="token punctuation">]</span></em><span class="token punctuation"></span>masking_functions_install<span class="token punctuation">.</span>sql
Enter password<span class="token punctuation">:</span> <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">(</span>enter root password here<span class="token punctuation">)</span></em><span class="token punctuation"></span></code></pre>
</div>
</li>
</ol>
</div>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="data-masking-components-installation-dedicated">
</a>
Install Using a Dedicated Schema
</h5>
</div>
</div>
</div>
<p>
To set up MySQL Enterprise Data Masking and De-Identification:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Create a database to store the
<code class="literal">
masking_dictionaries
</code>
table. For
example, to use
<code class="literal">
mask_db
</code>
as the database
name, execute this statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa61874495"><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 operator">></span> mysql <span class="token operator">-</span>u root <span class="token operator">-</span>p <span class="token operator">-</span>e <span class="token string">"CREATE DATABASE IF NOT EXISTS mask_db"</span>
Enter <span class="token keyword">password</span>: <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">(</span>enter root <span class="token keyword">password</span> here<span class="token punctuation">)</span></em><span class="token punctuation"></span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Run
<code class="filename">
masking_functions_install.sql
</code>
to
add the
<code class="literal">
masking_dictionaries
</code>
table to
the
<code class="literal">
mask_db
</code>
schema and install the
components. The script is located in the
<code class="filename">
share
</code>
directory of your MySQL
installation.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa97517008"><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">$> </span><span class="token command">mysql</span> <span class="token property">-u</span> root <span class="token property">-p</span> <span class="token property">-D</span> mask_db < <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">[</span>path/<span class="token punctuation">]</span></em><span class="token punctuation"></span>masking_functions_install<span class="token punctuation">.</span>sql
Enter password<span class="token punctuation">:</span> <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">(</span>enter root password here<span class="token punctuation">)</span></em><span class="token punctuation"></span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Set and persist the
<code class="literal">
mask_db
</code>
schema at
startup by preceding the
<a class="link" href="data-masking-component-variables.html#sysvar_component_masking.masking_database">
<code class="literal">
component_masking.masking_database
</code>
</a>
read-only variable name by the
<code class="literal">
PERSIST_ONLY
</code>
keyword.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa36495796"><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 operator">></span> mysql <span class="token operator">-</span>u root <span class="token operator">-</span>p <span class="token operator">-</span>e <span class="token string">"SET PERSIST_ONLY component_masking.masking_database=mask_db"</span>
Enter <span class="token keyword">password</span>: <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">(</span>enter root <span class="token keyword">password</span> here<span class="token punctuation">)</span></em><span class="token punctuation"></span></code></pre>
</div>
<p>
After modifying the variable, restart the server to cause
the new setting to take effect.
</p>
</li>
</ol>
</div>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="data-masking-components-uninstall">
</a>
Uninstall MySQL Enterprise Data Masking and De-Identification Components
</h5>
</div>
</div>
</div>
<p>
To remove MySQL Enterprise Data Masking and De-Identification when using the
<code class="literal">
mysql
</code>
system schema:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Run
<code class="filename">
masking_functions_uninstall.sql
</code>
to remove the
<code class="literal">
masking_dictionaries
</code>
table from the appropriate schema and uninstall the
components. The script is located in the
<code class="filename">
share
</code>
directory of your MySQL
installation. The example here specifies the
<code class="literal">
mysql
</code>
database.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa65460098"><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">$> </span><span class="token command">mysql</span> <span class="token property">-u</span> root <span class="token property">-p</span> <span class="token property">-D</span> mysql < <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">[</span>path/<span class="token punctuation">]</span></em><span class="token punctuation"></span>masking_functions_uninstall<span class="token punctuation">.</span>sql
Enter password<span class="token punctuation">:</span> <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">(</span>enter root password here<span class="token punctuation">)</span></em><span class="token punctuation"></span></code></pre>
</div>
</li>
</ol>
</div>
<p>
To remove MySQL Enterprise Data Masking and De-Identification when using a dedicated schema:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Run
<code class="filename">
masking_functions_uninstall.sql
</code>
to remove the
<code class="literal">
masking_dictionaries
</code>
table from the appropriate schema and uninstall the
components. The script is located in the
<code class="filename">
share
</code>
directory of your MySQL
installation. The example here specifies the
<code class="literal">
mask_db
</code>
database.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa18512510"><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">$> </span><span class="token command">mysql</span> <span class="token property">-u</span> root <span class="token property">-p</span> <span class="token property">-D</span> mask_db < <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">[</span>path/<span class="token punctuation">]</span></em><span class="token punctuation"></span>masking_functions_uninstall<span class="token punctuation">.</span>sql
Enter password<span class="token punctuation">:</span> <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">(</span>enter root password here<span class="token punctuation">)</span></em><span class="token punctuation"></span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Stop persisting the
<a class="link" href="data-masking-component-variables.html#sysvar_component_masking.masking_database">
<code class="literal">
component_masking.masking_database
</code>
</a>
variable.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa66183128"><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 operator">></span> mysql <span class="token operator">-</span>u root <span class="token operator">-</span>p <span class="token operator">-</span>e <span class="token string">"RESET PERSIST component_masking.masking_database"</span>
Enter <span class="token keyword">password</span>: <span class="token punctuation"></span><em class="replaceable"><span class="token punctuation">(</span>enter root <span class="token keyword">password</span> here<span class="token punctuation">)</span></em><span class="token punctuation"></span></code></pre>
</div>
</li>
<li class="listitem">
<p>
[Optional] Drop the dedicated schema to ensure that it is
not used for other purposes.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa87374942"><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">DROP</span> <span class="token keyword">DATABASE</span> mask_db<span class="token punctuation">;</span></code></pre>
</div>
</li>
</ol>
</div>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/replication-features-differing-tables.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="replication-features-differing-tables">
</a>
19.5.1.9 Replication with Differing Table Definitions on Source and Replica
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045135846736">
</a>
<p>
Source and target tables for replication do not have to be
identical. A table on the source can have more or fewer columns
than the replica's copy of the table. In addition, corresponding
table columns on the source and the replica can use different
data types, subject to certain conditions.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Replication between tables which are partitioned differently
from one another is not supported. See
<a class="xref" href="replication-features-partitioning.html" title="19.5.1.24 Replication and Partitioning">
Section 19.5.1.24, “Replication and Partitioning”
</a>
.
</p>
</div>
<p>
In all cases where the source and target tables do not have
identical definitions, the database and table names must be the
same on both the source and the replica. Additional conditions
are discussed, with examples, in the following two sections.
</p>
<div class="section">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="replication-features-more-columns">
</a>
19.5.1.9.1 Replication with More Columns on Source or Replica
</h5>
</div>
</div>
</div>
<p>
You can replicate a table from the source to the replica such
that the source and replica copies of the table have differing
numbers of columns, subject to the following conditions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Columns common to both versions of the table must be
defined in the same order on the source and the replica.
(This is true even if both tables have the same number of
columns.)
</p>
</li>
<li class="listitem">
<p>
Columns common to both versions of the table must be
defined before any additional columns.
</p>
<p>
This means that executing an
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER
TABLE
</code>
</a>
statement on the replica where a new
column is inserted into the table within the range of
columns common to both tables causes replication to fail,
as shown in the following example:
</p>
<p>
Suppose that a table
<code class="literal">
t
</code>
, existing on the
source and the replica, is defined by the following
<a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
<code class="literal">
CREATE TABLE
</code>
</a>
statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa12214815"><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">CREATE</span> <span class="token keyword">TABLE</span> t <span class="token punctuation">(</span>
c1 <span class="token datatype">INT</span><span class="token punctuation">,</span>
c2 <span class="token datatype">INT</span><span class="token punctuation">,</span>
c3 <span class="token datatype">INT</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Suppose that the
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER
TABLE
</code>
</a>
statement shown here is executed on the
replica:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa56943542"><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">ALTER</span> <span class="token keyword">TABLE</span> t <span class="token keyword">ADD</span> <span class="token keyword">COLUMN</span> cnew1 <span class="token datatype">INT</span> <span class="token keyword">AFTER</span> c3<span class="token punctuation">;</span></code></pre>
</div>
<p>
The previous
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
is
permitted on the replica because the columns
<code class="literal">
c1
</code>
,
<code class="literal">
c2
</code>
, and
<code class="literal">
c3
</code>
that are common to both versions of
table
<code class="literal">
t
</code>
remain grouped together in both
versions of the table, before any columns that differ.
</p>
<p>
However, the following
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER
TABLE
</code>
</a>
statement cannot be executed on the
replica without causing replication to break:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa87979930"><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">ALTER</span> <span class="token keyword">TABLE</span> t <span class="token keyword">ADD</span> <span class="token keyword">COLUMN</span> cnew2 <span class="token datatype">INT</span> <span class="token keyword">AFTER</span> c2<span class="token punctuation">;</span></code></pre>
</div>
<p>
Replication fails after execution on the replica of the
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
statement just
shown, because the new column
<code class="literal">
cnew2
</code>
comes between columns common to both versions of
<code class="literal">
t
</code>
.
</p>
</li>
<li class="listitem">
<p>
Each
<span class="quote">
“
<span class="quote">
extra
</span>
”
</span>
column in the version of the
table having more columns must have a default value.
</p>
<p>
A column's default value is determined by a number of
factors, including its type, whether it is defined with a
<code class="literal">
DEFAULT
</code>
option, whether it is declared
as
<code class="literal">
NULL
</code>
, and the server SQL mode in
effect at the time of its creation; for more information,
see
<a class="xref" href="data-type-defaults.html" title="13.6 Data Type Default Values">
Section 13.6, “Data Type Default Values”
</a>
).
</p>
</li>
</ul>
</div>
<p>
In addition, when the replica's copy of the table has more
columns than the source's copy, each column common to the
tables must use the same data type in both tables.
</p>
<p>
<b>
Examples.
</b>
The following examples illustrate some valid and invalid
table definitions:
</p>
<p>
<b>
More columns on the source.
</b>
The following table definitions are valid and replicate
correctly:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa49500955"><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">source></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">INT</span><span class="token punctuation">,</span> c3 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">replica></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The following table definitions would raise an error because
the definitions of the columns common to both versions of the
table are in a different order on the replica than they are on
the source:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa91400474"><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">source></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">INT</span><span class="token punctuation">,</span> c3 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">replica></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c2 <span class="token datatype">INT</span><span class="token punctuation">,</span> c1 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The following table definitions would also raise an error
because the definition of the extra column on the source
appears before the definitions of the columns common to both
versions of the table:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa53615703"><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">source></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c3 <span class="token datatype">INT</span><span class="token punctuation">,</span> c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">replica></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
<b>
More columns on the replica.
</b>
The following table definitions are valid and replicate
correctly:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa54078090"><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">source></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">replica></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">INT</span><span class="token punctuation">,</span> c3 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The following definitions raise an error because the columns
common to both versions of the table are not defined in the
same order on both the source and the replica:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa56374128"><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">source></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">replica></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c2 <span class="token datatype">INT</span><span class="token punctuation">,</span> c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c3 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The following table definitions also raise an error because
the definition for the extra column in the replica's version
of the table appears before the definitions for the columns
which are common to both versions of the table:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa59581072"><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">source></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">replica></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c3 <span class="token datatype">INT</span><span class="token punctuation">,</span> c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The following table definitions fail because the replica's
version of the table has additional columns compared to the
source's version, and the two versions of the table use
different data types for the common column
<code class="literal">
c2
</code>
:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa89277255"><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">source></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">BIGINT</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">replica></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>c1 <span class="token datatype">INT</span><span class="token punctuation">,</span> c2 <span class="token datatype">INT</span><span class="token punctuation">,</span> c3 <span class="token datatype">INT</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="replication-features-different-data-types">
</a>
19.5.1.9.2 Replication of Columns Having Different Data Types
</h5>
</div>
</div>
</div>
<a class="indexterm" name="idm46045135788736">
</a>
<a class="indexterm" name="idm46045135787248">
</a>
<a class="indexterm" name="idm46045135785760">
</a>
<a class="indexterm" name="idm46045135784272">
</a>
<p>
Corresponding columns on the source's and the
replica's copies of the same table ideally should have
the same data type. However, this is not always strictly
enforced, as long as certain conditions are met.
</p>
<p>
It is usually possible to replicate from a column of a given
data type to another column of the same type and same size or
width, where applicable, or larger. For example, you can
replicate from a
<code class="literal">
CHAR(10)
</code>
column to another
<code class="literal">
CHAR(10)
</code>
, or from a
<code class="literal">
CHAR(10)
</code>
column to a
<code class="literal">
CHAR(25)
</code>
column without any problems. In
certain cases, it also possible to replicate from a column
having one data type (on the source) to a column having a
different data type (on the replica); when the data type of
the source's version of the column is promoted to a type
that is the same size or larger on the replica, this is known
as
<span class="firstterm">
attribute promotion
</span>
.
</p>
<p>
Attribute promotion can be used with both statement-based and
row-based replication, and is not dependent on the storage
engine used by either the source or the replica. However, the
choice of logging format does have an effect on the type
conversions that are permitted; the particulars are discussed
later in this section.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
Whether you use statement-based or row-based replication,
the replica's copy of the table cannot contain more
columns than the source's copy if you wish to employ
attribute promotion.
</p>
</div>
<p>
<b>
Statement-based replication.
</b>
When using statement-based replication, a simple rule of
thumb to follow is,
<span class="quote">
“
<span class="quote">
If the statement run on the
source would also execute successfully on the replica, it
should also replicate successfully
</span>
”
</span>
. In other words,
if the statement uses a value that is compatible with the
type of a given column on the replica, the statement can be
replicated. For example, you can insert any value that fits
in a
<code class="literal">
TINYINT
</code>
column into a
<code class="literal">
BIGINT
</code>
column as well; it follows that,
even if you change the type of a
<code class="literal">
TINYINT
</code>
column in the replica's copy of a table to
<code class="literal">
BIGINT
</code>
, any insert into that column on
the source that succeeds should also succeed on the replica,
since it is impossible to have a legal
<code class="literal">
TINYINT
</code>
value that is large enough to
exceed a
<code class="literal">
BIGINT
</code>
column.
</p>
<p>
<a name="replication-features-attribute-promotion">
</a>
<b>
Row-based replication: attribute promotion and demotion.
</b>
Row-based replication supports attribute promotion and
demotion between smaller data types and larger types. It is
also possible to specify whether or not to permit lossy
(truncated) or non-lossy conversions of demoted column
values, as explained later in this section.
</p>
<p>
<b>
Lossy and non-lossy conversions.
</b>
In the event that the target type cannot represent the value
being inserted, a decision must be made on how to handle the
conversion. If we permit the conversion but truncate (or
otherwise modify) the source value to achieve a
<span class="quote">
“
<span class="quote">
fit
</span>
”
</span>
in the target column, we make what is
known as a
<span class="firstterm">
lossy
conversion
</span>
. A conversion which does not require
truncation or similar modifications to fit the source column
value in the target column is a
<span class="firstterm">
non-lossy
</span>
conversion.
</p>
<p>
<b>
Type conversion modes.
</b>
The global value of the system variable
<code class="literal">
replica_type_conversions
</code>
controls the
type conversion mode used on the replica. This variable
takes a set of values from the following list, which
describes the effects of each mode on the replica's
type-conversion behavior:
</p>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
ALL_LOSSY
</span>
</dt>
<dd>
<p>
In this mode, type conversions that would mean loss of
information are permitted.
</p>
<p>
This does not imply that non-lossy conversions are
permitted, merely that only cases requiring either lossy
conversions or no conversion at all are permitted; for
example, enabling
<span class="emphasis">
<em>
only
</em>
</span>
this mode
permits an
<code class="literal">
INT
</code>
column to be converted
to
<code class="literal">
TINYINT
</code>
(a lossy conversion), but
not a
<code class="literal">
TINYINT
</code>
column to an
<code class="literal">
INT
</code>
column (non-lossy). Attempting
the latter conversion in this case would cause
replication to stop with an error on the replica.
</p>
</dd>
<dt>
<span class="term">
ALL_NON_LOSSY
</span>
</dt>
<dd>
<p>
This mode permits conversions that do not require
truncation or other special handling of the source
value; that is, it permits conversions where the target
type has a wider range than the source type.
</p>
<p>
Setting this mode has no bearing on whether lossy
conversions are permitted; this is controlled with the
<code class="literal">
ALL_LOSSY
</code>
mode. If only
<code class="literal">
ALL_NON_LOSSY
</code>
is set, but not
<code class="literal">
ALL_LOSSY
</code>
, then attempting a
conversion that would result in the loss of data (such
as
<code class="literal">
INT
</code>
to
<code class="literal">
TINYINT
</code>
,
or
<code class="literal">
CHAR(25)
</code>
to
<code class="literal">
VARCHAR(20)
</code>
) causes the replica to
stop with an error.
</p>
</dd>
<dt>
<span class="term">
ALL_LOSSY,ALL_NON_LOSSY
</span>
</dt>
<dd>
<p>
When this mode is set, all supported type conversions
are permitted, whether or not they are lossy
conversions.
</p>
</dd>
<dt>
<span class="term">
ALL_SIGNED
</span>
</dt>
<dd>
<p>
Treat promoted integer types as signed values (the
default behavior).
</p>
</dd>
<dt>
<span class="term">
ALL_UNSIGNED
</span>
</dt>
<dd>
<p>
Treat promoted integer types as unsigned values.
</p>
</dd>
<dt>
<span class="term">
ALL_SIGNED,ALL_UNSIGNED
</span>
</dt>
<dd>
<p>
Treat promoted integer types as signed if possible,
otherwise as unsigned.
</p>
</dd>
<dt>
<span class="term">
[
<span class="emphasis">
<em>
empty
</em>
</span>
]
</span>
</dt>
<dd>
<p>
When
<code class="literal">
replica_type_conversions
</code>
is not
set, no attribute promotion or demotion is permitted;
this means that all columns in the source and target
tables must be of the same types.
</p>
<p>
This mode is the default.
</p>
</dd>
</dl>
</div>
<p>
When an integer type is promoted, its signedness is not
preserved. By default, the replica treats all such values as
signed. You can control this behavior using
<code class="literal">
ALL_SIGNED
</code>
,
<code class="literal">
ALL_UNSIGNED
</code>
, or both.
<code class="literal">
ALL_SIGNED
</code>
tells the replica to treat all
promoted integer types as signed;
<code class="literal">
ALL_UNSIGNED
</code>
instructs it to treat these as
unsigned. Specifying both causes the replica to treat the
value as signed if possible, otherwise to treat it as
unsigned; the order in which they are listed is not
significant. Neither
<code class="literal">
ALL_SIGNED
</code>
nor
<code class="literal">
ALL_UNSIGNED
</code>
has any effect if at least one
of
<code class="literal">
ALL_LOSSY
</code>
or
<code class="literal">
ALL_NONLOSSY
</code>
is not also used.
</p>
<p>
Changing the type conversion mode requires restarting the
replica with the new
<code class="literal">
replica_type_conversions
</code>
setting.
</p>
<p>
<b>
Supported conversions.
</b>
Supported conversions between different but similar data
types are shown in the following list:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Between any of the integer types
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
TINYINT
</code>
</a>
,
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
SMALLINT
</code>
</a>
,
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
MEDIUMINT
</code>
</a>
,
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
INT
</code>
</a>
, and
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BIGINT
</code>
</a>
.
</p>
<p>
This includes conversions between the signed and unsigned
versions of these types.
</p>
<p>
Lossy conversions are made by truncating the source value
to the maximum (or minimum) permitted by the target
column. For ensuring non-lossy conversions when going from
unsigned to signed types, the target column must be large
enough to accommodate the range of values in the source
column. For example, you can demote
<code class="literal">
TINYINT
UNSIGNED
</code>
non-lossily to
<code class="literal">
SMALLINT
</code>
, but not to
<code class="literal">
TINYINT
</code>
.
</p>
</li>
<li class="listitem">
<p>
Between any of the decimal types
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DECIMAL
</code>
</a>
,
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT
</code>
</a>
,
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
, and
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
NUMERIC
</code>
</a>
.
</p>
<p>
<code class="literal">
FLOAT
</code>
to
<code class="literal">
DOUBLE
</code>
is a
non-lossy conversion;
<code class="literal">
DOUBLE
</code>
to
<code class="literal">
FLOAT
</code>
can only be handled lossily. A
conversion from
<code class="literal">
DECIMAL(
<em class="replaceable">
<code>
M
</code>
</em>
,
<em class="replaceable">
<code>
D
</code>
</em>
)
</code>
to
<code class="literal">
DECIMAL(
<em class="replaceable">
<code>
M'
</code>
</em>
,
<em class="replaceable">
<code>
D'
</code>
</em>
)
</code>
where
<code class="literal">
<em class="replaceable">
<code>
D'
</code>
</em>
>=
<em class="replaceable">
<code>
D
</code>
</em>
</code>
and
<code class="literal">
(
<em class="replaceable">
<code>
M'
</code>
</em>
-
<em class="replaceable">
<code>
D'
</code>
</em>
)
>=
(
<em class="replaceable">
<code>
M
</code>
</em>
-
<em class="replaceable">
<code>
D
</code>
</em>
</code>
)
is non-lossy; for any case where
<code class="literal">
<em class="replaceable">
<code>
M'
</code>
</em>
<
<em class="replaceable">
<code>
M
</code>
</em>
</code>
,
<code class="literal">
<em class="replaceable">
<code>
D'
</code>
</em>
<
<em class="replaceable">
<code>
D
</code>
</em>
</code>
, or both, only a
lossy conversion can be made.
</p>
<p>
For any of the decimal types, if a value to be stored
cannot be fit in the target type, the value is rounded
down according to the rounding rules defined for the
server elsewhere in the documentation. See
<a class="xref" href="precision-math-rounding.html" title="14.24.4 Rounding Behavior">
Section 14.24.4, “Rounding Behavior”
</a>
, for information
about how this is done for decimal types.
</p>
</li>
<li class="listitem">
<p>
Between any of the string types
<a class="link" href="char.html" title="13.3.2 The CHAR and VARCHAR Types">
<code class="literal">
CHAR
</code>
</a>
,
<a class="link" href="char.html" title="13.3.2 The CHAR and VARCHAR Types">
<code class="literal">
VARCHAR
</code>
</a>
, and
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
TEXT
</code>
</a>
, including conversions
between different widths.
</p>
<p>
Conversion of a
<code class="literal">
CHAR
</code>
,
<code class="literal">
VARCHAR
</code>
, or
<code class="literal">
TEXT
</code>
to
a
<code class="literal">
CHAR
</code>
,
<code class="literal">
VARCHAR
</code>
, or
<code class="literal">
TEXT
</code>
column the same size or larger is
never lossy. Lossy conversion is handled by inserting only
the first
<em class="replaceable">
<code>
N
</code>
</em>
characters of the
string on the replica, where
<em class="replaceable">
<code>
N
</code>
</em>
is the width of the target column.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
Replication between columns using different character
sets is not supported.
</p>
</div>
</li>
<li class="listitem">
<p>
Between any of the binary data types
<a class="link" href="binary-varbinary.html" title="13.3.3 The BINARY and VARBINARY Types">
<code class="literal">
BINARY
</code>
</a>
,
<a class="link" href="binary-varbinary.html" title="13.3.3 The BINARY and VARBINARY Types">
<code class="literal">
VARBINARY
</code>
</a>
, and
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
BLOB
</code>
</a>
, including conversions
between different widths.
</p>
<p>
Conversion of a
<code class="literal">
BINARY
</code>
,
<code class="literal">
VARBINARY
</code>
, or
<code class="literal">
BLOB
</code>
to a
<code class="literal">
BINARY
</code>
,
<code class="literal">
VARBINARY
</code>
, or
<code class="literal">
BLOB
</code>
column the same size or larger is never lossy. Lossy
conversion is handled by inserting only the first
<em class="replaceable">
<code>
N
</code>
</em>
bytes of the string on the
replica, where
<em class="replaceable">
<code>
N
</code>
</em>
is the width
of the target column.
</p>
</li>
<li class="listitem">
<p>
Between any 2
<a class="link" href="bit-type.html" title="13.1.5 Bit-Value Type - BIT">
<code class="literal">
BIT
</code>
</a>
columns
of any 2 sizes.
</p>
<p>
When inserting a value from a
<code class="literal">
BIT(
<em class="replaceable">
<code>
M
</code>
</em>
)
</code>
column into a
<code class="literal">
BIT(
<em class="replaceable">
<code>
M'
</code>
</em>
)
</code>
column, where
<code class="literal">
<em class="replaceable">
<code>
M'
</code>
</em>
>
<em class="replaceable">
<code>
M
</code>
</em>
</code>
, the most
significant bits of the
<code class="literal">
BIT(
<em class="replaceable">
<code>
M'
</code>
</em>
)
</code>
columns are cleared (set to zero) and the
<em class="replaceable">
<code>
M
</code>
</em>
bits of the
<code class="literal">
BIT(
<em class="replaceable">
<code>
M
</code>
</em>
)
</code>
value
are set as the least significant bits of the
<code class="literal">
BIT(
<em class="replaceable">
<code>
M'
</code>
</em>
)
</code>
column.
</p>
<p>
When inserting a value from a source
<code class="literal">
BIT(
<em class="replaceable">
<code>
M
</code>
</em>
)
</code>
column into a target
<code class="literal">
BIT(
<em class="replaceable">
<code>
M'
</code>
</em>
)
</code>
column, where
<code class="literal">
<em class="replaceable">
<code>
M'
</code>
</em>
<
<em class="replaceable">
<code>
M
</code>
</em>
</code>
, the maximum
possible value for the
<code class="literal">
BIT(
<em class="replaceable">
<code>
M'
</code>
</em>
)
</code>
column is assigned; in other words, an
<span class="quote">
“
<span class="quote">
all-set
</span>
”
</span>
value is assigned to the target
column.
</p>
</li>
</ul>
</div>
<p>
Conversions between types not in the previous list are not
permitted.
</p>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/range-optimization.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="range-optimization">
</a>
10.2.1.2 Range Optimization
</h4>
</div>
</div>
</div>
<p>
The
<a class="link" href="explain-output.html#jointype_range">
<code class="literal">
range
</code>
</a>
access method
uses a single index to retrieve a subset of table rows that
are contained within one or several index value intervals. It
can be used for a single-part or multiple-part index. The
following sections describe conditions under which the
optimizer uses range access.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="xref" href="range-optimization.html#range-access-single-part" title="Range Access Method for Single-Part Indexes">
Range Access Method for Single-Part Indexes
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="range-optimization.html#range-access-multi-part" title="Range Access Method for Multiple-Part Indexes">
Range Access Method for Multiple-Part Indexes
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="range-optimization.html#equality-range-optimization" title="Equality Range Optimization of Many-Valued Comparisons">
Equality Range Optimization of Many-Valued Comparisons
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="range-optimization.html#range-access-skip-scan" title="Skip Scan Range Access Method">
Skip Scan Range Access Method
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="range-optimization.html#row-constructor-range-optimization" title="Range Optimization of Row Constructor Expressions">
Range Optimization of Row Constructor Expressions
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="range-optimization.html#range-optimization-memory-use" title="Limiting Memory Use for Range Optimization">
Limiting Memory Use for Range Optimization
</a>
</p>
</li>
</ul>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="range-access-single-part">
</a>
Range Access Method for Single-Part Indexes
</h5>
</div>
</div>
</div>
<p>
For a single-part index, index value intervals can be
conveniently represented by corresponding conditions in the
<code class="literal">
WHERE
</code>
clause, denoted as
<span class="firstterm">
range conditions
</span>
rather than
<span class="quote">
“
<span class="quote">
intervals.
</span>
”
</span>
</p>
<p>
The definition of a range condition for a single-part index
is as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
For both
<code class="literal">
BTREE
</code>
and
<code class="literal">
HASH
</code>
indexes, comparison of a key
part with a constant value is a range condition when
using the
<a class="link" href="comparison-operators.html#operator_equal">
<code class="literal">
=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_equal-to">
<code class="literal">
<=>
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_in">
<code class="literal">
IN()
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_is-null">
<code class="literal">
IS
NULL
</code>
</a>
, or
<a class="link" href="comparison-operators.html#operator_is-not-null">
<code class="literal">
IS NOT
NULL
</code>
</a>
operators.
</p>
</li>
<li class="listitem">
<p>
Additionally, for
<code class="literal">
BTREE
</code>
indexes,
comparison of a key part with a constant value is a
range condition when using the
<a class="link" href="comparison-operators.html#operator_greater-than">
<code class="literal">
>
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_less-than">
<code class="literal">
<
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_greater-than-or-equal">
<code class="literal">
>=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_less-than-or-equal">
<code class="literal">
<=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_between">
<code class="literal">
BETWEEN
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_not-equal">
<code class="literal">
!=
</code>
</a>
,
or
<a class="link" href="comparison-operators.html#operator_not-equal">
<code class="literal">
<>
</code>
</a>
operators, or
<a class="link" href="string-comparison-functions.html#operator_like">
<code class="literal">
LIKE
</code>
</a>
comparisons if the argument to
<a class="link" href="string-comparison-functions.html#operator_like">
<code class="literal">
LIKE
</code>
</a>
is a constant string
that does not start with a wildcard character.
</p>
</li>
<li class="listitem">
<p>
For all index types, multiple range conditions combined
with
<a class="link" href="logical-operators.html#operator_or">
<code class="literal">
OR
</code>
</a>
or
<a class="link" href="logical-operators.html#operator_and">
<code class="literal">
AND
</code>
</a>
form a range condition.
</p>
</li>
</ul>
</div>
<p>
<span class="quote">
“
<span class="quote">
Constant value
</span>
”
</span>
in the preceding descriptions
means one of the following:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
A constant from the query string
</p>
</li>
<li class="listitem">
<p>
A column of a
<a class="link" href="explain-output.html#jointype_const">
<code class="literal">
const
</code>
</a>
or
<a class="link" href="explain-output.html#jointype_system">
<code class="literal">
system
</code>
</a>
table from
the same join
</p>
</li>
<li class="listitem">
<p>
The result of an uncorrelated subquery
</p>
</li>
<li class="listitem">
<p>
Any expression composed entirely from subexpressions of
the preceding types
</p>
</li>
</ul>
</div>
<p>
Here are some examples of queries with range conditions in
the
<code class="literal">
WHERE
</code>
clause:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa49950879"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1
<span class="token keyword">WHERE</span> <em class="replaceable">key_col</em> <span class="token operator">></span> <span class="token number">1</span>
<span class="token operator">AND</span> <em class="replaceable">key_col</em> <span class="token operator"><</span> <span class="token number">10</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1
<span class="token keyword">WHERE</span> <em class="replaceable">key_col</em> <span class="token operator">=</span> <span class="token number">1</span>
<span class="token operator">OR</span> <em class="replaceable">key_col</em> <span class="token keyword">IN</span> <span class="token punctuation">(</span><span class="token number">15</span><span class="token punctuation">,</span><span class="token number">18</span><span class="token punctuation">,</span><span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1
<span class="token keyword">WHERE</span> <em class="replaceable">key_col</em> <span class="token operator">LIKE</span> <span class="token string">'ab%'</span>
<span class="token operator">OR</span> <em class="replaceable">key_col</em> <span class="token operator">BETWEEN</span> <span class="token string">'bar'</span> <span class="token operator">AND</span> <span class="token string">'foo'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Some nonconstant values may be converted to constants during
the optimizer constant propagation phase.
</p>
<p>
MySQL tries to extract range conditions from the
<code class="literal">
WHERE
</code>
clause for each of the possible
indexes. During the extraction process, conditions that
cannot be used for constructing the range condition are
dropped, conditions that produce overlapping ranges are
combined, and conditions that produce empty ranges are
removed.
</p>
<p>
Consider the following statement, where
<code class="literal">
key1
</code>
is an indexed column and
<code class="literal">
nonkey
</code>
is not indexed:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa88180431"><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">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">WHERE</span>
<span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'abc'</span> <span class="token operator">AND</span> <span class="token punctuation">(</span>key1 <span class="token operator">LIKE</span> <span class="token string">'abcde%'</span> <span class="token operator">OR</span> key1 <span class="token operator">LIKE</span> <span class="token string">'%b'</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">OR</span>
<span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'bar'</span> <span class="token operator">AND</span> nonkey <span class="token operator">=</span> <span class="token number">4</span><span class="token punctuation">)</span> <span class="token operator">OR</span>
<span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'uux'</span> <span class="token operator">AND</span> key1 <span class="token operator">></span> <span class="token string">'z'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The extraction process for key
<code class="literal">
key1
</code>
is as
follows:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Start with original
<code class="literal">
WHERE
</code>
clause:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa29192661"><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 punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'abc'</span> <span class="token operator">AND</span> <span class="token punctuation">(</span>key1 <span class="token operator">LIKE</span> <span class="token string">'abcde%'</span> <span class="token operator">OR</span> key1 <span class="token operator">LIKE</span> <span class="token string">'%b'</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">OR</span>
<span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'bar'</span> <span class="token operator">AND</span> nonkey <span class="token operator">=</span> <span class="token number">4</span><span class="token punctuation">)</span> <span class="token operator">OR</span>
<span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'uux'</span> <span class="token operator">AND</span> key1 <span class="token operator">></span> <span class="token string">'z'</span><span class="token punctuation">)</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Remove
<code class="literal">
nonkey = 4
</code>
and
<code class="literal">
key1
LIKE '%b'
</code>
because they cannot be used for a
range scan. The correct way to remove them is to replace
them with
<code class="literal">
TRUE
</code>
, so that we do not
miss any matching rows when doing the range scan.
Replacing them with
<code class="literal">
TRUE
</code>
yields:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa14577920"><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 punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'abc'</span> <span class="token operator">AND</span> <span class="token punctuation">(</span>key1 <span class="token operator">LIKE</span> <span class="token string">'abcde%'</span> <span class="token operator">OR</span> <span class="token boolean">TRUE</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">OR</span>
<span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'bar'</span> <span class="token operator">AND</span> <span class="token boolean">TRUE</span><span class="token punctuation">)</span> <span class="token operator">OR</span>
<span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'uux'</span> <span class="token operator">AND</span> key1 <span class="token operator">></span> <span class="token string">'z'</span><span class="token punctuation">)</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Collapse conditions that are always true or false:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
(key1 LIKE 'abcde%' OR TRUE)
</code>
is
always true
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
(key1 < 'uux' AND key1 >
'z')
</code>
is always false
</p>
</li>
</ul>
</div>
<p>
Replacing these conditions with constants yields:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-clike"><div class="docs-select-all right" id="sa87062046"><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-clike"><span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'abc'</span> AND TRUE<span class="token punctuation">)</span> OR <span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'bar'</span> AND TRUE<span class="token punctuation">)</span> OR <span class="token punctuation">(</span>FALSE<span class="token punctuation">)</span></code></pre>
</div>
<p>
Removing unnecessary
<code class="literal">
TRUE
</code>
and
<code class="literal">
FALSE
</code>
constants yields:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-clike"><div class="docs-select-all right" id="sa58441168"><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-clike"><span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'abc'</span><span class="token punctuation">)</span> OR <span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'bar'</span><span class="token punctuation">)</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Combining overlapping intervals into one yields the
final condition to be used for the range scan:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-clike"><div class="docs-select-all right" id="sa31110657"><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-clike"><span class="token punctuation">(</span>key1 <span class="token operator"><</span> <span class="token string">'bar'</span><span class="token punctuation">)</span></code></pre>
</div>
</li>
</ol>
</div>
<p>
In general (and as demonstrated by the preceding example),
the condition used for a range scan is less restrictive than
the
<code class="literal">
WHERE
</code>
clause. MySQL performs an
additional check to filter out rows that satisfy the range
condition but not the full
<code class="literal">
WHERE
</code>
clause.
</p>
<p>
The range condition extraction algorithm can handle nested
<a class="link" href="logical-operators.html#operator_and">
<code class="literal">
AND
</code>
</a>
/
<a class="link" href="logical-operators.html#operator_or">
<code class="literal">
OR
</code>
</a>
constructs of arbitrary depth, and its output does not
depend on the order in which conditions appear in
<code class="literal">
WHERE
</code>
clause.
</p>
<p>
MySQL does not support merging multiple ranges for the
<a class="link" href="explain-output.html#jointype_range">
<code class="literal">
range
</code>
</a>
access method for
spatial indexes. To work around this limitation, you can use
a
<a class="link" href="union.html" title="15.2.18 UNION Clause">
<code class="literal">
UNION
</code>
</a>
with identical
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
statements, except
that you put each spatial predicate in a different
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="range-access-multi-part">
</a>
Range Access Method for Multiple-Part Indexes
</h5>
</div>
</div>
</div>
<p>
Range conditions on a multiple-part index are an extension
of range conditions for a single-part index. A range
condition on a multiple-part index restricts index rows to
lie within one or several key tuple intervals. Key tuple
intervals are defined over a set of key tuples, using
ordering from the index.
</p>
<p>
For example, consider a multiple-part index defined as
<code class="literal">
key1(
<em class="replaceable">
<code>
key_part1
</code>
</em>
,
<em class="replaceable">
<code>
key_part2
</code>
</em>
,
<em class="replaceable">
<code>
key_part3
</code>
</em>
)
</code>
, and the
following set of key tuples listed in key order:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-clike"><div class="docs-select-all right" id="sa16897392"><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-clike"><em class="replaceable">key_part1</em> <em class="replaceable">key_part2</em> <em class="replaceable">key_part3</em>
NULL <span class="token number">1</span> <span class="token string">'abc'</span>
NULL <span class="token number">1</span> <span class="token string">'xyz'</span>
NULL <span class="token number">2</span> <span class="token string">'foo'</span>
<span class="token number">1</span> <span class="token number">1</span> <span class="token string">'abc'</span>
<span class="token number">1</span> <span class="token number">1</span> <span class="token string">'xyz'</span>
<span class="token number">1</span> <span class="token number">2</span> <span class="token string">'abc'</span>
<span class="token number">2</span> <span class="token number">1</span> <span class="token string">'aaa'</span></code></pre>
</div>
<p>
The condition
<code class="literal">
<em class="replaceable">
<code>
key_part1
</code>
</em>
= 1
</code>
defines this interval:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-clike"><div class="docs-select-all right" id="sa24629121"><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-clike"><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token operator">-</span>inf<span class="token punctuation">,</span><span class="token operator">-</span>inf<span class="token punctuation">)</span> <span class="token operator"><=</span> <span class="token punctuation">(</span><em class="replaceable">key_part1</em><span class="token punctuation">,</span><em class="replaceable">key_part2</em><span class="token punctuation">,</span><em class="replaceable">key_part3</em><span class="token punctuation">)</span> <span class="token operator"><</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token operator">+</span>inf<span class="token punctuation">,</span><span class="token operator">+</span>inf<span class="token punctuation">)</span></code></pre>
</div>
<p>
The interval covers the 4th, 5th, and 6th tuples in the
preceding data set and can be used by the range access
method.
</p>
<p>
By contrast, the condition
<code class="literal">
<em class="replaceable">
<code>
key_part3
</code>
</em>
=
'abc'
</code>
does not define a single interval and cannot
be used by the range access method.
</p>
<p>
The following descriptions indicate how range conditions
work for multiple-part indexes in greater detail.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
For
<code class="literal">
HASH
</code>
indexes, each interval
containing identical values can be used. This means that
the interval can be produced only for conditions in the
following form:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa62957069"><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"> <em class="replaceable">key_part1</em> <em class="replaceable">cmp</em> <em class="replaceable">const1</em>
<span class="token operator">AND</span> <em class="replaceable">key_part2</em> <em class="replaceable">cmp</em> <em class="replaceable">const2</em>
<span class="token operator">AND</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<span class="token operator">AND</span> <em class="replaceable">key_partN</em> <em class="replaceable">cmp</em> <em class="replaceable">constN</em><span class="token punctuation">;</span></code></pre>
</div>
<p>
Here,
<em class="replaceable">
<code>
const1
</code>
</em>
,
<em class="replaceable">
<code>
const2
</code>
</em>
, … are
constants,
<em class="replaceable">
<code>
cmp
</code>
</em>
is one of the
<a class="link" href="comparison-operators.html#operator_equal">
<code class="literal">
=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_equal-to">
<code class="literal">
<=>
</code>
</a>
,
or
<a class="link" href="comparison-operators.html#operator_is-null">
<code class="literal">
IS NULL
</code>
</a>
comparison
operators, and the conditions cover all index parts.
(That is, there are
<em class="replaceable">
<code>
N
</code>
</em>
conditions, one for each part of an
<em class="replaceable">
<code>
N
</code>
</em>
-part index.) For example,
the following is a range condition for a three-part
<code class="literal">
HASH
</code>
index:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa10582168"><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"><em class="replaceable">key_part1</em> <span class="token operator">=</span> <span class="token number">1</span> <span class="token operator">AND</span> <em class="replaceable">key_part2</em> <span class="token operator">IS</span> <span class="token boolean">NULL</span> <span class="token operator">AND</span> <em class="replaceable">key_part3</em> <span class="token operator">=</span> <span class="token string">'foo'</span></code></pre>
</div>
<p>
For the definition of what is considered to be a
constant, see
<a class="xref" href="range-optimization.html#range-access-single-part" title="Range Access Method for Single-Part Indexes">
Range Access Method for Single-Part Indexes
</a>
.
</p>
</li>
<li class="listitem">
<p>
For a
<code class="literal">
BTREE
</code>
index, an interval might
be usable for conditions combined with
<a class="link" href="logical-operators.html#operator_and">
<code class="literal">
AND
</code>
</a>
, where each condition
compares a key part with a constant value using
<a class="link" href="comparison-operators.html#operator_equal">
<code class="literal">
=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_equal-to">
<code class="literal">
<=>
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_is-null">
<code class="literal">
IS NULL
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_greater-than">
<code class="literal">
>
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_less-than">
<code class="literal">
<
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_greater-than-or-equal">
<code class="literal">
>=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_less-than-or-equal">
<code class="literal">
<=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_not-equal">
<code class="literal">
!=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_not-equal">
<code class="literal">
<>
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_between">
<code class="literal">
BETWEEN
</code>
</a>
, or
<a class="link" href="string-comparison-functions.html#operator_like">
<code class="literal">
LIKE
'
<em class="replaceable">
<code>
pattern
</code>
</em>
'
</code>
</a>
(where
<code class="literal">
'
<em class="replaceable">
<code>
pattern
</code>
</em>
'
</code>
does not start with a wildcard). An interval can be used
as long as it is possible to determine a single key
tuple containing all rows that match the condition (or
two intervals if
<a class="link" href="comparison-operators.html#operator_not-equal">
<code class="literal">
<>
</code>
</a>
or
<a class="link" href="comparison-operators.html#operator_not-equal">
<code class="literal">
!=
</code>
</a>
is used).
</p>
<p>
The optimizer attempts to use additional key parts to
determine the interval as long as the comparison
operator is
<a class="link" href="comparison-operators.html#operator_equal">
<code class="literal">
=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_equal-to">
<code class="literal">
<=>
</code>
</a>
,
or
<a class="link" href="comparison-operators.html#operator_is-null">
<code class="literal">
IS NULL
</code>
</a>
. If the operator
is
<a class="link" href="comparison-operators.html#operator_greater-than">
<code class="literal">
>
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_less-than">
<code class="literal">
<
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_greater-than-or-equal">
<code class="literal">
>=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_less-than-or-equal">
<code class="literal">
<=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_not-equal">
<code class="literal">
!=
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_not-equal">
<code class="literal">
<>
</code>
</a>
,
<a class="link" href="comparison-operators.html#operator_between">
<code class="literal">
BETWEEN
</code>
</a>
, or
<a class="link" href="string-comparison-functions.html#operator_like">
<code class="literal">
LIKE
</code>
</a>
, the
optimizer uses it but considers no more key parts. For
the following expression, the optimizer uses
<a class="link" href="comparison-operators.html#operator_equal">
<code class="literal">
=
</code>
</a>
from
the first comparison. It also uses
<a class="link" href="comparison-operators.html#operator_greater-than-or-equal">
<code class="literal">
>=
</code>
</a>
from the second comparison but considers no further key
parts and does not use the third comparison for interval
construction:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa91398184"><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"><em class="replaceable">key_part1</em> <span class="token operator">=</span> <span class="token string">'foo'</span> <span class="token operator">AND</span> <em class="replaceable">key_part2</em> <span class="token operator">>=</span> <span class="token number">10</span> <span class="token operator">AND</span> <em class="replaceable">key_part3</em> <span class="token operator">></span> <span class="token number">10</span></code></pre>
</div>
<p>
The single interval is:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa86354950"><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 punctuation">(</span><span class="token string">'foo'</span><span class="token punctuation">,</span><span class="token number">10</span><span class="token punctuation">,</span><span class="token operator">-</span>inf<span class="token punctuation">)</span> <span class="token operator"><</span> <span class="token punctuation">(</span><em class="replaceable">key_part1</em><span class="token punctuation">,</span><em class="replaceable">key_part2</em><span class="token punctuation">,</span><em class="replaceable">key_part3</em><span class="token punctuation">)</span> <span class="token operator"><</span> <span class="token punctuation">(</span><span class="token string">'foo'</span><span class="token punctuation">,</span><span class="token operator">+</span>inf<span class="token punctuation">,</span><span class="token operator">+</span>inf<span class="token punctuation">)</span></code></pre>
</div>
<p>
It is possible that the created interval contains more
rows than the initial condition. For example, the
preceding interval includes the value
<code class="literal">
('foo',
11, 0)
</code>
, which does not satisfy the original
condition.
</p>
</li>
<li class="listitem">
<p>
If conditions that cover sets of rows contained within
intervals are combined with
<a class="link" href="logical-operators.html#operator_or">
<code class="literal">
OR
</code>
</a>
, they form a condition
that covers a set of rows contained within the union of
their intervals. If the conditions are combined with
<a class="link" href="logical-operators.html#operator_and">
<code class="literal">
AND
</code>
</a>
, they form a condition
that covers a set of rows contained within the
intersection of their intervals. For example, for this
condition on a two-part index:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa78629113"><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 punctuation">(</span><em class="replaceable">key_part1</em> <span class="token operator">=</span> <span class="token number">1</span> <span class="token operator">AND</span> <em class="replaceable">key_part2</em> <span class="token operator"><</span> <span class="token number">2</span><span class="token punctuation">)</span> <span class="token operator">OR</span> <span class="token punctuation">(</span><em class="replaceable">key_part1</em> <span class="token operator">></span> <span class="token number">5</span><span class="token punctuation">)</span></code></pre>
</div>
<p>
The intervals are:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa65961418"><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 punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token operator">-</span>inf<span class="token punctuation">)</span> <span class="token operator"><</span> <span class="token punctuation">(</span><em class="replaceable">key_part1</em><span class="token punctuation">,</span><em class="replaceable">key_part2</em><span class="token punctuation">)</span> <span class="token operator"><</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span>
<span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">,</span><span class="token operator">-</span>inf<span class="token punctuation">)</span> <span class="token operator"><</span> <span class="token punctuation">(</span><em class="replaceable">key_part1</em><span class="token punctuation">,</span><em class="replaceable">key_part2</em><span class="token punctuation">)</span></code></pre>
</div>
<p>
In this example, the interval on the first line uses one
key part for the left bound and two key parts for the
right bound. The interval on the second line uses only
one key part. The
<code class="literal">
key_len
</code>
column in
the
<a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
<code class="literal">
EXPLAIN
</code>
</a>
output
indicates the maximum length of the key prefix used.
</p>
<p>
In some cases,
<code class="literal">
key_len
</code>
may indicate
that a key part was used, but that might be not what you
would expect. Suppose that
<em class="replaceable">
<code>
key_part1
</code>
</em>
and
<em class="replaceable">
<code>
key_part2
</code>
</em>
can be
<code class="literal">
NULL
</code>
. Then the
<code class="literal">
key_len
</code>
column displays two key part
lengths for the following condition:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa40809430"><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"><em class="replaceable">key_part1</em> <span class="token operator">>=</span> <span class="token number">1</span> <span class="token operator">AND</span> <em class="replaceable">key_part2</em> <span class="token operator"><</span> <span class="token number">2</span></code></pre>
</div>
<p>
But, in fact, the condition is converted to this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa73614341"><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"><em class="replaceable">key_part1</em> <span class="token operator">>=</span> <span class="token number">1</span> <span class="token operator">AND</span> <em class="replaceable">key_part2</em> <span class="token operator">IS</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span></code></pre>
</div>
</li>
</ul>
</div>
<p>
For a description of how optimizations are performed to
combine or eliminate intervals for range conditions on a
single-part index, see
<a class="xref" href="range-optimization.html#range-access-single-part" title="Range Access Method for Single-Part Indexes">
Range Access Method for Single-Part Indexes
</a>
. Analogous steps
are performed for range conditions on multiple-part indexes.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="equality-range-optimization">
</a>
Equality Range Optimization of Many-Valued Comparisons
</h5>
</div>
</div>
</div>
<p>
Consider these expressions, where
<em class="replaceable">
<code>
col_name
</code>
</em>
is an indexed column:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa21407270"><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"><em class="replaceable">col_name</em> <span class="token keyword">IN</span><span class="token punctuation">(</span><em class="replaceable">val1</em><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> <em class="replaceable">valN</em><span class="token punctuation">)</span>
<em class="replaceable">col_name</em> <span class="token operator">=</span> <em class="replaceable">val1</em> <span class="token operator">OR</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token operator">OR</span> <em class="replaceable">col_name</em> <span class="token operator">=</span> <em class="replaceable">valN</em></code></pre>
</div>
<p>
Each expression is true if
<em class="replaceable">
<code>
col_name
</code>
</em>
is equal to any of
several values. These comparisons are equality range
comparisons (where the
<span class="quote">
“
<span class="quote">
range
</span>
”
</span>
is a single
value). The optimizer estimates the cost of reading
qualifying rows for equality range comparisons as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
If there is a unique index on
<em class="replaceable">
<code>
col_name
</code>
</em>
, the row estimate
for each range is 1 because at most one row can have the
given value.
</p>
</li>
<li class="listitem">
<p>
Otherwise, any index on
<em class="replaceable">
<code>
col_name
</code>
</em>
is nonunique and the
optimizer can estimate the row count for each range
using dives into the index or index statistics.
</p>
</li>
</ul>
</div>
<a class="indexterm" name="idm46045230043600">
</a>
<p>
With index dives, the optimizer makes a dive at each end of
a range and uses the number of rows in the range as the
estimate. For example, the expression
<code class="literal">
<em class="replaceable">
<code>
col_name
</code>
</em>
IN (10, 20,
30)
</code>
has three equality ranges and the optimizer
makes two dives per range to generate a row estimate. Each
pair of dives yields an estimate of the number of rows that
have the given value.
</p>
<p>
Index dives provide accurate row estimates, but as the
number of comparison values in the expression increases, the
optimizer takes longer to generate a row estimate. Use of
index statistics is less accurate than index dives but
permits faster row estimation for large value lists.
</p>
<p>
The
<a class="link" href="server-system-variables.html#sysvar_eq_range_index_dive_limit">
<code class="literal">
eq_range_index_dive_limit
</code>
</a>
system variable enables you to configure the number of
values at which the optimizer switches from one row
estimation strategy to the other. To permit use of index
dives for comparisons of up to
<em class="replaceable">
<code>
N
</code>
</em>
equality ranges, set
<a class="link" href="server-system-variables.html#sysvar_eq_range_index_dive_limit">
<code class="literal">
eq_range_index_dive_limit
</code>
</a>
to
<em class="replaceable">
<code>
N
</code>
</em>
+ 1. To disable use of
statistics and always use index dives regardless of
<em class="replaceable">
<code>
N
</code>
</em>
, set
<a class="link" href="server-system-variables.html#sysvar_eq_range_index_dive_limit">
<code class="literal">
eq_range_index_dive_limit
</code>
</a>
to 0.
</p>
<p>
To update table index statistics for best estimates, use
<a class="link" href="analyze-table.html" title="15.7.3.1 ANALYZE TABLE Statement">
<code class="literal">
ANALYZE TABLE
</code>
</a>
.
</p>
<p>
Prior to MySQL 8.4, there is no way of skipping
the use of index dives to estimate index usefulness, except
by using the
<a class="link" href="server-system-variables.html#sysvar_eq_range_index_dive_limit">
<code class="literal">
eq_range_index_dive_limit
</code>
</a>
system variable. In MySQL 8.4, index dive
skipping is possible for queries that satisfy all these
conditions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The query is for a single table, not a join on multiple
tables.
</p>
</li>
<li class="listitem">
<p>
A single-index
<code class="literal">
FORCE INDEX
</code>
index hint
is present. The idea is that if index use is forced,
there is nothing to be gained from the additional
overhead of performing dives into the index.
</p>
</li>
<li class="listitem">
<p>
The index is nonunique and not a
<code class="literal">
FULLTEXT
</code>
index.
</p>
</li>
<li class="listitem">
<p>
No subquery is present.
</p>
</li>
<li class="listitem">
<p>
No
<code class="literal">
DISTINCT
</code>
,
<code class="literal">
GROUP
BY
</code>
, or
<code class="literal">
ORDER BY
</code>
clause is
present.
</p>
</li>
</ul>
</div>
<p>
For
<a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
<code class="literal">
EXPLAIN FOR
CONNECTION
</code>
</a>
, the output changes as follows if index
dives are skipped:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
For traditional output, the
<code class="literal">
rows
</code>
and
<code class="literal">
filtered
</code>
values are
<code class="literal">
NULL
</code>
.
</p>
</li>
<li class="listitem">
<p>
For JSON output,
<code class="literal">
rows_examined_per_scan
</code>
and
<code class="literal">
rows_produced_per_join
</code>
do not appear,
<code class="literal">
skip_index_dive_due_to_force
</code>
is
<code class="literal">
true
</code>
, and cost calculations are not
accurate.
</p>
</li>
</ul>
</div>
<p>
Without
<code class="literal">
FOR CONNECTION
</code>
,
<a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
<code class="literal">
EXPLAIN
</code>
</a>
output does not
change when index dives are skipped.
</p>
<p>
After execution of a query for which index dives are
skipped, the corresponding row in the Information Schema
<a class="link" href="information-schema-optimizer-trace-table.html" title="28.3.19 The INFORMATION_SCHEMA OPTIMIZER_TRACE Table">
<code class="literal">
OPTIMIZER_TRACE
</code>
</a>
table contains
an
<code class="literal">
index_dives_for_range_access
</code>
value of
<code class="literal">
skipped_due_to_force_index
</code>
.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="range-access-skip-scan">
</a>
Skip Scan Range Access Method
</h5>
</div>
</div>
</div>
<p>
Consider the following scenario:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa44510508"><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">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>f1 <span class="token datatype">INT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span> f2 <span class="token datatype">INT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span> <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span><span class="token punctuation">(</span>f1<span class="token punctuation">,</span> f2<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t1 <span class="token keyword">VALUES</span>
<span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
<span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t1 <span class="token keyword">SELECT</span> f1<span class="token punctuation">,</span> f2 <span class="token operator">+</span> <span class="token number">5</span> <span class="token keyword">FROM</span> t1<span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t1 <span class="token keyword">SELECT</span> f1<span class="token punctuation">,</span> f2 <span class="token operator">+</span> <span class="token number">10</span> <span class="token keyword">FROM</span> t1<span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t1 <span class="token keyword">SELECT</span> f1<span class="token punctuation">,</span> f2 <span class="token operator">+</span> <span class="token number">20</span> <span class="token keyword">FROM</span> t1<span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t1 <span class="token keyword">SELECT</span> f1<span class="token punctuation">,</span> f2 <span class="token operator">+</span> <span class="token number">40</span> <span class="token keyword">FROM</span> t1<span class="token punctuation">;</span>
<span class="token keyword">ANALYZE</span> <span class="token keyword">TABLE</span> t1<span class="token punctuation">;</span>
<span class="token keyword">EXPLAIN</span> <span class="token keyword">SELECT</span> f1<span class="token punctuation">,</span> f2 <span class="token keyword">FROM</span> t1 <span class="token keyword">WHERE</span> f2 <span class="token operator">></span> <span class="token number">40</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
To execute this query, MySQL can choose an index scan to
fetch all rows (the index includes all columns to be
selected), then apply the
<code class="literal">
f2 > 40
</code>
condition from the
<code class="literal">
WHERE
</code>
clause to
produce the final result set.
</p>
<p>
A range scan is more efficient than a full index scan, but
cannot be used in this case because there is no condition on
<code class="literal">
f1
</code>
, the first index column. The optimizer
can perform multiple range scans, one for each value of
<code class="literal">
f1
</code>
, using a method called Skip Scan that
is similar to Loose Index Scan (see
<a class="xref" href="group-by-optimization.html" title="10.2.1.17 GROUP BY Optimization">
Section 10.2.1.17, “GROUP BY Optimization”
</a>
):
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Skip between distinct values of the first index part,
<code class="literal">
f1
</code>
(the index prefix).
</p>
</li>
<li class="listitem">
<p>
Perform a subrange scan on each distinct prefix value
for the
<code class="literal">
f2 > 40
</code>
condition on the
remaining index part.
</p>
</li>
</ol>
</div>
<p>
For the data set shown earlier, the algorithm operates like
this:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Get the first distinct value of the first key part
(
<code class="literal">
f1 = 1
</code>
).
</p>
</li>
<li class="listitem">
<p>
Construct the range based on the first and second key
parts (
<code class="literal">
f1 = 1 AND f2 > 40
</code>
).
</p>
</li>
<li class="listitem">
<p>
Perform a range scan.
</p>
</li>
<li class="listitem">
<p>
Get the next distinct value of the first key part
(
<code class="literal">
f1 = 2
</code>
).
</p>
</li>
<li class="listitem">
<p>
Construct the range based on the first and second key
parts (
<code class="literal">
f1 = 2 AND f2 > 40
</code>
).
</p>
</li>
<li class="listitem">
<p>
Perform a range scan.
</p>
</li>
</ol>
</div>
<p>
Using this strategy decreases the number of accessed rows
because MySQL skips the rows that do not qualify for each
constructed range. This Skip Scan access method is
applicable under the following conditions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Table T has at least one compound index with key parts
of the form ([A_1, ..., A_
<em class="replaceable">
<code>
k
</code>
</em>
,]
B_1, ..., B_
<em class="replaceable">
<code>
m
</code>
</em>
, C [, D_1, ...,
D_
<em class="replaceable">
<code>
n
</code>
</em>
]). Key parts A and D may
be empty, but B and C must be nonempty.
</p>
</li>
<li class="listitem">
<p>
The query references only one table.
</p>
</li>
<li class="listitem">
<p>
The query does not use
<code class="literal">
GROUP BY
</code>
or
<code class="literal">
DISTINCT
</code>
.
</p>
</li>
<li class="listitem">
<p>
The query references only columns in the index.
</p>
</li>
<li class="listitem">
<p>
The predicates on A_1, ...,
A_
<em class="replaceable">
<code>
k
</code>
</em>
must be equality
predicates and they must be constants. This includes the
<a class="link" href="comparison-operators.html#operator_in">
<code class="literal">
IN()
</code>
</a>
operator.
</p>
</li>
<li class="listitem">
<p>
The query must be a conjunctive query; that is, an
<code class="literal">
AND
</code>
of
<code class="literal">
OR
</code>
conditions:
<code class="literal">
(
<em class="replaceable">
<code>
cond1
</code>
</em>
(
<em class="replaceable">
<code>
key_part1
</code>
</em>
)
OR
<em class="replaceable">
<code>
cond2
</code>
</em>
(
<em class="replaceable">
<code>
key_part1
</code>
</em>
))
AND
(
<em class="replaceable">
<code>
cond1
</code>
</em>
(
<em class="replaceable">
<code>
key_part2
</code>
</em>
)
OR ...) AND ...
</code>
</p>
</li>
<li class="listitem">
<p>
There must be a range condition on C.
</p>
</li>
<li class="listitem">
<p>
Conditions on D columns are permitted. Conditions on D
must be in conjunction with the range condition on C.
</p>
</li>
</ul>
</div>
<p>
Use of Skip Scan is indicated in
<code class="literal">
EXPLAIN
</code>
output as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
Using index for skip scan
</code>
in the
<code class="literal">
Extra
</code>
column indicates that the loose
index Skip Scan access method is used.
</p>
</li>
<li class="listitem">
<p>
If the index can be used for Skip Scan, the index should
be visible in the
<code class="literal">
possible_keys
</code>
column.
</p>
</li>
</ul>
</div>
<p>
Use of Skip Scan is indicated in optimizer trace output by a
<code class="literal">
"skip scan"
</code>
element of this form:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-json"><div class="docs-select-all right" id="sa69029272"><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-json"><span class="token property">"skip_scan_range"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
<span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"skip_scan"</span><span class="token punctuation">,</span>
<span class="token property">"index"</span><span class="token operator">:</span> <em class="replaceable">index_used_for_skip_scan</em><span class="token punctuation">,</span>
<span class="token property">"key_parts_used_for_access"</span><span class="token operator">:</span> <span class="token punctuation">[</span><em class="replaceable">key_parts_used_for_access</em><span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token property">"range"</span><span class="token operator">:</span> <span class="token punctuation">[</span><em class="replaceable">range</em><span class="token punctuation">]</span>
<span class="token punctuation">}</span></code></pre>
</div>
<p>
You may also see a
<code class="literal">
"best_skip_scan_summary"
</code>
element. If Skip
Scan is chosen as the best range access variant, a
<code class="literal">
"chosen_range_access_summary"
</code>
is written.
If Skip Scan is chosen as the overall best access method, a
<code class="literal">
"best_access_path"
</code>
element is present.
</p>
<p>
Use of Skip Scan is subject to the value of the
<a class="link" href="switchable-optimizations.html#optflag_skip-scan">
<code class="literal">
skip_scan
</code>
</a>
flag of the
<a class="link" href="server-system-variables.html#sysvar_optimizer_switch">
<code class="literal">
optimizer_switch
</code>
</a>
system
variable. See
<a class="xref" href="switchable-optimizations.html" title="10.9.2 Switchable Optimizations">
Section 10.9.2, “Switchable Optimizations”
</a>
. By
default, this flag is
<code class="literal">
on
</code>
. To disable it,
set
<a class="link" href="switchable-optimizations.html#optflag_skip-scan">
<code class="literal">
skip_scan
</code>
</a>
to
<code class="literal">
off
</code>
.
</p>
<p>
In addition to using the
<a class="link" href="server-system-variables.html#sysvar_optimizer_switch">
<code class="literal">
optimizer_switch
</code>
</a>
system
variable to control optimizer use of Skip Scan session-wide,
MySQL supports optimizer hints to influence the optimizer on
a per-statement basis. See
<a class="xref" href="optimizer-hints.html" title="10.9.3 Optimizer Hints">
Section 10.9.3, “Optimizer Hints”
</a>
.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="row-constructor-range-optimization">
</a>
Range Optimization of Row Constructor Expressions
</h5>
</div>
</div>
</div>
<p>
The optimizer is able to apply the range scan access method
to queries of this form:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa82555772"><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">SELECT</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">WHERE</span> <span class="token punctuation">(</span> col_1<span class="token punctuation">,</span> col_2 <span class="token punctuation">)</span> <span class="token keyword">IN</span> <span class="token punctuation">(</span><span class="token punctuation">(</span> <span class="token string">'a'</span><span class="token punctuation">,</span> <span class="token string">'b'</span> <span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span> <span class="token string">'c'</span><span class="token punctuation">,</span> <span class="token string">'d'</span> <span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Previously, for range scans to be used, it was necessary to
write the query as:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa11619344"><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">SELECT</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token keyword">FROM</span> t1 <span class="token keyword">WHERE</span> <span class="token punctuation">(</span> col_1 <span class="token operator">=</span> <span class="token string">'a'</span> <span class="token operator">AND</span> col_2 <span class="token operator">=</span> <span class="token string">'b'</span> <span class="token punctuation">)</span>
<span class="token operator">OR</span> <span class="token punctuation">(</span> col_1 <span class="token operator">=</span> <span class="token string">'c'</span> <span class="token operator">AND</span> col_2 <span class="token operator">=</span> <span class="token string">'d'</span> <span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
For the optimizer to use a range scan, queries must satisfy
these conditions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Only
<a class="link" href="comparison-operators.html#operator_in">
<code class="literal">
IN()
</code>
</a>
predicates are
used, not
<a class="link" href="comparison-operators.html#operator_not-in">
<code class="literal">
NOT IN()
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
On the left side of the
<a class="link" href="comparison-operators.html#operator_in">
<code class="literal">
IN()
</code>
</a>
predicate, the row
constructor contains only column references.
</p>
</li>
<li class="listitem">
<p>
On the right side of the
<a class="link" href="comparison-operators.html#operator_in">
<code class="literal">
IN()
</code>
</a>
predicate, row
constructors contain only runtime constants, which are
either literals or local column references that are
bound to constants during execution.
</p>
</li>
<li class="listitem">
<p>
On the right side of the
<a class="link" href="comparison-operators.html#operator_in">
<code class="literal">
IN()
</code>
</a>
predicate, there is
more than one row constructor.
</p>
</li>
</ul>
</div>
<p>
For more information about the optimizer and row
constructors, see
<a class="xref" href="row-constructor-optimization.html" title="10.2.1.22 Row Constructor Expression Optimization">
Section 10.2.1.22, “Row Constructor Expression Optimization”
</a>
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="range-optimization-memory-use">
</a>
Limiting Memory Use for Range Optimization
</h5>
</div>
</div>
</div>
<p>
To control the memory available to the range optimizer, use
the
<a class="link" href="server-system-variables.html#sysvar_range_optimizer_max_mem_size">
<code class="literal">
range_optimizer_max_mem_size
</code>
</a>
system variable:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
A value of 0 means
<span class="quote">
“
<span class="quote">
no limit.
</span>
”
</span>
</p>
</li>
<li class="listitem">
<p>
With a value greater than 0, the optimizer tracks the
memory consumed when considering the range access
method. If the specified limit is about to be exceeded,
the range access method is abandoned and other methods,
including a full table scan, are considered instead.
This could be less optimal. If this happens, the
following warning occurs (where
<em class="replaceable">
<code>
N
</code>
</em>
is the current
<a class="link" href="server-system-variables.html#sysvar_range_optimizer_max_mem_size">
<code class="literal">
range_optimizer_max_mem_size
</code>
</a>
value):
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-none"><div class="docs-select-all right" id="sa93875803"><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-none">Warning 3170 Memory capacity of <em class="replaceable">N</em> bytes for
'range_optimizer_max_mem_size' exceeded. Range
optimization was not done for this query.</code></pre>
</div>
</li>
<li class="listitem">
<p>
For
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
and
<a class="link" href="delete.html" title="15.2.2 DELETE Statement">
<code class="literal">
DELETE
</code>
</a>
statements, if the
optimizer falls back to a full table scan and the
<a class="link" href="server-system-variables.html#sysvar_sql_safe_updates">
<code class="literal">
sql_safe_updates
</code>
</a>
system
variable is enabled, an error occurs rather than a
warning because, in effect, no key is used to determine
which rows to modify. For more information, see
<a class="xref" href="mysql-tips.html#safe-updates" title="Using Safe-Updates Mode (--safe-updates)">
Using Safe-Updates Mode (--safe-updates)
</a>
.
</p>
</li>
</ul>
</div>
<p>
For individual queries that exceed the available range
optimization memory and for which the optimizer falls back
to less optimal plans, increasing the
<a class="link" href="server-system-variables.html#sysvar_range_optimizer_max_mem_size">
<code class="literal">
range_optimizer_max_mem_size
</code>
</a>
value may improve performance.
</p>
<p>
To estimate the amount of memory needed to process a range
expression, use these guidelines:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
For a simple query such as the following, where there is
one candidate key for the range access method, each
predicate combined with
<a class="link" href="logical-operators.html#operator_or">
<code class="literal">
OR
</code>
</a>
uses approximately 230 bytes:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa89476646"><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">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> t
<span class="token keyword">WHERE</span> a<span class="token operator">=</span><span class="token number">1</span> <span class="token operator">OR</span> a<span class="token operator">=</span><span class="token number">2</span> <span class="token operator">OR</span> a<span class="token operator">=</span><span class="token number">3</span> <span class="token operator">OR</span> <span class="token punctuation">.</span><span class="token punctuation">.</span> <span class="token punctuation">.</span> a<span class="token operator">=</span><em class="replaceable">N</em><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Similarly for a query such as the following, each
predicate combined with
<a class="link" href="logical-operators.html#operator_and">
<code class="literal">
AND
</code>
</a>
uses approximately 125 bytes:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa40961308"><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">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> t
<span class="token keyword">WHERE</span> a<span class="token operator">=</span><span class="token number">1</span> <span class="token operator">AND</span> b<span class="token operator">=</span><span class="token number">1</span> <span class="token operator">AND</span> c<span class="token operator">=</span><span class="token number">1</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span> <em class="replaceable">N</em><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
For a query with
<a class="link" href="comparison-operators.html#operator_in">
<code class="literal">
IN()
</code>
</a>
predicates:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa64948275"><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">SELECT</span> <span class="token function">COUNT</span><span class="token punctuation">(</span><span class="token operator">*</span><span class="token punctuation">)</span> <span class="token keyword">FROM</span> t
<span class="token keyword">WHERE</span> a <span class="token keyword">IN</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</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> <em class="replaceable">M</em><span class="token punctuation">)</span> <span class="token operator">AND</span> b <span class="token keyword">IN</span> <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</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> <em class="replaceable">N</em><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Each literal value in an
<a class="link" href="comparison-operators.html#operator_in">
<code class="literal">
IN()
</code>
</a>
list counts as a
predicate combined with
<a class="link" href="logical-operators.html#operator_or">
<code class="literal">
OR
</code>
</a>
.
If there are two
<a class="link" href="comparison-operators.html#operator_in">
<code class="literal">
IN()
</code>
</a>
lists, the number of predicates combined with
<a class="link" href="logical-operators.html#operator_or">
<code class="literal">
OR
</code>
</a>
is the product of the
number of literal values in each list. Thus, the number
of predicates combined with
<a class="link" href="logical-operators.html#operator_or">
<code class="literal">
OR
</code>
</a>
in the preceding case is
<em class="replaceable">
<code>
M
</code>
</em>
×
<em class="replaceable">
<code>
N
</code>
</em>
.
</p>
</li>
</ul>
</div>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/thread-pool-installation.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="thread-pool-installation">
</a>
7.6.3.2 Thread Pool Installation
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045256833600">
</a>
<a class="indexterm" name="idm46045256832096">
</a>
<p>
This section describes how to install MySQL Enterprise Thread Pool. For general
information about installing plugins, see
<a class="xref" href="plugin-loading.html" title="7.6.1 Installing and Uninstalling Plugins">
Section 7.6.1, “Installing and Uninstalling Plugins”
</a>
.
</p>
<p>
To be usable by the server, the plugin library file must be
located in the MySQL plugin directory (the directory named by
the
<a class="link" href="server-system-variables.html#sysvar_plugin_dir">
<code class="literal">
plugin_dir
</code>
</a>
system
variable). If necessary, configure the plugin directory location
by setting the value of
<a class="link" href="server-system-variables.html#sysvar_plugin_dir">
<code class="literal">
plugin_dir
</code>
</a>
at server startup.
</p>
<p>
The plugin library file base name is
<code class="literal">
thread_pool
</code>
. The file name suffix differs per
platform (for example,
<code class="filename">
.so
</code>
for Unix and
Unix-like systems,
<code class="filename">
.dll
</code>
for Windows).
</p>
<p>
The thread pool monitoring tables are Performance Schema tables
that are loaded and unloaded along with the thread pool plugin.
</p>
<p>
To enable thread pool capability, load the plugin by starting
the server with the
<a class="link" href="server-options.html#option_mysqld_plugin-load-add">
<code class="option">
--plugin-load-add
</code>
</a>
option. To do
this, put these lines in the server
<code class="filename">
my.cnf
</code>
file, adjusting the
<code class="filename">
.so
</code>
suffix for your
platform as necessary:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-ini"><div class="docs-select-all right" id="sa78820030"><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">plugin-load-add</span><span class="token attr-value"><span class="token punctuation">=</span>thread_pool.so</span></code></pre>
</div>
<p>
To verify plugin installation, examine the Information Schema
<a class="link" href="information-schema-plugins-table.html" title="28.3.22 The INFORMATION_SCHEMA PLUGINS Table">
<code class="literal">
PLUGINS
</code>
</a>
table or use the
<a class="link" href="show-plugins.html" title="15.7.7.27 SHOW PLUGINS Statement">
<code class="literal">
SHOW PLUGINS
</code>
</a>
statement (see
<a class="xref" href="obtaining-plugin-information.html" title="7.6.2 Obtaining Server Plugin Information">
Section 7.6.2, “Obtaining Server Plugin Information”
</a>
). For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa28054570"><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></span> <span class="token keyword">SELECT</span> PLUGIN_NAME<span class="token punctuation">,</span> PLUGIN_STATUS
<span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span><span class="token keyword">PLUGINS</span>
<span class="token keyword">WHERE</span> PLUGIN_NAME <span class="token operator">LIKE</span> <span class="token string">'thread%'</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>
<span class="token output"><span class="token punctuation">|</span> PLUGIN_NAME <span class="token punctuation">|</span> PLUGIN_STATUS <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>
<span class="token output"><span class="token punctuation">|</span> thread_pool <span class="token punctuation">|</span> ACTIVE <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></code></pre>
</div>
<p>
To verify that the Performance Schema monitoring tables are
available, examine the Information Schema
<a class="link" href="information-schema-tables-table.html" title="28.3.38 The INFORMATION_SCHEMA TABLES Table">
<code class="literal">
TABLES
</code>
</a>
table or use the
<a class="link" href="show-tables.html" title="15.7.7.39 SHOW TABLES Statement">
<code class="literal">
SHOW TABLES
</code>
</a>
statement. For
example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa71986213"><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></span> <span class="token keyword">SELECT</span> <span class="token keyword">TABLE_NAME</span>
<span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span><span class="token keyword">TABLES</span>
<span class="token keyword">WHERE</span> TABLE_SCHEMA <span class="token operator">=</span> <span class="token string">'performance_schema'</span>
<span class="token operator">AND</span> <span class="token keyword">TABLE_NAME</span> <span class="token operator">LIKE</span> <span class="token string">'tp%'</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>
<span class="token output"><span class="token punctuation">|</span> TABLE_NAME <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>
<span class="token output"><span class="token punctuation">|</span> tp_thread_group_state <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> tp_thread_group_stats <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> tp_thread_state <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></code></pre>
</div>
<p>
If the server loads the thread pool plugin successfully, it sets
the
<code class="literal">
thread_handling
</code>
system variable to
<code class="literal">
loaded-dynamically
</code>
.
</p>
<p>
If the plugin fails to initialize, check the server error log
for diagnostic messages.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/limit-optimization.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="limit-optimization">
</a>
10.2.1.19 LIMIT Query Optimization
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045228666976">
</a>
<a class="indexterm" name="idm46045228665520">
</a>
<p>
If you need only a specified number of rows from a result set,
use a
<code class="literal">
LIMIT
</code>
clause in the query, rather
than fetching the whole result set and throwing away the extra
data.
</p>
<p>
MySQL sometimes optimizes a query that has a
<code class="literal">
LIMIT
<em class="replaceable">
<code>
row_count
</code>
</em>
</code>
clause and no
<code class="literal">
HAVING
</code>
clause:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
If you select only a few rows with
<code class="literal">
LIMIT
</code>
, MySQL uses indexes in some cases
when normally it would prefer to do a full table scan.
</p>
</li>
<li class="listitem">
<p>
If you combine
<code class="literal">
LIMIT
<em class="replaceable">
<code>
row_count
</code>
</em>
</code>
with
<code class="literal">
ORDER BY
</code>
, MySQL stops sorting as soon
as it has found the first
<em class="replaceable">
<code>
row_count
</code>
</em>
rows of the sorted
result, rather than sorting the entire result. If ordering
is done by using an index, this is very fast. If a
filesort must be done, all rows that match the query
without the
<code class="literal">
LIMIT
</code>
clause are selected,
and most or all of them are sorted, before the first
<em class="replaceable">
<code>
row_count
</code>
</em>
are found. After the
initial rows have been found, MySQL does not sort any
remainder of the result set.
</p>
<p>
One manifestation of this behavior is that an
<code class="literal">
ORDER BY
</code>
query with and without
<code class="literal">
LIMIT
</code>
may return rows in different
order, as described later in this section.
</p>
</li>
<li class="listitem">
<p>
If you combine
<code class="literal">
LIMIT
<em class="replaceable">
<code>
row_count
</code>
</em>
</code>
with
<code class="literal">
DISTINCT
</code>
, MySQL stops as soon as it
finds
<em class="replaceable">
<code>
row_count
</code>
</em>
unique rows.
</p>
</li>
<li class="listitem">
<p>
In some cases, a
<code class="literal">
GROUP BY
</code>
can be
resolved by reading the index in order (or doing a sort on
the index), then calculating summaries until the index
value changes. In this case,
<code class="literal">
LIMIT
<em class="replaceable">
<code>
row_count
</code>
</em>
</code>
does not
calculate any unnecessary
<code class="literal">
GROUP BY
</code>
values.
</p>
</li>
<li class="listitem">
<p>
As soon as MySQL has sent the required number of rows to
the client, it aborts the query unless you are using
<code class="literal">
SQL_CALC_FOUND_ROWS
</code>
. In that case, the
number of rows can be retrieved with
<code class="literal">
SELECT
FOUND_ROWS()
</code>
. See
<a class="xref" href="information-functions.html" title="14.15 Information Functions">
Section 14.15, “Information Functions”
</a>
.
</p>
<a class="indexterm" name="idm46045228642368">
</a>
</li>
<li class="listitem">
<p>
<code class="literal">
LIMIT 0
</code>
quickly returns an empty set.
This can be useful for checking the validity of a query.
It can also be employed to obtain the types of the result
columns within applications that use a MySQL API that
makes result set metadata available. With the
<a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
<span class="command">
<strong>
mysql
</strong>
</span>
</a>
client program, you can use the
<a class="link" href="mysql-command-options.html#option_mysql_column-type-info">
<code class="option">
--column-type-info
</code>
</a>
option to
display result column types.
</p>
</li>
<li class="listitem">
<p>
If the server uses temporary tables to resolve a query, it
uses the
<code class="literal">
LIMIT
<em class="replaceable">
<code>
row_count
</code>
</em>
</code>
clause to
calculate how much space is required.
</p>
</li>
<li class="listitem">
<p>
If an index is not used for
<code class="literal">
ORDER BY
</code>
but a
<code class="literal">
LIMIT
</code>
clause is also present, the
optimizer may be able to avoid using a merge file and sort
the rows in memory using an in-memory
<code class="literal">
filesort
</code>
operation.
</p>
</li>
</ul>
</div>
<p>
If multiple rows have identical values in the
<code class="literal">
ORDER
BY
</code>
columns, the server is free to return those rows
in any order, and may do so differently depending on the
overall execution plan. In other words, the sort order of
those rows is nondeterministic with respect to the nonordered
columns.
</p>
<p>
One factor that affects the execution plan is
<code class="literal">
LIMIT
</code>
, so an
<code class="literal">
ORDER BY
</code>
query with and without
<code class="literal">
LIMIT
</code>
may return
rows in different orders. Consider this query, which is sorted
by the
<code class="literal">
category
</code>
column but nondeterministic
with respect to the
<code class="literal">
id
</code>
and
<code class="literal">
rating
</code>
columns:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa67527918"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> ratings <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> category<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>
<span class="token output"><span class="token punctuation">|</span> id <span class="token punctuation">|</span> category <span class="token punctuation">|</span> rating <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>
<span class="token output"><span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 4.5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 5 <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 3.2 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.7 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 4 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 6 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> 5.0 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 7 <span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> 2.7 <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></code></pre>
</div>
<p>
Including
<code class="literal">
LIMIT
</code>
may affect order of rows
within each
<code class="literal">
category
</code>
value. For example,
this is a valid query result:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa77510867"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> ratings <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> category <span class="token keyword">LIMIT</span> <span class="token number">5</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>
<span class="token output"><span class="token punctuation">|</span> id <span class="token punctuation">|</span> category <span class="token punctuation">|</span> rating <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>
<span class="token output"><span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 4.5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 5 <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 3.2 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 4 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.7 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 6 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.5 <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></code></pre>
</div>
<p>
In each case, the rows are sorted by the
<code class="literal">
ORDER
BY
</code>
column, which is all that is required by the SQL
standard.
</p>
<p>
If it is important to ensure the same row order with and
without
<code class="literal">
LIMIT
</code>
, include additional columns
in the
<code class="literal">
ORDER BY
</code>
clause to make the order
deterministic. For example, if
<code class="literal">
id
</code>
values
are unique, you can make rows for a given
<code class="literal">
category
</code>
value appear in
<code class="literal">
id
</code>
order by sorting like this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa1343208"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> ratings <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> category<span class="token punctuation">,</span> id<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>
<span class="token output"><span class="token punctuation">|</span> id <span class="token punctuation">|</span> category <span class="token punctuation">|</span> rating <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>
<span class="token output"><span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 4.5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 5 <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 3.2 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.7 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 4 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 6 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> 5.0 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 7 <span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> 2.7 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> ratings <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> category<span class="token punctuation">,</span> id <span class="token keyword">LIMIT</span> <span class="token number">5</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>
<span class="token output"><span class="token punctuation">|</span> id <span class="token punctuation">|</span> category <span class="token punctuation">|</span> rating <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>
<span class="token output"><span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 4.5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 5 <span class="token punctuation">|</span> 1 <span class="token punctuation">|</span> 3.2 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 3 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.7 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 4 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 6 <span class="token punctuation">|</span> 2 <span class="token punctuation">|</span> 3.5 <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></code></pre>
</div>
<p>
For a query with an
<code class="literal">
ORDER BY
</code>
or
<code class="literal">
GROUP BY
</code>
and a
<code class="literal">
LIMIT
</code>
clause, the optimizer tries to choose an ordered index by
default when it appears doing so would speed up query
execution. In cases where using some other optimization might
be faster, it is possible to turn off this optimization by
setting the
<a class="link" href="server-system-variables.html#sysvar_optimizer_switch">
<code class="literal">
optimizer_switch
</code>
</a>
system variable's
<a class="link" href="switchable-optimizations.html#optflag_prefer-ordering-index">
<code class="literal">
prefer_ordering_index
</code>
</a>
flag
to
<code class="literal">
off
</code>
.
</p>
<p>
<span class="emphasis">
<em>
Example
</em>
</span>
: First we create and populate a
table
<code class="literal">
t
</code>
as shown here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa78822435"><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 comment" spellcheck="true"># Create and populate a table t:</span>
<span class="token prompt">mysql></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t <span class="token punctuation">(</span>
<span class="token prompt"> -></span> id1 <span class="token datatype">BIGINT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> id2 <span class="token datatype">BIGINT</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> c1 <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">50</span><span class="token punctuation">)</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> c2 <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">50</span><span class="token punctuation">)</span> <span class="token operator">NOT</span> <span class="token boolean">NULL</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token keyword">PRIMARY</span> <span class="token keyword">KEY</span> <span class="token punctuation">(</span>id1<span class="token punctuation">)</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token keyword">INDEX</span> i <span class="token punctuation">(</span>id2<span class="token punctuation">,</span> c1<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment" spellcheck="true"># [Insert some rows into table t - not shown]</span></code></pre>
</div>
<p>
Verify that the
<a class="link" href="switchable-optimizations.html#optflag_prefer-ordering-index">
<code class="literal">
prefer_ordering_index
</code>
</a>
flag
is enabled:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa8189641"><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></span> <span class="token keyword">SELECT</span> <span class="token variable">@@optimizer_switch</span> <span class="token operator">LIKE</span> <span class="token string">'%prefer_ordering_index=on%'</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>
<span class="token output"><span class="token punctuation">|</span> @@optimizer_switch LIKE '%prefer_ordering_index=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>
<span class="token output"><span class="token punctuation">|</span> 1 <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></code></pre>
</div>
<p>
Since the following query has a
<code class="literal">
LIMIT
</code>
clause, we expect it to use an ordered index, if possible. In
this case, as we can see from the
<a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
<code class="literal">
EXPLAIN
</code>
</a>
output, it uses the
table's primary key.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa81787230"><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></span> <span class="token keyword">EXPLAIN</span> <span class="token keyword">SELECT</span> c2 <span class="token keyword">FROM</span> t
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> id2 <span class="token operator">></span> <span class="token number">3</span>
<span class="token prompt"> -></span> <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> id1 <span class="token keyword">ASC</span> <span class="token keyword">LIMIT</span> <span class="token number">2</span>\G
<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> 1. row <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>
id<span class="token punctuation">:</span> 1
select_type<span class="token punctuation">:</span> SIMPLE
table<span class="token punctuation">:</span> t
partitions<span class="token punctuation">:</span> NULL
type<span class="token punctuation">:</span> index
possible_keys<span class="token punctuation">:</span> i
key<span class="token punctuation">:</span> PRIMARY
key_len<span class="token punctuation">:</span> 8
ref<span class="token punctuation">:</span> NULL
rows<span class="token punctuation">:</span> 2
filtered<span class="token punctuation">:</span> 70.00
Extra<span class="token punctuation">:</span> Using where</span></code></pre>
</div>
<p>
Now we disable the
<a class="link" href="switchable-optimizations.html#optflag_prefer-ordering-index">
<code class="literal">
prefer_ordering_index
</code>
</a>
flag,
and re-run the same query; this time it uses the index
<code class="literal">
i
</code>
(which includes the
<code class="literal">
id2
</code>
column used in the
<code class="literal">
WHERE
</code>
clause), and a filesort:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa80063034"><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></span> <span class="token keyword">SET</span> optimizer_switch <span class="token operator">=</span> <span class="token string">"prefer_ordering_index=off"</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">EXPLAIN</span> <span class="token keyword">SELECT</span> c2 <span class="token keyword">FROM</span> t
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> id2 <span class="token operator">></span> <span class="token number">3</span>
<span class="token prompt"> -></span> <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> id1 <span class="token keyword">ASC</span> <span class="token keyword">LIMIT</span> <span class="token number">2</span>\G
<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> 1. row <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>
id<span class="token punctuation">:</span> 1
select_type<span class="token punctuation">:</span> SIMPLE
table<span class="token punctuation">:</span> t
partitions<span class="token punctuation">:</span> NULL
type<span class="token punctuation">:</span> range
possible_keys<span class="token punctuation">:</span> i
key<span class="token punctuation">:</span> i
key_len<span class="token punctuation">:</span> 8
ref<span class="token punctuation">:</span> NULL
rows<span class="token punctuation">:</span> 14
filtered<span class="token punctuation">:</span> 100.00
Extra<span class="token punctuation">:</span> Using index condition; Using filesort</span></code></pre>
</div>
<p>
See also
<a class="xref" href="switchable-optimizations.html" title="10.9.2 Switchable Optimizations">
Section 10.9.2, “Switchable Optimizations”
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/charset-conversion.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="charset-conversion">
</a>
12.7 Column Character Set Conversion
</h2>
</div>
</div>
</div>
<p>
To convert a binary or nonbinary string column to use a particular
character set, use
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
. For
successful conversion to occur, one of the following conditions
must apply:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
If the column has a binary data type
(
<a class="link" href="binary-varbinary.html" title="13.3.3 The BINARY and VARBINARY Types">
<code class="literal">
BINARY
</code>
</a>
,
<a class="link" href="binary-varbinary.html" title="13.3.3 The BINARY and VARBINARY Types">
<code class="literal">
VARBINARY
</code>
</a>
,
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
BLOB
</code>
</a>
), all the values that it
contains must be encoded using a single character set (the
character set you're converting the column to). If you use a
binary column to store information in multiple character sets,
MySQL has no way to know which values use which character set
and cannot convert the data properly.
</p>
</li>
<li class="listitem">
<p>
If the column has a nonbinary data type
(
<a class="link" href="char.html" title="13.3.2 The CHAR and VARCHAR Types">
<code class="literal">
CHAR
</code>
</a>
,
<a class="link" href="char.html" title="13.3.2 The CHAR and VARCHAR Types">
<code class="literal">
VARCHAR
</code>
</a>
,
<a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
<code class="literal">
TEXT
</code>
</a>
), its contents should be
encoded in the column character set, not some other character
set. If the contents are encoded in a different character set,
you can convert the column to use a binary data type first,
and then to a nonbinary column with the desired character set.
</p>
</li>
</ul>
</div>
<p>
Suppose that a table
<code class="literal">
t
</code>
has a binary column
named
<code class="literal">
col1
</code>
defined as
<code class="literal">
VARBINARY(50)
</code>
. Assuming that the information in
the column is encoded using a single character set, you can
convert it to a nonbinary column that has that character set. For
example, if
<code class="literal">
col1
</code>
contains binary data
representing characters in the
<code class="literal">
greek
</code>
character
set, you can convert it as follows:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa93937232"><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">ALTER</span> <span class="token keyword">TABLE</span> t <span class="token keyword">MODIFY</span> col1 <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">50</span><span class="token punctuation">)</span> <span class="token keyword">CHARACTER</span> <span class="token keyword">SET</span> greek<span class="token punctuation">;</span></code></pre>
</div>
<p>
If your original column has a type of
<code class="literal">
BINARY(50)
</code>
, you could convert it to
<code class="literal">
CHAR(50)
</code>
, but the resulting values are padded
with
<code class="literal">
0x00
</code>
bytes at the end, which may be
undesirable. To remove these bytes, use the
<a class="link" href="string-functions.html#function_trim">
<code class="literal">
TRIM()
</code>
</a>
function:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa36837779"><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">UPDATE</span> t <span class="token keyword">SET</span> col1 <span class="token operator">=</span> <span class="token function">TRIM</span><span class="token punctuation">(</span><span class="token keyword">TRAILING</span> <span class="token number">0x00</span> <span class="token keyword">FROM</span> col1<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Suppose that table
<code class="literal">
t
</code>
has a nonbinary column
named
<code class="literal">
col1
</code>
defined as
<code class="literal">
CHAR(50)
CHARACTER SET latin1
</code>
but you want to convert it to use
<code class="literal">
utf8mb4
</code>
so that you can store values from many
languages. The following statement accomplishes this:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa59473875"><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">ALTER</span> <span class="token keyword">TABLE</span> t <span class="token keyword">MODIFY</span> col1 <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">50</span><span class="token punctuation">)</span> <span class="token keyword">CHARACTER</span> <span class="token keyword">SET</span> utf8mb4<span class="token punctuation">;</span></code></pre>
</div>
<p>
Conversion may be lossy if the column contains characters that are
not in both character sets.
</p>
<p>
A special case occurs if you have old tables from before MySQL 4.1
where a nonbinary column contains values that actually are encoded
in a character set different from the server's default character
set. For example, an application might have stored
<code class="literal">
sjis
</code>
values in a column, even though MySQL's
default character set was different. It is possible to convert the
column to use the proper character set but an additional step is
required. Suppose that the server's default character set was
<code class="literal">
latin1
</code>
and
<code class="literal">
col1
</code>
is defined
as
<code class="literal">
CHAR(50)
</code>
but its contents are
<code class="literal">
sjis
</code>
values. The first step is to convert the
column to a binary data type, which removes the existing character
set information without performing any character conversion:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa7305084"><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">ALTER</span> <span class="token keyword">TABLE</span> t <span class="token keyword">MODIFY</span> col1 <span class="token datatype">BLOB</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The next step is to convert the column to a nonbinary data type
with the proper character set:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa28683148"><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">ALTER</span> <span class="token keyword">TABLE</span> t <span class="token keyword">MODIFY</span> col1 <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">50</span><span class="token punctuation">)</span> <span class="token keyword">CHARACTER</span> <span class="token keyword">SET</span> sjis<span class="token punctuation">;</span></code></pre>
</div>
<p>
This procedure requires that the table not have been modified
already with statements such as
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
or
<a class="link" href="update.html" title="15.2.17 UPDATE Statement">
<code class="literal">
UPDATE
</code>
</a>
after an upgrade to MySQL
4.1 or higher. In that case, MySQL would store new values in the
column using
<code class="literal">
latin1
</code>
, and the column would
contain a mix of
<code class="literal">
sjis
</code>
and
<code class="literal">
latin1
</code>
values and cannot be converted properly.
</p>
<p>
If you specified attributes when creating a column initially, you
should also specify them when altering the table with
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
. For example, if you
specified
<code class="literal">
NOT NULL
</code>
and an explicit
<code class="literal">
DEFAULT
</code>
value, you should also provide them in
the
<a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
<code class="literal">
ALTER TABLE
</code>
</a>
statement.
Otherwise, the resulting column definition does not include those
attributes.
</p>
<p>
To convert all character columns in a table, the
<code class="literal">
ALTER
TABLE ... CONVERT TO CHARACTER SET
<em class="replaceable">
<code>
charset
</code>
</em>
</code>
statement may be
useful. See
<a class="xref" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
Section 15.1.9, “ALTER TABLE Statement”
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/show-variables.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="show-variables">
</a>
15.7.7.41 SHOW VARIABLES Statement
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045169033824">
</a>
<a class="indexterm" name="idm46045169032768">
</a>
<a class="indexterm" name="idm46045169031696">
</a>
<a class="indexterm" name="idm46045169030624">
</a>
<a class="indexterm" name="idm46045169029136">
</a>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa76755248"><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 punctuation">[</span><span class="token keyword">GLOBAL</span> <span class="token operator">|</span> <span class="token keyword">SESSION</span><span class="token punctuation">]</span> <span class="token keyword">VARIABLES</span>
<span class="token punctuation">[</span><span class="token operator">LIKE</span> <span class="token string">'<em class="replaceable">pattern</em>'</span> <span class="token operator">|</span> <span class="token keyword">WHERE</span> <em class="replaceable">expr</em><span class="token punctuation">]</span></code></pre>
</div>
<a class="indexterm" name="idm46045169023776">
</a>
<p>
<a class="link" href="show-variables.html" title="15.7.7.41 SHOW VARIABLES Statement">
<code class="literal">
SHOW VARIABLES
</code>
</a>
shows the values
of MySQL system variables (see
<a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
Section 7.1.8, “Server System Variables”
</a>
). This statement does
not require any privilege. It requires only the ability to
connect to the server.
</p>
<p>
System variable information is also available from these
sources:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Performance Schema tables. See
<a class="xref" href="performance-schema-system-variable-tables.html" title="29.12.14 Performance Schema System Variable Tables">
Section 29.12.14, “Performance Schema System Variable Tables”
</a>
.
</p>
</li>
<li class="listitem">
<p>
The
<a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
<span class="command">
<strong>
mysqladmin variables
</strong>
</span>
</a>
command. See
<a class="xref" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
Section 6.5.2, “mysqladmin — A MySQL Server Administration Program”
</a>
.
</p>
</li>
</ul>
</div>
<p>
For
<a class="link" href="show-variables.html" title="15.7.7.41 SHOW VARIABLES Statement">
<code class="literal">
SHOW VARIABLES
</code>
</a>
, a
<a class="link" href="string-comparison-functions.html#operator_like">
<code class="literal">
LIKE
</code>
</a>
clause, if present, indicates
which variable names to match. A
<code class="literal">
WHERE
</code>
clause
can be given to select rows using more general conditions, as
discussed in
<a class="xref" href="extended-show.html" title="28.8 Extensions to SHOW Statements">
Section 28.8, “Extensions to SHOW Statements”
</a>
.
</p>
<p>
<a class="link" href="show-variables.html" title="15.7.7.41 SHOW VARIABLES Statement">
<code class="literal">
SHOW VARIABLES
</code>
</a>
accepts an
optional
<code class="literal">
GLOBAL
</code>
or
<code class="literal">
SESSION
</code>
variable scope modifier:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
With a
<code class="literal">
GLOBAL
</code>
modifier, the statement
displays global system variable values. These are the values
used to initialize the corresponding session variables for
new connections to MySQL. If a variable has no global value,
no value is displayed.
</p>
</li>
<li class="listitem">
<p>
With a
<code class="literal">
SESSION
</code>
modifier, the statement
displays the system variable values that are in effect for
the current connection. If a variable has no session value,
the global value is displayed.
<code class="literal">
LOCAL
</code>
is a
synonym for
<code class="literal">
SESSION
</code>
.
</p>
</li>
<li class="listitem">
<p>
If no modifier is present, the default is
<code class="literal">
SESSION
</code>
.
</p>
</li>
</ul>
</div>
<p>
The scope for each system variable is listed at
<a class="xref" href="server-system-variables.html" title="7.1.8 Server System Variables">
Section 7.1.8, “Server System Variables”
</a>
.
</p>
<p>
<a class="link" href="show-variables.html" title="15.7.7.41 SHOW VARIABLES Statement">
<code class="literal">
SHOW VARIABLES
</code>
</a>
is subject to a
version-dependent display-width limit. For variables with very
long values that are not completely displayed, use
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
as a workaround. For
example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa40872976"><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">SELECT</span> <span class="token variable">@@GLOBAL.innodb_data_file_path</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Most system variables can be set at server startup (read-only
variables such as
<a class="link" href="server-system-variables.html#sysvar_version_comment">
<code class="literal">
version_comment
</code>
</a>
are
exceptions). Many can be changed 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. See
<a class="xref" href="using-system-variables.html" title="7.1.9 Using System Variables">
Section 7.1.9, “Using System Variables”
</a>
, and
<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>
.
</p>
<p>
Partial output is shown here. The list of names and values may
differ for your server.
<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 each variable, and
<a class="xref" href="server-configuration.html" title="7.1.1 Configuring the Server">
Section 7.1.1, “Configuring the Server”
</a>
,
provides information about tuning them.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa73449601"><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></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 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 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 output"><span class="token punctuation">|</span> avoid_temporal_upgrade <span class="token punctuation">|</span> OFF <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> back_log <span class="token punctuation">|</span> 151 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> basedir <span class="token punctuation">|</span> /local/mysql<span class="token punctuation">-</span>8.4/ <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> big_tables <span class="token punctuation">|</span> OFF <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> bind_address <span class="token punctuation">|</span> 127.0.0.1 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog_cache_size <span class="token punctuation">|</span> 32768 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog_checksum <span class="token punctuation">|</span> CRC32 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog_direct_non_transactional_updates <span class="token punctuation">|</span> OFF <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog_encryption <span class="token punctuation">|</span> OFF <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog_error_action <span class="token punctuation">|</span> ABORT_SERVER <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog_expire_logs_auto_purge <span class="token punctuation">|</span> ON <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> binlog_expire_logs_seconds <span class="token punctuation">|</span> 2592000 <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> max_error_count <span class="token punctuation">|</span> 1024 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_execution_time <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_heap_table_size <span class="token punctuation">|</span> 16777216 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_insert_delayed_threads <span class="token punctuation">|</span> 20 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_join_size <span class="token punctuation">|</span> 18446744073709551615 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_length_for_sort_data <span class="token punctuation">|</span> 4096 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_points_in_geometry <span class="token punctuation">|</span> 65536 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_prepared_stmt_count <span class="token punctuation">|</span> 16382 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_relay_log_size <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_seeks_for_key <span class="token punctuation">|</span> 18446744073709551615 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_sort_length <span class="token punctuation">|</span> 1024 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_sp_recursion_depth <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_user_connections <span class="token punctuation">|</span> 0 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> max_write_lock_count <span class="token punctuation">|</span> 18446744073709551615 <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> time_zone <span class="token punctuation">|</span> SYSTEM <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> timestamp <span class="token punctuation">|</span> 1682684938.710453 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> tls_certificates_enforced_validation <span class="token punctuation">|</span> OFF <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> tls_ciphersuites <span class="token punctuation">|</span> <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 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> tmp_table_size <span class="token punctuation">|</span> 16777216 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> tmpdir <span class="token punctuation">|</span> /tmp <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> transaction_alloc_block_size <span class="token punctuation">|</span> 8192 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> transaction_allow_batching <span class="token punctuation">|</span> OFF <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> transaction_isolation <span class="token punctuation">|</span> REPEATABLE<span class="token punctuation">-</span>READ <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> transaction_prealloc_size <span class="token punctuation">|</span> 4096 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> transaction_read_only <span class="token punctuation">|</span> OFF <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> unique_checks <span class="token punctuation">|</span> ON <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> updatable_views_with_limit <span class="token punctuation">|</span> YES <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> use_secondary_engine <span class="token punctuation">|</span> ON <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> version <span class="token punctuation">|</span> 8.4.3 <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 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 rows for those variables with names that match the
pattern. To obtain the row for a specific variable, 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="sa44685169"><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="sa26217170"><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>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/replication-multi-source-stop-replica.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="replication-multi-source-stop-replica">
</a>
19.1.5.6 Stopping Multi-Source Replicas
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045145159312">
</a>
<p>
The
<a class="link" href="stop-replica.html" title="15.4.2.5 STOP REPLICA Statement">
<code class="literal">
STOP REPLICA
</code>
</a>
statement can be
used to stop a multi-source replica. By default, if you use the
<a class="link" href="stop-replica.html" title="15.4.2.5 STOP REPLICA Statement">
<code class="literal">
STOP REPLICA
</code>
</a>
statement on a
multi-source replica all channels are stopped. Optionally, use the
<code class="literal">
FOR CHANNEL
<em class="replaceable">
<code>
channel
</code>
</em>
</code>
clause to stop only a specific channel.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
To stop all currently configured replication channels:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa91738043"><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></span> <span class="token keyword">STOP</span> <span class="token keyword">REPLICA</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
To stop only a named channel, use a
<code class="literal">
FOR CHANNEL
<em class="replaceable">
<code>
channel
</code>
</em>
</code>
clause:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa47602481"><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></span> <span class="token keyword">STOP</span> <span class="token keyword">REPLICA</span> <span class="token keyword">FOR</span> <span class="token keyword">CHANNEL</span> <span class="token string">"source_1"</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
</ul>
</div>
<p>
For the full syntax of the
<a class="link" href="stop-replica.html" title="15.4.2.5 STOP REPLICA Statement">
<code class="literal">
STOP
REPLICA
</code>
</a>
statement and other available options, see
<a class="xref" href="stop-replica.html" title="15.4.2.5 STOP REPLICA Statement">
Section 15.4.2.5, “STOP REPLICA Statement”
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/close.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="close">
</a>
15.6.6.1 Cursor CLOSE Statement
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045176160800">
</a>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa98634634"><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">CLOSE</span> <span class="token keyword"><em class="replaceable">cursor_name</em></span></code></pre>
</div>
<p>
This statement closes a previously opened cursor. For an
example, see
<a class="xref" href="cursors.html" title="15.6.6 Cursors">
Section 15.6.6, “Cursors”
</a>
.
</p>
<p>
An error occurs if the cursor is not open.
</p>
<p>
If not closed explicitly, a cursor is closed at the end of the
<a class="link" href="begin-end.html" title="15.6.1 BEGIN ... END Compound Statement">
<code class="literal">
BEGIN ...
END
</code>
</a>
block in which it was declared.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-install-shutdown-restart.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="mysql-cluster-install-shutdown-restart">
</a>
25.3.6 Safe Shutdown and Restart of NDB Cluster
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045122103680">
</a>
<a class="indexterm" name="idm46045122102192">
</a>
<p>
To shut down the cluster, enter the following command in a shell
on the machine hosting the management node:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa33870798"><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">$> </span><span class="token command">ndb_mgm</span> <span class="token property">-e</span> shutdown</code></pre>
</div>
<p>
The
<code class="option">
-e
</code>
option here is used to pass a command to
the
<a class="link" href="mysql-cluster-programs-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client">
<span class="command">
<strong>
ndb_mgm
</strong>
</span>
</a>
client from the shell. The command
causes the
<a class="link" href="mysql-cluster-programs-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client">
<span class="command">
<strong>
ndb_mgm
</strong>
</span>
</a>
,
<a class="link" href="mysql-cluster-programs-ndb-mgmd.html" title="25.5.4 ndb_mgmd — The NDB Cluster Management Server Daemon">
<span class="command">
<strong>
ndb_mgmd
</strong>
</span>
</a>
, and any
<a class="link" href="mysql-cluster-programs-ndbd.html" title="25.5.1 ndbd — The NDB Cluster Data Node Daemon">
<span class="command">
<strong>
ndbd
</strong>
</span>
</a>
or
<a class="link" href="mysql-cluster-programs-ndbmtd.html" title="25.5.3 ndbmtd — The NDB Cluster Data Node Daemon (Multi-Threaded)">
<span class="command">
<strong>
ndbmtd
</strong>
</span>
</a>
processes to terminate gracefully. Any
SQL nodes can be terminated using
<a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
<span class="command">
<strong>
mysqladmin
shutdown
</strong>
</span>
</a>
and other means. On Windows platforms, assuming
that you have installed the SQL node as a Windows service, you can
use
<span class="command">
<strong>
SC STOP
<em class="replaceable">
<code>
service_name
</code>
</em>
</strong>
</span>
or
<span class="command">
<strong>
NET
STOP
<em class="replaceable">
<code>
service_name
</code>
</em>
</strong>
</span>
.
</p>
<p>
To restart the cluster on Unix platforms, run these commands:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
On the management host (
<code class="literal">
198.51.100.10
</code>
in
our example setup):
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa96530647"><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">$> </span><span class="token command">ndb_mgmd</span> <span class="token property">-f</span> /var/lib/mysql-cluster/config<span class="token punctuation">.</span>ini</code></pre>
</div>
</li>
<li class="listitem">
<p>
On each of the data node hosts
(
<code class="literal">
198.51.100.30
</code>
and
<code class="literal">
198.51.100.40
</code>
):
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa91954605"><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">$> </span><span class="token command">ndbd</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Use the
<a class="link" href="mysql-cluster-programs-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client">
<span class="command">
<strong>
ndb_mgm
</strong>
</span>
</a>
client to verify that both
data nodes have started successfully.
</p>
</li>
<li class="listitem">
<p>
On the SQL host (
<code class="literal">
198.51.100.20
</code>
):
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa55249853"><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">$> </span><span class="token command">mysqld_safe</span> &</code></pre>
</div>
</li>
</ul>
</div>
<p>
On Windows platforms, assuming that you have installed all NDB
Cluster processes as Windows services using the default service
names (see
<a class="xref" href="mysql-cluster-install-windows-service.html" title="25.3.2.4 Installing NDB Cluster Processes as Windows Services">
Section 25.3.2.4, “Installing NDB Cluster Processes as Windows Services”
</a>
), you can
restart the cluster as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
On the management host (
<code class="literal">
198.51.100.10
</code>
in
our example setup), execute the following command:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa99199041"><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">C:\></span><span class="token command"> SC</span> START ndb_mgmd</code></pre>
</div>
</li>
<li class="listitem">
<p>
On each of the data node hosts
(
<code class="literal">
198.51.100.30
</code>
and
<code class="literal">
198.51.100.40
</code>
), execute the following
command:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa4444343"><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">C:\></span><span class="token command"> SC</span> START ndbd</code></pre>
</div>
</li>
<li class="listitem">
<p>
On the management node host, use the
<a class="link" href="mysql-cluster-programs-ndb-mgm.html" title="25.5.5 ndb_mgm — The NDB Cluster Management Client">
<span class="command">
<strong>
ndb_mgm
</strong>
</span>
</a>
client to verify that the
management node and both data nodes have started successfully
(see
<a class="xref" href="mysql-cluster-install-windows-initial-start.html" title="25.3.2.3 Initial Startup of NDB Cluster on Windows">
Section 25.3.2.3, “Initial Startup of NDB Cluster on Windows”
</a>
).
</p>
</li>
<li class="listitem">
<p>
On the SQL node host (
<code class="literal">
198.51.100.20
</code>
),
execute the following command:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa13053"><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">C:\></span><span class="token command"> SC</span> START mysql</code></pre>
</div>
</li>
</ul>
</div>
<p>
In a production setting, it is usually not desirable to shut down
the cluster completely. In many cases, even when making
configuration changes, or performing upgrades to the cluster
hardware or software (or both), which require shutting down
individual host machines, it is possible to do so without shutting
down the cluster as a whole by performing a
<span class="firstterm">
rolling restart
</span>
of the
cluster. For more information about doing this, see
<a class="xref" href="mysql-cluster-rolling-restart.html" title="25.6.5 Performing a Rolling Restart of an NDB Cluster">
Section 25.6.5, “Performing a Rolling Restart of an NDB Cluster”
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/programs-using.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="programs-using">
</a>
6.2 Using MySQL Programs
</h2>
</div>
</div>
</div>
<div class="toc">
<dl class="toc">
<dt>
<span class="section">
<a href="invoking-programs.html">
6.2.1 Invoking MySQL Programs
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="program-options.html">
6.2.2 Specifying Program Options
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="connection-options.html">
6.2.3 Command Options for Connecting to the Server
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="connecting.html">
6.2.4 Connecting to the MySQL Server Using Command Options
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="connecting-using-uri-or-key-value-pairs.html">
6.2.5 Connecting to the Server Using URI-Like Strings or Key-Value Pairs
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="connecting-using-dns-srv.html">
6.2.6 Connecting to the Server Using DNS SRV Records
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="transport-protocols.html">
6.2.7 Connection Transport Protocols
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="connection-compression-control.html">
6.2.8 Connection Compression Control
</a>
</span>
</dt>
<dt>
<span class="section">
<a href="setting-environment-variables.html">
6.2.9 Setting Environment Variables
</a>
</span>
</dt>
</dl>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/innodb-compression-tuning-monitoring.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="innodb-compression-tuning-monitoring">
</a>
17.9.1.4 Monitoring InnoDB Table Compression at Runtime
</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46045161515584">
</a>
<a class="indexterm" name="idm46045161514096">
</a>
<p>
Overall application performance, CPU and I/O utilization and the
size of disk files are good indicators of how effective
compression is for your application. This section builds on the
performance tuning advice from
<a class="xref" href="innodb-compression-tuning.html" title="17.9.1.3 Tuning Compression for InnoDB Tables">
Section 17.9.1.3, “Tuning Compression for InnoDB Tables”
</a>
, and shows how to
find problems that might not turn up during initial testing.
</p>
<p>
To dig deeper into performance considerations for compressed
tables, you can monitor compression performance at runtime using
the
<a class="link" href="glossary.html#glos_information_schema" title="INFORMATION_SCHEMA">
Information
Schema
</a>
tables described in
<a class="xref" href="innodb-information-schema-examples-compression-sect.html#innodb-information-schema-examples-compression" title="Example 17.1 Using the Compression Information Schema Tables">
Example 17.1, “Using the Compression Information Schema Tables”
</a>
.
These tables reflect the internal use of memory and the rates of
compression used overall.
</p>
<p>
The
<a class="link" href="information-schema-innodb-cmp-table.html" title="28.4.6 The INFORMATION_SCHEMA INNODB_CMP and INNODB_CMP_RESET Tables">
<code class="literal">
INNODB_CMP
</code>
</a>
table reports
information about compression activity for each compressed page
size (
<code class="literal">
KEY_BLOCK_SIZE
</code>
) in use. The information
in these tables is system-wide: it summarizes the compression
statistics across all compressed tables in your database. You
can use this data to help decide whether or not to compress a
table by examining these tables when no other compressed tables
are being accessed. It involves relatively low overhead on the
server, so you might query it periodically on a production
server to check the overall efficiency of the compression
feature.
</p>
<p>
The
<a class="link" href="information-schema-innodb-cmp-per-index-table.html" title="28.4.8 The INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and INNODB_CMP_PER_INDEX_RESET Tables">
<code class="literal">
INNODB_CMP_PER_INDEX
</code>
</a>
table
reports information about compression activity for individual
tables and indexes. This information is more targeted and more
useful for evaluating compression efficiency and diagnosing
performance issues one table or index at a time. (Because that
each
<code class="literal">
InnoDB
</code>
table is represented as a
clustered index, MySQL does not make a big distinction between
tables and indexes in this context.) The
<a class="link" href="information-schema-innodb-cmp-per-index-table.html" title="28.4.8 The INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and INNODB_CMP_PER_INDEX_RESET Tables">
<code class="literal">
INNODB_CMP_PER_INDEX
</code>
</a>
table does
involve substantial overhead, so it is more suitable for
development servers, where you can compare the effects of
different
<a class="link" href="glossary.html#glos_workload" title="workload">
workloads
</a>
, data,
and compression settings in isolation. To guard against imposing
this monitoring overhead by accident, you must enable the
<a class="link" href="innodb-parameters.html#sysvar_innodb_cmp_per_index_enabled">
<code class="literal">
innodb_cmp_per_index_enabled
</code>
</a>
configuration option before you can query the
<a class="link" href="information-schema-innodb-cmp-per-index-table.html" title="28.4.8 The INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and INNODB_CMP_PER_INDEX_RESET Tables">
<code class="literal">
INNODB_CMP_PER_INDEX
</code>
</a>
table.
</p>
<p>
The key statistics to consider are the number of, and amount of
time spent performing, compression and uncompression operations.
Since MySQL splits
<a class="link" href="glossary.html#glos_b_tree" title="B-tree">
B-tree
</a>
nodes when they are too full to contain the compressed data
following a modification, compare the number of
<span class="quote">
“
<span class="quote">
successful
</span>
”
</span>
compression operations with the number
of such operations overall. Based on the information in the
<a class="link" href="information-schema-innodb-cmp-table.html" title="28.4.6 The INFORMATION_SCHEMA INNODB_CMP and INNODB_CMP_RESET Tables">
<code class="literal">
INNODB_CMP
</code>
</a>
and
<a class="link" href="information-schema-innodb-cmp-per-index-table.html" title="28.4.8 The INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and INNODB_CMP_PER_INDEX_RESET Tables">
<code class="literal">
INNODB_CMP_PER_INDEX
</code>
</a>
tables and
overall application performance and hardware resource
utilization, you might make changes in your hardware
configuration, adjust the size of the buffer pool, choose a
different page size, or select a different set of tables to
compress.
</p>
<p>
If the amount of CPU time required for compressing and
uncompressing is high, changing to faster or multi-core CPUs can
help improve performance with the same data, application
workload and set of compressed tables. Increasing the size of
the buffer pool might also help performance, so that more
uncompressed pages can stay in memory, reducing the need to
uncompress pages that exist in memory only in compressed form.
</p>
<p>
A large number of compression operations overall (compared to
the number of
<code class="literal">
INSERT
</code>
,
<code class="literal">
UPDATE
</code>
and
<code class="literal">
DELETE
</code>
operations in your application and the size of the database)
could indicate that some of your compressed tables are being
updated too heavily for effective compression. If so, choose a
larger page size, or be more selective about which tables you
compress.
</p>
<p>
If the number of
<span class="quote">
“
<span class="quote">
successful
</span>
”
</span>
compression
operations (
<code class="literal">
COMPRESS_OPS_OK
</code>
) is a high
percentage of the total number of compression operations
(
<code class="literal">
COMPRESS_OPS
</code>
), then the system is likely
performing well. If the ratio is low, then MySQL is
reorganizing, recompressing, and splitting B-tree nodes more
often than is desirable. In this case, avoid compressing some
tables, or increase
<code class="literal">
KEY_BLOCK_SIZE
</code>
for some
of the compressed tables. You might turn off compression for
tables that cause the number of
<span class="quote">
“
<span class="quote">
compression
failures
</span>
”
</span>
in your application to be more than 1% or 2% of
the total. (Such a failure ratio might be acceptable during a
temporary operation such as a data load).
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/bit-value-literals.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="bit-value-literals">
</a>
11.1.5 Bit-Value Literals
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045220168640">
</a>
<a class="indexterm" name="idm46045220167152">
</a>
<p>
Bit-value literals are written using
<code class="literal">
b'
<em class="replaceable">
<code>
val
</code>
</em>
'
</code>
or
<code class="literal">
0b
<em class="replaceable">
<code>
val
</code>
</em>
</code>
notation.
<em class="replaceable">
<code>
val
</code>
</em>
is a binary value written using
zeros and ones. Lettercase of any leading
<code class="literal">
b
</code>
does not matter. A leading
<code class="literal">
0b
</code>
is
case-sensitive and cannot be written as
<code class="literal">
0B
</code>
.
</p>
<p>
Legal bit-value literals:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa79959870"><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">b<span class="token string">'01'</span>
B<span class="token string">'01'</span>
<span class="token number">0b01</span></code></pre>
</div>
<p>
Illegal bit-value literals:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-none"><div class="docs-select-all right" id="sa32700247"><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-none">b'2' (2 is not a binary digit)
0B01 (0B must be written as 0b)</code></pre>
</div>
<p>
By default, a bit-value literal is a binary string:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa5069180"><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></span> <span class="token keyword">SELECT</span> b<span class="token string">'1000001'</span><span class="token punctuation">,</span> <span class="token function">CHARSET</span><span class="token punctuation">(</span>b<span class="token string">'1000001'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> b'1000001' <span class="token punctuation">|</span> CHARSET(b'1000001') <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>
<span class="token output"><span class="token punctuation">|</span> A <span class="token punctuation">|</span> binary <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token number">0b1100001</span><span class="token punctuation">,</span> <span class="token function">CHARSET</span><span class="token punctuation">(</span><span class="token number">0b1100001</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> 0b1100001 <span class="token punctuation">|</span> CHARSET(0b1100001) <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>
<span class="token output"><span class="token punctuation">|</span> a <span class="token punctuation">|</span> binary <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></code></pre>
</div>
<p>
A bit-value literal may have an optional character set
introducer and
<code class="literal">
COLLATE
</code>
clause, to designate
it as a string that uses a particular character set and
collation:
</p>
<a class="indexterm" name="idm46045220153408">
</a>
<a class="indexterm" name="idm46045220151920">
</a>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa4973380"><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 punctuation">[</span>_<em class="replaceable">charset_name</em><span class="token punctuation">]</span> b<span class="token string">'<em class="replaceable">val</em>'</span> <span class="token punctuation">[</span><span class="token keyword">COLLATE</span> <em class="replaceable">collation_name</em><span class="token punctuation">]</span></code></pre>
</div>
<p>
Examples:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa74603650"><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">SELECT</span> _latin1 b<span class="token string">'1000001'</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> _utf8mb4 <span class="token number">0b1000001</span> <span class="token keyword">COLLATE</span> utf8mb4_danish_ci<span class="token punctuation">;</span></code></pre>
</div>
<p>
The examples use
<code class="literal">
b'
<em class="replaceable">
<code>
val
</code>
</em>
'
</code>
notation,
but
<code class="literal">
0b
<em class="replaceable">
<code>
val
</code>
</em>
</code>
notation
permits introducers as well. For information about introducers,
see
<a class="xref" href="charset-introducer.html" title="12.3.8 Character Set Introducers">
Section 12.3.8, “Character Set Introducers”
</a>
.
</p>
<p>
In numeric contexts, MySQL treats a bit literal like an integer.
To ensure numeric treatment of a bit literal, use it in numeric
context. Ways to do this include adding 0 or using
<a class="link" href="cast-functions.html#function_cast">
<code class="literal">
CAST(... AS UNSIGNED)
</code>
</a>
. For
example, a bit literal assigned to a user-defined variable is a
binary string by default. To assign the value as a number, use
it in numeric context:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa3095922"><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></span> <span class="token keyword">SET</span> <span class="token variable">@v1</span> <span class="token operator">=</span> b<span class="token string">'1100001'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SET</span> <span class="token variable">@v2</span> <span class="token operator">=</span> b<span class="token string">'1100001'</span><span class="token operator">+</span><span class="token number">0</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SET</span> <span class="token variable">@v3</span> <span class="token operator">=</span> <span class="token function">CAST</span><span class="token punctuation">(</span>b<span class="token string">'1100001'</span> <span class="token keyword">AS</span> <span class="token keyword">UNSIGNED</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token variable">@v1</span><span class="token punctuation">,</span> <span class="token variable">@v2</span><span class="token punctuation">,</span> <span class="token variable">@v3</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>
<span class="token output"><span class="token punctuation">|</span> @v1 <span class="token punctuation">|</span> @v2 <span class="token punctuation">|</span> @v3 <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>
<span class="token output"><span class="token punctuation">|</span> a <span class="token punctuation">|</span> 97 <span class="token punctuation">|</span> 97 <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></code></pre>
</div>
<p>
An empty bit value (
<code class="literal">
b''
</code>
) evaluates to a
zero-length binary string. Converted to a number, it produces 0:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa63297846"><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></span> <span class="token keyword">SELECT</span> <span class="token function">CHARSET</span><span class="token punctuation">(</span>b<span class="token string">''</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">LENGTH</span><span class="token punctuation">(</span>b<span class="token string">''</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> CHARSET(b'') <span class="token punctuation">|</span> LENGTH(b'') <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>
<span class="token output"><span class="token punctuation">|</span> binary <span class="token punctuation">|</span> 0 <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> b<span class="token string">''</span><span class="token operator">+</span><span class="token number">0</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>
<span class="token output"><span class="token punctuation">|</span> b''<span class="token punctuation">+</span>0 <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>
<span class="token output"><span class="token punctuation">|</span> 0 <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></code></pre>
</div>
<p>
Bit-value notation is convenient for specifying values to be
assigned to
<a class="link" href="bit-type.html" title="13.1.5 Bit-Value Type - BIT">
<code class="literal">
BIT
</code>
</a>
columns:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa21779258"><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></span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t <span class="token punctuation">(</span>b <span class="token datatype">BIT</span><span class="token punctuation">(</span><span class="token number">8</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t <span class="token keyword">SET</span> b <span class="token operator">=</span> b<span class="token string">'11111111'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t <span class="token keyword">SET</span> b <span class="token operator">=</span> b<span class="token string">'1010'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> t <span class="token keyword">SET</span> b <span class="token operator">=</span> b<span class="token string">'0101'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Bit values in result sets are returned as binary values, which
may not display well. To convert a bit value to printable form,
use it in numeric context or use a conversion function such as
<a class="link" href="string-functions.html#function_bin">
<code class="literal">
BIN()
</code>
</a>
or
<a class="link" href="string-functions.html#function_hex">
<code class="literal">
HEX()
</code>
</a>
. High-order 0 digits are
not displayed in the converted value.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa19060978"><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></span> <span class="token keyword">SELECT</span> b<span class="token operator">+</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token function">BIN</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">OCT</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">HEX</span><span class="token punctuation">(</span>b<span class="token punctuation">)</span> <span class="token keyword">FROM</span> t<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>
<span class="token output"><span class="token punctuation">|</span> b<span class="token punctuation">+</span>0 <span class="token punctuation">|</span> BIN(b) <span class="token punctuation">|</span> OCT(b) <span class="token punctuation">|</span> HEX(b) <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>
<span class="token output"><span class="token punctuation">|</span> 255 <span class="token punctuation">|</span> 11111111 <span class="token punctuation">|</span> 377 <span class="token punctuation">|</span> FF <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 10 <span class="token punctuation">|</span> 1010 <span class="token punctuation">|</span> 12 <span class="token punctuation">|</span> A <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 5 <span class="token punctuation">|</span> 101 <span class="token punctuation">|</span> 5 <span class="token punctuation">|</span> 5 <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></code></pre>
</div>
<a class="indexterm" name="idm46045220123328">
</a>
<a class="indexterm" name="idm46045220121840">
</a>
<p>
For bit literals, bit operations are considered numeric context,
but bit operations permit numeric or binary string arguments in
MySQL 8.4 and higher. To explicitly specify binary
string context for bit literals, use a
<code class="literal">
_binary
</code>
introducer for at least one of the
arguments:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa80527757"><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></span> <span class="token keyword">SET</span> <span class="token variable">@v1</span> <span class="token operator">=</span> b<span class="token string">'000010101'</span> <span class="token operator">|</span> b<span class="token string">'000101010'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SET</span> <span class="token variable">@v2</span> <span class="token operator">=</span> _binary b<span class="token string">'000010101'</span> <span class="token operator">|</span> _binary b<span class="token string">'000101010'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">HEX</span><span class="token punctuation">(</span><span class="token variable">@v1</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token function">HEX</span><span class="token punctuation">(</span><span class="token variable">@v2</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> HEX(@v1) <span class="token punctuation">|</span> HEX(@v2) <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>
<span class="token output"><span class="token punctuation">|</span> 3F <span class="token punctuation">|</span> 003F <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></code></pre>
</div>
<p>
The displayed result appears similar for both bit operations,
but the result without
<code class="literal">
_binary
</code>
is a
<code class="literal">
BIGINT
</code>
value, whereas the result with
<code class="literal">
_binary
</code>
is a binary string. Due to the
difference in result types, the displayed values differ:
High-order 0 digits are not displayed for the numeric result.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/mysql-cluster-replication-multi-source.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="mysql-cluster-replication-multi-source">
</a>
25.7.10 NDB Cluster Replication: Bidirectional and Circular Replication
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045085751840">
</a>
<a class="indexterm" name="idm46045085750416">
</a>
<a class="indexterm" name="idm46045085748928">
</a>
<a class="indexterm" name="idm46045085747424">
</a>
<p>
It is possible to use NDB Cluster for bidirectional replication
between two clusters, as well as for circular replication between
any number of clusters.
</p>
<p>
<b>
Circular replication example.
</b>
In the next few paragraphs we consider the example of a
replication setup involving three NDB Clusters numbered 1, 2,
and 3, in which Cluster 1 acts as the replication source for
Cluster 2, Cluster 2 acts as the source for Cluster 3, and
Cluster 3 acts as the source for Cluster 1. Each cluster has two
SQL nodes, with SQL nodes A and B belonging to Cluster 1, SQL
nodes C and D belonging to Cluster 2, and SQL nodes E and F
belonging to Cluster 3.
</p>
<p>
Circular replication using these clusters is supported as long as
the following conditions are met:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The SQL nodes on all sources and replicas are the same.
</p>
</li>
<li class="listitem">
<p>
All SQL nodes acting as sources and replicas are started with
the system variable
<a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
<code class="literal">
log_replica_updates
</code>
</a>
enabled.
</p>
</li>
</ul>
</div>
<p>
This type of circular replication setup is shown in the following
diagram:
</p>
<div class="figure">
<a name="fig-mysql-cluster-replication-circular-all-sources-as-replicas">
</a>
<p class="title">
<b>
Figure 25.14 NDB Cluster Circular Replication with All Sources As Replicas
</b>
</p>
<div class="figure-contents">
<div class="mediaobject">
<img alt="Some content is described in the surrounding text. The diagram shows three clusters, each with two nodes. Arrows connecting SQL nodes in different clusters illustrate that all sources are also replicas." src="images/cluster-circular-replication-1.png" style="width: 100%; max-width: 557px;"/>
</div>
</div>
</div>
<br class="figure-break"/>
<p>
In this scenario, SQL node A in Cluster 1 replicates to SQL node C
in Cluster 2; SQL node C replicates to SQL node E in Cluster 3;
SQL node E replicates to SQL node A. In other words, the
replication line (indicated by the curved arrows in the diagram)
directly connects all SQL nodes used as replication sources and
replicas.
</p>
<p>
It is also possible to set up circular replication in such a way
that not all source SQL nodes are also replicas, as shown here:
</p>
<div class="figure">
<a name="fig-mysql-cluster-replication-circular-not-all-sources-as-replicas">
</a>
<p class="title">
<b>
Figure 25.15 NDB Cluster Circular Replication Where Not All Sources Are Replicas
</b>
</p>
<div class="figure-contents">
<div class="mediaobject">
<img alt="Some content is described in the surrounding text. The diagram shows three clusters, each with two nodes. Arrows connecting SQL nodes in different clusters illustrate that not all sources are replicas." src="images/cluster-circular-replication-2.png" style="width: 100%; max-width: 542px;"/>
</div>
</div>
</div>
<br class="figure-break"/>
<p>
In this case, different SQL nodes in each cluster are used as
replication sources and replicas. You must
<span class="emphasis">
<em>
not
</em>
</span>
start any of the SQL nodes with the
system variable
<a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
<code class="literal">
log_replica_updates
</code>
</a>
enabled. This
type of circular replication scheme for NDB Cluster, in which the
line of replication (again indicated by the curved arrows in the
diagram) is discontinuous, should be possible, but it should be
noted that it has not yet been thoroughly tested and must
therefore still be considered experimental.
</p>
<p>
<b>
Using NDB-native backup and restore to initialize a replica cluster.
</b>
<a class="indexterm" name="idm46045085720464">
</a>
When setting up circular replication, it is possible to
initialize the replica cluster by using the management client
<a class="link" href="mysql-cluster-backup-using-management-client.html" title="25.6.8.2 Using The NDB Cluster Management Client to Create a Backup">
<code class="literal">
START BACKUP
</code>
</a>
command on one
NDB Cluster to create a backup and then applying this backup on
another NDB Cluster using
<a class="link" href="mysql-cluster-programs-ndb-restore.html" title="25.5.23 ndb_restore — Restore an NDB Cluster Backup">
<span class="command">
<strong>
ndb_restore
</strong>
</span>
</a>
. This
does not automatically create binary logs on the second NDB
Cluster's SQL node acting as the replica; in order to cause
the binary logs to be created, you must issue a
<a class="link" href="show-tables.html" title="15.7.7.39 SHOW TABLES Statement">
<code class="literal">
SHOW TABLES
</code>
</a>
statement on that SQL
node; this should be done prior to running
<a class="link" href="start-replica.html" title="15.4.2.4 START REPLICA Statement">
<code class="literal">
START REPLICA
</code>
</a>
. This is a known
issue.
</p>
<p>
<b>
Multi-source failover example.
</b>
In this section, we discuss failover in a multi-source NDB
Cluster replication setup with three NDB Clusters having server
IDs 1, 2, and 3. In this scenario, Cluster 1 replicates to
Clusters 2 and 3; Cluster 2 also replicates to Cluster 3. This
relationship is shown here:
</p>
<div class="figure">
<a name="fig-mysql-cluster-replication-3-sources">
</a>
<p class="title">
<b>
Figure 25.16 NDB Cluster Multi-Source Replication With 3 Sources
</b>
</p>
<div class="figure-contents">
<div class="mediaobject">
<img alt="Multi-source NDB Cluster replication setup with three NDB Clusters having server IDs 1, 2, and 3; Cluster 1 replicates to Clusters 2 and 3; Cluster 2 also replicates to Cluster 3." src="images/cluster-replication-multi-source.png" style="width: 100%; max-width: 366px;"/>
</div>
</div>
</div>
<br class="figure-break"/>
<p>
In other words, data replicates from Cluster 1 to Cluster 3
through 2 different routes: directly, and by way of Cluster 2.
</p>
<p>
Not all MySQL servers taking part in multi-source replication must
act as both source and replica, and a given NDB Cluster might use
different SQL nodes for different replication channels. Such a
case is shown here:
</p>
<div class="figure">
<a name="fig-mysql-cluster-replication-mysql-servers">
</a>
<p class="title">
<b>
Figure 25.17 NDB Cluster Multi-Source Replication, With MySQL Servers
</b>
</p>
<div class="figure-contents">
<div class="mediaobject">
<img alt="Concepts are described in the surrounding text. Shows three nodes: SQL node A in Cluster 1 replicates to SQL node F in Cluster 3; SQL node B in Cluster 1 replicates to SQL node C in Cluster 2; SQL node E in Cluster 3 replicates to SQL node G in Cluster 3. SQL nodes A and B in cluster 1 have --log-replica-updates=0; SQL nodes C in Cluster 2, and SQL nodes F and G in Cluster 3 have --log-replica-updates=1; and SQL nodes D and E in Cluster 2 have --log-replica-updates=0." src="images/cluster-replication-multi-source-mysqlds.png" style="width: 100%; max-width: 692px;"/>
</div>
</div>
</div>
<br class="figure-break"/>
<p>
MySQL servers acting as replicas must be run with the system
variable
<a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
<code class="literal">
log_replica_updates
</code>
</a>
enabled. Which
<a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
<span class="command">
<strong>
mysqld
</strong>
</span>
</a>
processes require this
option is also shown in the preceding diagram.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
Using the
<a class="link" href="replication-options-binary-log.html#sysvar_log_replica_updates">
<code class="literal">
log_replica_updates
</code>
</a>
system variable has no effect on servers not being run as
replicas.
</p>
</div>
<p>
The need for failover arises when one of the replicating clusters
goes down. In this example, we consider the case where Cluster 1
is lost to service, and so Cluster 3 loses 2 sources of updates
from Cluster 1. Because replication between NDB Clusters is
asynchronous, there is no guarantee that Cluster 3's updates
originating directly from Cluster 1 are more recent than those
received through Cluster 2. You can handle this by ensuring that
Cluster 3 catches up to Cluster 2 with regard to updates from
Cluster 1. In terms of MySQL servers, this means that you need to
replicate any outstanding updates from MySQL server C to server F.
</p>
<p>
On server C, perform the following queries:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa95778812"><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">mysqlC></span> <span class="token keyword">SELECT</span> <span class="token variable">@latest</span><span class="token operator">:=</span><span class="token function">MAX</span><span class="token punctuation">(</span>epoch<span class="token punctuation">)</span>
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> mysql<span class="token punctuation">.</span>ndb_apply_status
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> server_id<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>
<span class="token prompt">mysqlC></span> <span class="token keyword">SELECT</span>
<span class="token prompt"> -></span> <span class="token variable">@file</span><span class="token operator">:=</span><span class="token function">SUBSTRING_INDEX</span><span class="token punctuation">(</span><span class="token keyword">File</span><span class="token punctuation">,</span> <span class="token string">'/'</span><span class="token punctuation">,</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token variable">@pos</span><span class="token operator">:=</span>Position
<span class="token prompt"> -></span> <span class="token keyword">FROM</span> mysql<span class="token punctuation">.</span>ndb_binlog_index
<span class="token prompt"> -></span> <span class="token keyword">WHERE</span> orig_epoch <span class="token operator">>=</span> <span class="token variable">@latest</span>
<span class="token prompt"> -></span> <span class="token operator">AND</span> orig_server_id <span class="token operator">=</span> <span class="token number">1</span>
<span class="token prompt"> -></span> <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> epoch <span class="token keyword">ASC</span> <span class="token keyword">LIMIT</span> <span class="token number">1</span><span class="token punctuation">;</span></code></pre>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
You can improve the performance of this query, and thus likely
speed up failover times significantly, by adding the appropriate
index to the
<code class="literal">
ndb_binlog_index
</code>
table. See
<a class="xref" href="mysql-cluster-replication-schema.html" title="25.7.4 NDB Cluster Replication Schema and Tables">
Section 25.7.4, “NDB Cluster Replication Schema and Tables”
</a>
, for more
information.
</p>
</div>
<p>
Copy over the values for
<em class="replaceable">
<code>
@file
</code>
</em>
and
<em class="replaceable">
<code>
@pos
</code>
</em>
manually from server C to server F
(or have your application perform the equivalent). Then, on server
F, execute the following
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION
SOURCE TO
</code>
</a>
statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa23378357"><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">mysqlF<span class="token operator">></span> <span class="token keyword">CHANGE</span> <span class="token keyword">REPLICATION</span> <span class="token keyword">SOURCE</span> <span class="token keyword">TO</span>
<span class="token prompt"> -></span> <span class="token keyword">SOURCE_HOST</span> <span class="token operator">=</span> <span class="token string">'serverC'</span>
<span class="token prompt"> -></span> <span class="token keyword">SOURCE_LOG_FILE</span><span class="token operator">=</span><span class="token string">'@file'</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token keyword">SOURCE_LOG_POS</span><span class="token operator">=</span><span class="token variable">@pos</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
Once this has been done, you can issue a
<a class="link" href="start-replica.html" title="15.4.2.4 START REPLICA Statement">
<code class="literal">
START REPLICA
</code>
</a>
statement on MySQL
server F; this causes any missing updates originating from server
B to be replicated to server F.
</p>
<p>
The
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE TO
</code>
</a>
statement also supports an
<a class="link" href="change-replication-source-to.html#crs-opt-ignore_server_ids">
<code class="literal">
IGNORE_SERVER_IDS
</code>
</a>
option which
takes a comma-separated list of server IDs and causes events
originating from the corresponding servers to be ignored. See the
documentation for this statement for more information, as well as
<a class="xref" href="show-replica-status.html" title="15.7.7.35 SHOW REPLICA STATUS Statement">
Section 15.7.7.35, “SHOW REPLICA STATUS Statement”
</a>
. For information about how
this option interacts with the
<a class="link" href="mysql-cluster-options-variables.html#sysvar_ndb_log_apply_status">
<code class="literal">
ndb_log_apply_status
</code>
</a>
variable,
see
<a class="xref" href="mysql-cluster-replication-failover.html" title="25.7.8 Implementing Failover with NDB Cluster Replication">
Section 25.7.8, “Implementing Failover with NDB Cluster Replication”
</a>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/numeric-type-syntax.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="numeric-type-syntax">
</a>
13.1.1 Numeric Data Type Syntax
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045214422672">
</a>
<a class="indexterm" name="idm46045214421632">
</a>
<a class="indexterm" name="idm46045214420560">
</a>
<p>
For integer data types,
<em class="replaceable">
<code>
M
</code>
</em>
indicates
the minimum display width. The maximum display width is 255.
Display width is unrelated to the range of values a type can
store, as described in
<a class="xref" href="numeric-type-attributes.html" title="13.1.6 Numeric Type Attributes">
Section 13.1.6, “Numeric Type Attributes”
</a>
.
</p>
<p>
For floating-point and fixed-point data types,
<em class="replaceable">
<code>
M
</code>
</em>
is the total number of digits that
can be stored.
</p>
<p>
The display width attribute is deprecated for integer data
types; you should expect support for it to be removed in a
future version of MySQL.
</p>
<p>
If you specify
<code class="literal">
ZEROFILL
</code>
for a numeric column,
MySQL automatically adds the
<code class="literal">
UNSIGNED
</code>
attribute to the column.
</p>
<p>
The
<code class="literal">
ZEROFILL
</code>
attribute is deprecated for
numeric data types; you should expect support for it to be
removed in a future version of MySQL. Consider using an
alternative means of producing the effect of this attribute. For
example, applications could use the
<a class="link" href="string-functions.html#function_lpad">
<code class="literal">
LPAD()
</code>
</a>
function to zero-pad
numbers up to the desired width, or they could store the
formatted numbers in
<a class="link" href="char.html" title="13.3.2 The CHAR and VARCHAR Types">
<code class="literal">
CHAR
</code>
</a>
columns.
</p>
<p>
Numeric data types that permit the
<code class="literal">
UNSIGNED
</code>
attribute also permit
<code class="literal">
SIGNED
</code>
. However, these
data types are signed by default, so the
<code class="literal">
SIGNED
</code>
attribute has no effect.
</p>
<p>
The
<code class="literal">
UNSIGNED
</code>
attribute is deprecated for
columns of type
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT
</code>
</a>
,
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
, and
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DECIMAL
</code>
</a>
(and any synonyms); you
should expect support for it to be removed in a future version
of MySQL. Consider using a simple
<code class="literal">
CHECK
</code>
constraint instead for such columns.
</p>
<p>
<code class="literal">
SERIAL
</code>
is an alias for
<code class="literal">
BIGINT
UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE
</code>
.
</p>
<p>
<code class="literal">
SERIAL DEFAULT VALUE
</code>
in the definition of an
integer column is an alias for
<code class="literal">
NOT NULL AUTO_INCREMENT
UNIQUE
</code>
.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Warning
</div>
<p>
When you use subtraction between integer values where one is
of type
<code class="literal">
UNSIGNED
</code>
, the result is unsigned
unless the
<a class="link" href="sql-mode.html#sqlmode_no_unsigned_subtraction">
<code class="literal">
NO_UNSIGNED_SUBTRACTION
</code>
</a>
SQL
mode is enabled. See
<a class="xref" href="cast-functions.html" title="14.10 Cast Functions and Operators">
Section 14.10, “Cast Functions and Operators”
</a>
.
</p>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214392256">
</a>
<a class="indexterm" name="idm46045214391184">
</a>
<a class="link" href="bit-type.html" title="13.1.5 Bit-Value Type - BIT">
<code class="literal">
BIT[(
<em class="replaceable">
<code>
M
</code>
</em>
)]
</code>
</a>
</p>
<p>
A bit-value type.
<em class="replaceable">
<code>
M
</code>
</em>
indicates the
number of bits per value, from 1 to 64. The default is 1 if
<em class="replaceable">
<code>
M
</code>
</em>
is omitted.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214383392">
</a>
<a class="indexterm" name="idm46045214382320">
</a>
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
TINYINT[(
<em class="replaceable">
<code>
M
</code>
</em>
)]
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
A very small integer. The signed range is
<code class="literal">
-128
</code>
to
<code class="literal">
127
</code>
. The
unsigned range is
<code class="literal">
0
</code>
to
<code class="literal">
255
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214372608">
</a>
<a class="indexterm" name="idm46045214371536">
</a>
<a class="indexterm" name="idm46045214370464">
</a>
<a class="indexterm" name="idm46045214368976">
</a>
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BOOL
</code>
</a>
,
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BOOLEAN
</code>
</a>
</p>
<p>
These types are synonyms for
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
TINYINT(1)
</code>
</a>
. A value of zero
is considered false. Nonzero values are considered true:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa67513640"><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></span> <span class="token keyword">SELECT</span> <span class="token function">IF</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token string">'true'</span><span class="token punctuation">,</span> <span class="token string">'false'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> IF(0, 'true', 'false') <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>
<span class="token output"><span class="token punctuation">|</span> false <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">IF</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token string">'true'</span><span class="token punctuation">,</span> <span class="token string">'false'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> IF(1, 'true', 'false') <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>
<span class="token output"><span class="token punctuation">|</span> true <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">IF</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span> <span class="token string">'true'</span><span class="token punctuation">,</span> <span class="token string">'false'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> IF(2, 'true', 'false') <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>
<span class="token output"><span class="token punctuation">|</span> true <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></code></pre>
</div>
<p>
However, the values
<code class="literal">
TRUE
</code>
and
<code class="literal">
FALSE
</code>
are merely aliases for
<code class="literal">
1
</code>
and
<code class="literal">
0
</code>
, respectively,
as shown here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa69388723"><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></span> <span class="token keyword">SELECT</span> <span class="token function">IF</span><span class="token punctuation">(</span><span class="token number">0</span> <span class="token operator">=</span> <span class="token boolean">FALSE</span><span class="token punctuation">,</span> <span class="token string">'true'</span><span class="token punctuation">,</span> <span class="token string">'false'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> IF(0 = FALSE, 'true', 'false') <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>
<span class="token output"><span class="token punctuation">|</span> true <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">IF</span><span class="token punctuation">(</span><span class="token number">1</span> <span class="token operator">=</span> <span class="token boolean">TRUE</span><span class="token punctuation">,</span> <span class="token string">'true'</span><span class="token punctuation">,</span> <span class="token string">'false'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> IF(1 = TRUE, 'true', 'false') <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>
<span class="token output"><span class="token punctuation">|</span> true <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">IF</span><span class="token punctuation">(</span><span class="token number">2</span> <span class="token operator">=</span> <span class="token boolean">TRUE</span><span class="token punctuation">,</span> <span class="token string">'true'</span><span class="token punctuation">,</span> <span class="token string">'false'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> IF(2 = TRUE, 'true', 'false') <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>
<span class="token output"><span class="token punctuation">|</span> false <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>
<span class="token prompt">mysql></span> <span class="token keyword">SELECT</span> <span class="token function">IF</span><span class="token punctuation">(</span><span class="token number">2</span> <span class="token operator">=</span> <span class="token boolean">FALSE</span><span class="token punctuation">,</span> <span class="token string">'true'</span><span class="token punctuation">,</span> <span class="token string">'false'</span><span class="token punctuation">)</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>
<span class="token output"><span class="token punctuation">|</span> IF(2 = FALSE, 'true', 'false') <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>
<span class="token output"><span class="token punctuation">|</span> false <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></code></pre>
</div>
<p>
The last two statements display the results shown because
<code class="literal">
2
</code>
is equal to neither
<code class="literal">
1
</code>
nor
<code class="literal">
0
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214345248">
</a>
<a class="indexterm" name="idm46045214344176">
</a>
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
SMALLINT[(
<em class="replaceable">
<code>
M
</code>
</em>
)]
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
A small integer. The signed range is
<code class="literal">
-32768
</code>
to
<code class="literal">
32767
</code>
. The
unsigned range is
<code class="literal">
0
</code>
to
<code class="literal">
65535
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214334400">
</a>
<a class="indexterm" name="idm46045214333328">
</a>
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
MEDIUMINT[(
<em class="replaceable">
<code>
M
</code>
</em>
)]
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
A medium-sized integer. The signed range is
<code class="literal">
-8388608
</code>
to
<code class="literal">
8388607
</code>
.
The unsigned range is
<code class="literal">
0
</code>
to
<code class="literal">
16777215
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214323568">
</a>
<a class="indexterm" name="idm46045214322496">
</a>
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
INT[(
<em class="replaceable">
<code>
M
</code>
</em>
)]
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
A normal-size integer. The signed range is
<code class="literal">
-2147483648
</code>
to
<code class="literal">
2147483647
</code>
. The unsigned range is
<code class="literal">
0
</code>
to
<code class="literal">
4294967295
</code>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214313456">
</a>
<a class="indexterm" name="idm46045214312384">
</a>
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
INTEGER[(
<em class="replaceable">
<code>
M
</code>
</em>
)]
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
This type is a synonym for
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
INT
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214304272">
</a>
<a class="indexterm" name="idm46045214303200">
</a>
<a class="indexterm" name="idm46045214301712">
</a>
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BIGINT[(
<em class="replaceable">
<code>
M
</code>
</em>
)]
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
A large integer. The signed range is
<code class="literal">
-9223372036854775808
</code>
to
<code class="literal">
9223372036854775807
</code>
. The unsigned range
is
<code class="literal">
0
</code>
to
<code class="literal">
18446744073709551615
</code>
.
</p>
<p>
<code class="literal">
SERIAL
</code>
is an alias for
<code class="literal">
BIGINT
UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE
</code>
.
</p>
<p>
Some things you should be aware of with respect to
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BIGINT
</code>
</a>
columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214290672">
</a>
All arithmetic is done using signed
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BIGINT
</code>
</a>
or
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
values, so you
should not use unsigned big integers larger than
<code class="literal">
9223372036854775807
</code>
(63 bits) except
with bit functions! If you do that, some of the last
digits in the result may be wrong because of rounding
errors when converting a
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BIGINT
</code>
</a>
value to a
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
.
</p>
<p>
MySQL can handle
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BIGINT
</code>
</a>
in the following cases:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: square; ">
<li class="listitem">
<p>
When using integers to store large unsigned values
in a
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BIGINT
</code>
</a>
column.
</p>
</li>
<li class="listitem">
<p>
In
<a class="link" href="aggregate-functions.html#function_min">
<code class="literal">
MIN(
<em class="replaceable">
<code>
col_name
</code>
</em>
)
</code>
</a>
or
<a class="link" href="aggregate-functions.html#function_max">
<code class="literal">
MAX(
<em class="replaceable">
<code>
col_name
</code>
</em>
)
</code>
</a>
,
where
<em class="replaceable">
<code>
col_name
</code>
</em>
refers to
a
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BIGINT
</code>
</a>
column.
</p>
</li>
<li class="listitem">
<p>
When using operators
(
<a class="link" href="arithmetic-functions.html#operator_plus">
<code class="literal">
+
</code>
</a>
,
<a class="link" href="arithmetic-functions.html#operator_minus">
<code class="literal">
-
</code>
</a>
,
<a class="link" href="arithmetic-functions.html#operator_times">
<code class="literal">
*
</code>
</a>
,
and so on) where both operands are integers.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
You can always store an exact integer value in a
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BIGINT
</code>
</a>
column by storing
it using a string. In this case, MySQL performs a
string-to-number conversion that involves no
intermediate double-precision representation.
</p>
</li>
<li class="listitem">
<p>
The
<a class="link" href="arithmetic-functions.html#operator_minus">
<code class="literal">
-
</code>
</a>
,
<a class="link" href="arithmetic-functions.html#operator_plus">
<code class="literal">
+
</code>
</a>
, and
<a class="link" href="arithmetic-functions.html#operator_times">
<code class="literal">
*
</code>
</a>
operators use
<a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
<code class="literal">
BIGINT
</code>
</a>
arithmetic when both operands are integer values. This
means that if you multiply two big integers (or results
from functions that return integers), you may get
unexpected results when the result is larger than
<code class="literal">
9223372036854775807
</code>
.
</p>
</li>
</ul>
</div>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214256768">
</a>
<a class="indexterm" name="idm46045214255696">
</a>
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DECIMAL[(
<em class="replaceable">
<code>
M
</code>
</em>
[,
<em class="replaceable">
<code>
D
</code>
</em>
])]
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
A packed
<span class="quote">
“
<span class="quote">
exact
</span>
”
</span>
fixed-point number.
<em class="replaceable">
<code>
M
</code>
</em>
is the total number of digits
(the precision) and
<em class="replaceable">
<code>
D
</code>
</em>
is the
number of digits after the decimal point (the scale). The
decimal point and (for negative numbers) the
<code class="literal">
-
</code>
sign are not counted in
<em class="replaceable">
<code>
M
</code>
</em>
. If
<em class="replaceable">
<code>
D
</code>
</em>
is 0, values have no decimal
point or fractional part. The maximum number of digits
(
<em class="replaceable">
<code>
M
</code>
</em>
) for
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DECIMAL
</code>
</a>
is 65. The maximum
number of supported decimals (
<em class="replaceable">
<code>
D
</code>
</em>
)
is 30. If
<em class="replaceable">
<code>
D
</code>
</em>
is omitted, the
default is 0. If
<em class="replaceable">
<code>
M
</code>
</em>
is omitted,
the default is 10. (There is also a limit on how long the
text of
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DECIMAL
</code>
</a>
literals can
be; see
<a class="xref" href="precision-math-expressions.html" title="14.24.3 Expression Handling">
Section 14.24.3, “Expression Handling”
</a>
.)
</p>
<p>
<code class="literal">
UNSIGNED
</code>
, if specified, disallows
negative values. The
<code class="literal">
UNSIGNED
</code>
attribute
is deprecated for columns of type
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DECIMAL
</code>
</a>
(and any synonyms);
you should expect support for it to be removed in a future
version of MySQL. Consider using a simple
<code class="literal">
CHECK
</code>
constraint instead for such
columns.
</p>
<p>
All basic calculations (
<code class="literal">
+, -, *, /
</code>
) with
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DECIMAL
</code>
</a>
columns are done with
a precision of 65 digits.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214233680">
</a>
<a class="indexterm" name="idm46045214232608">
</a>
<a class="indexterm" name="idm46045214231536">
</a>
<a class="indexterm" name="idm46045214230464">
</a>
<a class="indexterm" name="idm46045214229008">
</a>
<a class="indexterm" name="idm46045214227520">
</a>
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DEC[(
<em class="replaceable">
<code>
M
</code>
</em>
[,
<em class="replaceable">
<code>
D
</code>
</em>
])]
[UNSIGNED] [ZEROFILL]
</code>
</a>
,
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
NUMERIC[(
<em class="replaceable">
<code>
M
</code>
</em>
[,
<em class="replaceable">
<code>
D
</code>
</em>
])]
[UNSIGNED] [ZEROFILL]
</code>
</a>
,
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
FIXED[(
<em class="replaceable">
<code>
M
</code>
</em>
[,
<em class="replaceable">
<code>
D
</code>
</em>
])]
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
These types are synonyms for
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
DECIMAL
</code>
</a>
. The
<a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
<code class="literal">
FIXED
</code>
</a>
synonym is available
for compatibility with other database systems.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214213584">
</a>
<a class="indexterm" name="idm46045214212512">
</a>
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT[(
<em class="replaceable">
<code>
M
</code>
</em>
,
<em class="replaceable">
<code>
D
</code>
</em>
)]
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
A small (single-precision) floating-point number.
Permissible values are
<code class="literal">
-3.402823466E+38
</code>
to
<code class="literal">
-1.175494351E-38
</code>
,
<code class="literal">
0
</code>
, and
<code class="literal">
1.175494351E-38
</code>
to
<code class="literal">
3.402823466E+38
</code>
. These are the
theoretical limits, based on the IEEE standard. The actual
range might be slightly smaller depending on your hardware
or operating system.
</p>
<p>
<em class="replaceable">
<code>
M
</code>
</em>
is the total number of digits
and
<em class="replaceable">
<code>
D
</code>
</em>
is the number of digits
following the decimal point. If
<em class="replaceable">
<code>
M
</code>
</em>
and
<em class="replaceable">
<code>
D
</code>
</em>
are omitted, values are
stored to the limits permitted by the hardware. A
single-precision floating-point number is accurate to
approximately 7 decimal places.
</p>
<p>
<code class="literal">
FLOAT(
<em class="replaceable">
<code>
M
</code>
</em>
,
<em class="replaceable">
<code>
D
</code>
</em>
)
</code>
is a nonstandard MySQL extension. This syntax is deprecated,
and you should expect support for it to be removed in a
future version of MySQL.
</p>
<p>
<code class="literal">
UNSIGNED
</code>
, if specified, disallows
negative values. The
<code class="literal">
UNSIGNED
</code>
attribute
is deprecated for columns of type
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT
</code>
</a>
(and any synonyms) and
you should expect support for it to be removed in a future
version of MySQL. Consider using a simple
<code class="literal">
CHECK
</code>
constraint instead for such
columns.
</p>
<p>
Using
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT
</code>
</a>
might give you
some unexpected problems because all calculations in MySQL
are done with double precision. See
<a class="xref" href="no-matching-rows.html" title="B.3.4.7 Solving Problems with No Matching Rows">
Section B.3.4.7, “Solving Problems with No Matching Rows”
</a>
.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214192400">
</a>
<a class="indexterm" name="idm46045214191328">
</a>
<a class="indexterm" name="idm46045214190256">
</a>
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT(
<em class="replaceable">
<code>
p
</code>
</em>
)
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
A floating-point number.
<em class="replaceable">
<code>
p
</code>
</em>
represents the precision in bits, but MySQL uses this value
only to determine whether to use
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT
</code>
</a>
or
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
for the resulting data
type. If
<em class="replaceable">
<code>
p
</code>
</em>
is from 0 to 24, the
data type becomes
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT
</code>
</a>
with
no
<em class="replaceable">
<code>
M
</code>
</em>
or
<em class="replaceable">
<code>
D
</code>
</em>
values. If
<em class="replaceable">
<code>
p
</code>
</em>
is from 25 to 53, the data type
becomes
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
with no
<em class="replaceable">
<code>
M
</code>
</em>
or
<em class="replaceable">
<code>
D
</code>
</em>
values. The range of the resulting column is the same as for
the single-precision
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT
</code>
</a>
or
double-precision
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
data
types described earlier in this section.
</p>
<p>
<code class="literal">
UNSIGNED
</code>
, if specified, disallows
negative values. The
<code class="literal">
UNSIGNED
</code>
attribute
is deprecated for columns of type
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT
</code>
</a>
(and any synonyms) and
you should expect support for it to be removed in a future
version of MySQL. Consider using a simple
<code class="literal">
CHECK
</code>
constraint instead for such
columns.
</p>
<p>
<a class="indexterm" name="idm46045214171568">
</a>
<a class="indexterm" name="idm46045214170496">
</a>
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT(
<em class="replaceable">
<code>
p
</code>
</em>
)
</code>
</a>
syntax is provided for ODBC compatibility.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214164512">
</a>
<a class="indexterm" name="idm46045214163440">
</a>
<a class="indexterm" name="idm46045214162368">
</a>
<a class="indexterm" name="idm46045214160880">
</a>
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE[(
<em class="replaceable">
<code>
M
</code>
</em>
,
<em class="replaceable">
<code>
D
</code>
</em>
)]
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
A normal-size (double-precision) floating-point number.
Permissible values are
<code class="literal">
-1.7976931348623157E+308
</code>
to
<code class="literal">
-2.2250738585072014E-308
</code>
,
<code class="literal">
0
</code>
, and
<code class="literal">
2.2250738585072014E-308
</code>
to
<code class="literal">
1.7976931348623157E+308
</code>
. These are the
theoretical limits, based on the IEEE standard. The actual
range might be slightly smaller depending on your hardware
or operating system.
</p>
<p>
<em class="replaceable">
<code>
M
</code>
</em>
is the total number of digits
and
<em class="replaceable">
<code>
D
</code>
</em>
is the number of digits
following the decimal point. If
<em class="replaceable">
<code>
M
</code>
</em>
and
<em class="replaceable">
<code>
D
</code>
</em>
are omitted, values are
stored to the limits permitted by the hardware. A
double-precision floating-point number is accurate to
approximately 15 decimal places.
</p>
<p>
<code class="literal">
DOUBLE(
<em class="replaceable">
<code>
M
</code>
</em>
,
<em class="replaceable">
<code>
D
</code>
</em>
)
</code>
is a nonstandard MySQL extension; and is deprecated. You
should expect support for this syntax to be removed in a
future version of MySQL.
</p>
<p>
<code class="literal">
UNSIGNED
</code>
, if specified, disallows
negative values. The
<code class="literal">
UNSIGNED
</code>
attribute
is deprecated for columns of type
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
(and any synonyms) and
you should expect support for it to be removed in a future
version of MySQL. Consider using a simple
<code class="literal">
CHECK
</code>
constraint instead for such
columns.
</p>
</li>
<li class="listitem">
<p>
<a class="indexterm" name="idm46045214142016">
</a>
<a class="indexterm" name="idm46045214140928">
</a>
<a class="indexterm" name="idm46045214139856">
</a>
<a class="indexterm" name="idm46045214138368">
</a>
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
PRECISION[(
<em class="replaceable">
<code>
M
</code>
</em>
,
<em class="replaceable">
<code>
D
</code>
</em>
)]
[UNSIGNED] [ZEROFILL]
</code>
</a>
,
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
REAL[(
<em class="replaceable">
<code>
M
</code>
</em>
,
<em class="replaceable">
<code>
D
</code>
</em>
)]
[UNSIGNED] [ZEROFILL]
</code>
</a>
</p>
<p>
These types are synonyms for
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
. Exception: If the
<a class="link" href="sql-mode.html#sqlmode_real_as_float">
<code class="literal">
REAL_AS_FLOAT
</code>
</a>
SQL mode is
enabled,
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
REAL
</code>
</a>
is a synonym
for
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
FLOAT
</code>
</a>
rather than
<a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
<code class="literal">
DOUBLE
</code>
</a>
.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/events-privileges.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="events-privileges">
</a>
27.4.6 The Event Scheduler and MySQL Privileges
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045082022400">
</a>
<p>
To enable or disable the execution of scheduled events, it is
necessary to set the value of the global
<a class="link" href="server-system-variables.html#sysvar_event_scheduler">
<code class="literal">
event_scheduler
</code>
</a>
system variable.
This requires privileges sufficient to set global 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>
The
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privilege governs the
creation, modification, and deletion of events. This privilege can
be bestowed using
<a class="link" href="grant.html" title="15.7.1.6 GRANT Statement">
<code class="literal">
GRANT
</code>
</a>
. For
example, this
<a class="link" href="grant.html" title="15.7.1.6 GRANT Statement">
<code class="literal">
GRANT
</code>
</a>
statement
confers the
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privilege for the
schema named
<code class="literal">
myschema
</code>
on the user
<code class="literal">
jon@ghidora
</code>
:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa76633857"><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">GRANT</span> <span class="token keyword">EVENT</span> <span class="token keyword">ON</span> myschema<span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> jon<span class="token variable">@ghidora</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
(We assume that this user account already exists, and that we wish
for it to remain unchanged otherwise.)
</p>
<p>
To grant this same user the
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privilege on all schemas, use the following statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa73446477"><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">GRANT</span> <span class="token keyword">EVENT</span> <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> jon<span class="token variable">@ghidora</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privilege has global or
schema-level scope. Therefore, trying to grant it on a single
table results in an error as shown:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa21357040"><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></span> <span class="token keyword">GRANT</span> <span class="token keyword">EVENT</span> <span class="token keyword">ON</span> myschema<span class="token punctuation">.</span>mytable <span class="token keyword">TO</span> jon<span class="token variable">@ghidora</span><span class="token punctuation">;</span>
<span class="token output">ERROR 1144 (42000)<span class="token punctuation">:</span> Illegal GRANT/REVOKE command; please
consult the manual to see which privileges can be used</span></code></pre>
</div>
<p>
It is important to understand that an event is executed with the
privileges of its definer, and that it cannot perform any actions
for which its definer does not have the requisite privileges. For
example, suppose that
<code class="literal">
jon@ghidora
</code>
has the
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privilege for
<code class="literal">
myschema
</code>
. Suppose also that this user has the
<a class="link" href="privileges-provided.html#priv_select">
<code class="literal">
SELECT
</code>
</a>
privilege for
<code class="literal">
myschema
</code>
, but no other privileges for this
schema. It is possible for
<code class="literal">
jon@ghidora
</code>
to
create a new event such as this one:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa49575269"><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">CREATE</span> <span class="token keyword">EVENT</span> e_store_ts
<span class="token keyword">ON</span> <span class="token keyword">SCHEDULE</span>
<span class="token keyword">EVERY</span> <span class="token number">10</span> <span class="token keyword">SECOND</span>
<span class="token keyword">DO</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> myschema<span class="token punctuation">.</span>mytable <span class="token keyword">VALUES</span> <span class="token punctuation">(</span><span class="token function">UNIX_TIMESTAMP</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
The user waits for a minute or so, and then performs a
<code class="literal">
SELECT * FROM mytable;
</code>
query, expecting to see
several new rows in the table. Instead, the table is empty. Since
the user does not have the
<a class="link" href="privileges-provided.html#priv_insert">
<code class="literal">
INSERT
</code>
</a>
privilege for the table in question, the event has no effect.
</p>
<p>
If you inspect the MySQL error log
(
<code class="filename">
<em class="replaceable">
<code>
hostname
</code>
</em>
.err
</code>
),
you can see that the event is executing, but the action it is
attempting to perform fails:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-none"><div class="docs-select-all right" id="sa22181636"><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-none">2013-09-24T12:41:31.261992Z 25 [ERROR] Event Scheduler:
[jon@ghidora][cookbook.e_store_ts] INSERT command denied to user
'jon'@'ghidora' for table 'mytable'
2013-09-24T12:41:31.262022Z 25 [Note] Event Scheduler:
[jon@ghidora].[myschema.e_store_ts] event execution failed.
2013-09-24T12:41:41.271796Z 26 [ERROR] Event Scheduler:
[jon@ghidora][cookbook.e_store_ts] INSERT command denied to user
'jon'@'ghidora' for table 'mytable'
2013-09-24T12:41:41.272761Z 26 [Note] Event Scheduler:
[jon@ghidora].[myschema.e_store_ts] event execution failed.</code></pre>
</div>
<p>
Since this user very likely does not have access to the error log,
it is possible to verify whether the event's action statement is
valid by executing it directly:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa14230531"><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></span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> myschema<span class="token punctuation">.</span>mytable <span class="token keyword">VALUES</span> <span class="token punctuation">(</span><span class="token function">UNIX_TIMESTAMP</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output">ERROR 1142 (42000)<span class="token punctuation">:</span> INSERT command denied to user
'jon'@'ghidora' for table 'mytable'</span></code></pre>
</div>
<a class="indexterm" name="idm46045081987888">
</a>
<p>
Inspection of the Information Schema
<a class="link" href="information-schema-events-table.html" title="28.3.14 The INFORMATION_SCHEMA EVENTS Table">
<code class="literal">
EVENTS
</code>
</a>
table shows that
<code class="literal">
e_store_ts
</code>
exists and is enabled, but its
<code class="literal">
LAST_EXECUTED
</code>
column is
<code class="literal">
NULL
</code>
:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa56091578"><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></span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span><span class="token keyword">EVENTS</span>
<span class="token operator">></span> <span class="token keyword">WHERE</span> EVENT_NAME<span class="token operator">=</span><span class="token string">'e_store_ts'</span>
<span class="token operator">></span> <span class="token operator">AND</span> EVENT_SCHEMA<span class="token operator">=</span><span class="token string">'myschema'</span>\G
<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> 1. row <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>
EVENT_CATALOG<span class="token punctuation">:</span> NULL
EVENT_SCHEMA<span class="token punctuation">:</span> myschema
EVENT_NAME<span class="token punctuation">:</span> e_store_ts
DEFINER<span class="token punctuation">:</span> jon@ghidora
EVENT_BODY<span class="token punctuation">:</span> SQL
EVENT_DEFINITION<span class="token punctuation">:</span> INSERT INTO myschema.mytable VALUES (UNIX_TIMESTAMP())
EVENT_TYPE<span class="token punctuation">:</span> RECURRING
EXECUTE_AT<span class="token punctuation">:</span> NULL
INTERVAL_VALUE<span class="token punctuation">:</span> 5
INTERVAL_FIELD<span class="token punctuation">:</span> SECOND
SQL_MODE<span class="token punctuation">:</span> NULL
STARTS<span class="token punctuation">:</span> 0000-00-00 00<span class="token punctuation">:</span>00<span class="token punctuation">:</span>00
ENDS<span class="token punctuation">:</span> 0000-00-00 00<span class="token punctuation">:</span>00<span class="token punctuation">:</span>00
STATUS<span class="token punctuation">:</span> ENABLED
ON_COMPLETION<span class="token punctuation">:</span> NOT PRESERVE
CREATED<span class="token punctuation">:</span> 2006-02-09 22<span class="token punctuation">:</span>36<span class="token punctuation">:</span>06
LAST_ALTERED<span class="token punctuation">:</span> 2006-02-09 22<span class="token punctuation">:</span>36<span class="token punctuation">:</span>06
LAST_EXECUTED<span class="token punctuation">:</span> NULL
EVENT_COMMENT<span class="token punctuation">:</span>
</span><span class="token output">1 row in set (0.00 sec)</span></code></pre>
</div>
<p>
To rescind the
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privilege, use
the
<a class="link" href="revoke.html" title="15.7.1.8 REVOKE Statement">
<code class="literal">
REVOKE
</code>
</a>
statement. In this
example, the
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privilege on the
schema
<code class="literal">
myschema
</code>
is removed from the
<code class="literal">
jon@ghidora
</code>
user account:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa90353445"><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">REVOKE</span> <span class="token keyword">EVENT</span> <span class="token keyword">ON</span> myschema<span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">FROM</span> jon<span class="token variable">@ghidora</span><span class="token punctuation">;</span></code></pre>
</div>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
Revoking the
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privilege from
a user does not delete or disable any events that may have been
created by that user.
</p>
<p>
An event is not migrated or dropped as a result of renaming or
dropping the user who created it.
</p>
</div>
<p>
Suppose that the user
<code class="literal">
jon@ghidora
</code>
has been
granted the
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
and
<a class="link" href="privileges-provided.html#priv_insert">
<code class="literal">
INSERT
</code>
</a>
privileges on the
<code class="literal">
myschema
</code>
schema. This user then creates the
following event:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa31259993"><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">CREATE</span> <span class="token keyword">EVENT</span> e_insert
<span class="token keyword">ON</span> <span class="token keyword">SCHEDULE</span>
<span class="token keyword">EVERY</span> <span class="token number">7</span> <span class="token keyword">SECOND</span>
<span class="token keyword">DO</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> myschema<span class="token punctuation">.</span>mytable<span class="token punctuation">;</span></code></pre>
</div>
<p>
After this event has been created,
<code class="literal">
root
</code>
revokes
the
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privilege for
<code class="literal">
jon@ghidora
</code>
. However,
<code class="literal">
e_insert
</code>
continues to execute, inserting a new
row into
<code class="literal">
mytable
</code>
each seven seconds. The same
would be true if
<code class="literal">
root
</code>
had issued either of
these statements:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
DROP USER jon@ghidora;
</code>
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
RENAME USER jon@ghidora TO
someotherguy@ghidora;
</code>
</p>
</li>
</ul>
</div>
<p>
You can verify that this is true by examining the Information
Schema
<a class="link" href="information-schema-events-table.html" title="28.3.14 The INFORMATION_SCHEMA EVENTS Table">
<code class="literal">
EVENTS
</code>
</a>
table before and after
issuing a
<a class="link" href="drop-user.html" title="15.7.1.5 DROP USER Statement">
<code class="literal">
DROP USER
</code>
</a>
or
<a class="link" href="rename-user.html" title="15.7.1.7 RENAME USER Statement">
<code class="literal">
RENAME USER
</code>
</a>
statement.
</p>
<p>
Event definitions are stored in the data dictionary. To drop an
event created by another user account, you must be the MySQL
<code class="literal">
root
</code>
user or another user with the necessary
privileges.
</p>
<p>
Users'
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privileges are stored
in the
<code class="literal">
Event_priv
</code>
columns of the
<code class="literal">
mysql.user
</code>
and
<code class="literal">
mysql.db
</code>
tables. In both cases, this column holds one of the values
'
<code class="literal">
Y
</code>
' or '
<code class="literal">
N
</code>
'.
'
<code class="literal">
N
</code>
' is the default.
<code class="literal">
mysql.user.Event_priv
</code>
is set to
'
<code class="literal">
Y
</code>
' for a given user only if that user has the
global
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privilege (that is, if
the privilege was bestowed using
<code class="literal">
GRANT EVENT ON
*.*
</code>
). For a schema-level
<a class="link" href="privileges-provided.html#priv_event">
<code class="literal">
EVENT
</code>
</a>
privilege,
<a class="link" href="grant.html" title="15.7.1.6 GRANT Statement">
<code class="literal">
GRANT
</code>
</a>
creates a row in
<code class="literal">
mysql.db
</code>
and sets that row's
<code class="literal">
Db
</code>
column to the name of the schema, the
<code class="literal">
User
</code>
column to the name of the user, and the
<code class="literal">
Event_priv
</code>
column to '
<code class="literal">
Y
</code>
'.
There should never be any need to manipulate these tables
directly, since the
<a class="link" href="grant.html" title="15.7.1.6 GRANT Statement">
<code class="literal">
GRANT
EVENT
</code>
</a>
and
<code class="literal">
REVOKE EVENT
</code>
statements
perform the required operations on them.
</p>
<a class="indexterm" name="idm46045081932128">
</a>
<p>
Five status variables provide counts of event-related operations
(but
<span class="emphasis">
<em>
not
</em>
</span>
of statements executed by events;
see
<a class="xref" href="stored-program-restrictions.html" title="27.8 Restrictions on Stored Programs">
Section 27.8, “Restrictions on Stored Programs”
</a>
). These are:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<code class="literal">
Com_create_event
</code>
: The number of
<a class="link" href="create-event.html" title="15.1.13 CREATE EVENT Statement">
<code class="literal">
CREATE EVENT
</code>
</a>
statements
executed since the last server restart.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
Com_alter_event
</code>
: The number of
<a class="link" href="alter-event.html" title="15.1.3 ALTER EVENT Statement">
<code class="literal">
ALTER EVENT
</code>
</a>
statements executed
since the last server restart.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
Com_drop_event
</code>
: The number of
<a class="link" href="drop-event.html" title="15.1.25 DROP EVENT Statement">
<code class="literal">
DROP EVENT
</code>
</a>
statements executed
since the last server restart.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
Com_show_create_event
</code>
: The number of
<a class="link" href="show-create-event.html" title="15.7.7.8 SHOW CREATE EVENT Statement">
<code class="literal">
SHOW CREATE EVENT
</code>
</a>
statements
executed since the last server restart.
</p>
</li>
<li class="listitem">
<p>
<code class="literal">
Com_show_events
</code>
: The number of
<a class="link" href="show-events.html" title="15.7.7.19 SHOW EVENTS Statement">
<code class="literal">
SHOW EVENTS
</code>
</a>
statements executed
since the last server restart.
</p>
</li>
</ul>
</div>
<p>
You can view current values for all of these at one time by
running the statement
<code class="literal">
SHOW STATUS LIKE
'%event%';
</code>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/obtaining-plugin-information.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="obtaining-plugin-information">
</a>
7.6.2 Obtaining Server Plugin Information
</h3>
</div>
</div>
</div>
<p>
There are several ways to determine which plugins are installed in
the server:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
The Information Schema
<a class="link" href="information-schema-plugins-table.html" title="28.3.22 The INFORMATION_SCHEMA PLUGINS Table">
<code class="literal">
PLUGINS
</code>
</a>
table contains a row for each loaded plugin. Any that have a
<code class="literal">
PLUGIN_LIBRARY
</code>
value of
<code class="literal">
NULL
</code>
are built in and cannot be unloaded.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa47411071"><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></span> <span class="token keyword">TABLE</span> INFORMATION_SCHEMA<span class="token punctuation">.</span><span class="token keyword">PLUGINS</span>\G
<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> 1. row <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>
PLUGIN_NAME<span class="token punctuation">:</span> binlog
PLUGIN_VERSION<span class="token punctuation">:</span> 1.0
PLUGIN_STATUS<span class="token punctuation">:</span> ACTIVE
PLUGIN_TYPE<span class="token punctuation">:</span> STORAGE ENGINE
PLUGIN_TYPE_VERSION<span class="token punctuation">:</span> 80100.0
PLUGIN_LIBRARY<span class="token punctuation">:</span> NULL
PLUGIN_LIBRARY_VERSION<span class="token punctuation">:</span> NULL
PLUGIN_AUTHOR<span class="token punctuation">:</span> Oracle Corporation
PLUGIN_DESCRIPTION<span class="token punctuation">:</span> This is a pseudo storage engine to represent the binlog in a transaction
PLUGIN_LICENSE<span class="token punctuation">:</span> GPL
LOAD_OPTION<span class="token punctuation">:</span> FORCE
<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> 2. row <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>
PLUGIN_NAME<span class="token punctuation">:</span> mysql_native_password
PLUGIN_VERSION<span class="token punctuation">:</span> 1.1
PLUGIN_STATUS<span class="token punctuation">:</span> ACTIVE
PLUGIN_TYPE<span class="token punctuation">:</span> AUTHENTICATION
PLUGIN_TYPE_VERSION<span class="token punctuation">:</span> 2.1
PLUGIN_LIBRARY<span class="token punctuation">:</span> NULL
PLUGIN_LIBRARY_VERSION<span class="token punctuation">:</span> NULL
PLUGIN_AUTHOR<span class="token punctuation">:</span> Oracle Corporation
PLUGIN_DESCRIPTION<span class="token punctuation">:</span> Native MySQL authentication
PLUGIN_LICENSE<span class="token punctuation">:</span> GPL
LOAD_OPTION<span class="token punctuation">:</span> FORCE
...</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
The
<a class="link" href="show-plugins.html" title="15.7.7.27 SHOW PLUGINS Statement">
<code class="literal">
SHOW PLUGINS
</code>
</a>
statement
displays a row for each loaded plugin. Any that have a
<code class="literal">
Library
</code>
value of
<code class="literal">
NULL
</code>
are built in and cannot be unloaded.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa70155288"><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></span> <span class="token keyword">SHOW</span> <span class="token keyword">PLUGINS</span>\G
<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> 1. row <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>
Name<span class="token punctuation">:</span> binlog
Status<span class="token punctuation">:</span> ACTIVE
Type<span class="token punctuation">:</span> STORAGE ENGINE
Library<span class="token punctuation">:</span> NULL
License<span class="token punctuation">:</span> GPL
<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> 2. row <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>
Name<span class="token punctuation">:</span> mysql_native_password
Status<span class="token punctuation">:</span> ACTIVE
Type<span class="token punctuation">:</span> AUTHENTICATION
Library<span class="token punctuation">:</span> NULL
License<span class="token punctuation">:</span> GPL
...</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
The
<code class="literal">
mysql.plugin
</code>
table shows which plugins
have been registered with
<a class="link" href="install-plugin.html" title="15.7.4.4 INSTALL PLUGIN Statement">
<code class="literal">
INSTALL
PLUGIN
</code>
</a>
. The table contains only plugin names and
library file names, so it does not provide as much information
as the
<a class="link" href="information-schema-plugins-table.html" title="28.3.22 The INFORMATION_SCHEMA PLUGINS Table">
<code class="literal">
PLUGINS
</code>
</a>
table or the
<a class="link" href="show-plugins.html" title="15.7.7.27 SHOW PLUGINS Statement">
<code class="literal">
SHOW PLUGINS
</code>
</a>
statement.
</p>
</li>
</ul>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/group-replication-secure-user.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="group-replication-secure-user">
</a>
20.6.3.1 Secure User Credentials for Distributed Recovery
</h4>
</div>
</div>
</div>
<p>
State transfer from the binary log requires a replication user
with the correct permissions so that Group Replication can
establish direct member-to-member replication channels. The same
replication user is used for distributed recovery on all the
group members. If group members have been set up to support the
use of a remote cloning operation as part of distributed
recovery, this replication user is also used as the clone user
on the donor, and requires the correct permissions for this
role. For detailed instructions to set up this user, see
<a class="xref" href="group-replication-user-credentials.html" title="20.2.1.3 User Credentials For Distributed Recovery">
Section 20.2.1.3, “User Credentials For Distributed Recovery”
</a>
.
</p>
<p>
To secure the user credentials, you can require SSL for
connections with the user account, and provide the user
credentials when Group Replication is started, rather than
storing them in the replica status tables. Also, if you are
using caching SHA-2 authentication, you must set up RSA
key-pairs on the group members.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
When using the MySQL communication stack
(
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_communication_stack">
<code class="literal">
group_replication_communication_stack=MYSQL
</code>
</a>
)
AND secure connections between members
(
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_ssl_mode">
<code class="literal">
group_replication_ssl_mode
</code>
</a>
is not set to
<code class="literal">
DISABLED
</code>
), the recovery users
must be properly set up, as they are also the users for group
communications. Follow the instructions in
<a class="xref" href="group-replication-secure-user.html#group-replication-secure-user-ssl" title="20.6.3.1.2 Replication User With SSL">
Section 20.6.3.1.2, “Replication User With SSL”
</a>
and
<a class="xref" href="group-replication-secure-user.html#group-replication-secure-user-provide" title="20.6.3.1.3 Providing Replication User Credentials Securely">
Section 20.6.3.1.3, “Providing Replication User Credentials Securely”
</a>
.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="group-replication-caching-sha2-user-credentials">
</a>
20.6.3.1.1 Replication User With The Caching SHA-2 Authentication Plugin
</h5>
</div>
</div>
</div>
<p>
By default, users created in MySQL 8 use
<a class="xref" href="caching-sha2-pluggable-authentication.html" title="8.4.1.2 Caching SHA-2 Pluggable Authentication">
Section 8.4.1.2, “Caching SHA-2 Pluggable Authentication”
</a>
. If
the replication user you configure for distributed recovery
uses the caching SHA-2 authentication plugin, and you are
<span class="emphasis">
<em>
not
</em>
</span>
using SSL for distributed recovery
connections, RSA key-pairs are used for password exchange. For
more information on RSA key-pairs, see
<a class="xref" href="creating-ssl-rsa-files.html" title="8.3.3 Creating SSL and RSA Certificates and Keys">
Section 8.3.3, “Creating SSL and RSA Certificates and Keys”
</a>
.
</p>
<p>
In this situation, you can either copy the public key of the
<code class="literal">
rpl_user
</code>
to the joining member, or
configure the donors to provide the public key when requested.
The more secure approach is to copy the public key of the
replication user account to the joining member. Then you need
to configure the
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_recovery_public_key_path">
<code class="literal">
group_replication_recovery_public_key_path
</code>
</a>
system variable on the joining member with the path to the
public key for the replication user account.
</p>
<p>
The less secure approach is to set
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_recovery_get_public_key">
<code class="literal">
group_replication_recovery_get_public_key=ON
</code>
</a>
on donors so that they provide the public key of the
replication user account to joining members. There is no way
to verify the identity of a server, therefore only set
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_recovery_get_public_key">
<code class="literal">
group_replication_recovery_get_public_key=ON
</code>
</a>
when you are sure there is no risk of server identity being
compromised, for example by a man-in-the-middle attack.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="group-replication-secure-user-ssl">
</a>
20.6.3.1.2 Replication User With SSL
</h5>
</div>
</div>
</div>
<p>
A replication user that requires an SSL connection must be
created
<span class="emphasis">
<em>
before
</em>
</span>
the server joining the
group (the joining member) connects to the donor. Typically,
this is set up at the time you are provisioning a server to
join the group. To create a replication user for distributed
recovery that requires an SSL connection, issue these
statements on all servers that are going to participate in the
group:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa62204726"><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></span> <span class="token keyword">SET</span> SQL_LOG_BIN<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">CREATE</span> <span class="token keyword">USER</span> <span class="token string">'<em class="replaceable">rec_ssl_user</em>'</span>@<span class="token string">'%'</span> <span class="token keyword">IDENTIFIED</span> <span class="token keyword">BY</span> <span class="token string">'<em class="replaceable">password</em>'</span> <span class="token keyword">REQUIRE</span> <span class="token keyword">SSL</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">GRANT</span> <span class="token keyword">REPLICATION</span> <span class="token keyword">SLAVE</span> <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <span class="token string">'<em class="replaceable">rec_ssl_user</em>'</span>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">GRANT</span> CONNECTION_ADMIN <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <span class="token string">'<em class="replaceable">rec_ssl_user</em>'</span>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">GRANT</span> BACKUP_ADMIN <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <span class="token string">'<em class="replaceable">rec_ssl_user</em>'</span>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">GRANT</span> GROUP_REPLICATION_STREAM <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <em class="replaceable">rec_ssl_user</em>@<span class="token string">'%'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">FLUSH</span> <span class="token keyword">PRIVILEGES</span><span class="token punctuation">;</span>
<span class="token prompt">mysql></span> <span class="token keyword">SET</span> SQL_LOG_BIN<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span></code></pre>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
The
<a class="link" href="privileges-provided.html#priv_group-replication-stream">
<code class="literal">
GROUP_REPLICATION_STREAM
</code>
</a>
privilege is required when using both the MySQL
communication stack
(
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_communication_stack">
<code class="literal">
group_replication_communication_stack=MYSQL
</code>
</a>
)
and secure connections between members
(
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_ssl_mode">
<code class="literal">
group_replication_ssl_mode
</code>
</a>
not set to
<code class="literal">
DISABLED
</code>
). See
<a class="xref" href="group-replication-connection-security.html" title="20.6.1 Communication Stack for Connection Security Management">
Section 20.6.1, “Communication Stack for Connection Security Management”
</a>
.
</p>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="group-replication-secure-user-provide">
</a>
20.6.3.1.3 Providing Replication User Credentials Securely
</h5>
</div>
</div>
</div>
<p>
To supply the user credentials for the replication user, you
can set them permanently as the credentials for the
<code class="literal">
group_replication_recovery
</code>
channel, using a
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE TO
</code>
</a>
statement. Alternatively, you can specify them in the
<a class="link" href="start-group-replication.html" title="15.4.3.1 START GROUP_REPLICATION Statement">
<code class="literal">
START GROUP_REPLICATION
</code>
</a>
statement each time Group Replication is started. User
credentials specified in
<a class="link" href="start-group-replication.html" title="15.4.3.1 START GROUP_REPLICATION Statement">
<code class="literal">
START
GROUP_REPLICATION
</code>
</a>
take precedence over any user
credentials that have been set using a
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE TO
</code>
</a>
statement.
</p>
<p>
User credentials set using
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE
REPLICATION SOURCE TO
</code>
</a>
are stored in plain text in
the replication metadata repositories on the server, but user
credentials specified on
<a class="link" href="start-group-replication.html" title="15.4.3.1 START GROUP_REPLICATION Statement">
<code class="literal">
START
GROUP_REPLICATION
</code>
</a>
are saved in memory only, and are
removed by a
<a class="link" href="stop-group-replication.html" title="15.4.3.2 STOP GROUP_REPLICATION Statement">
<code class="literal">
STOP
GROUP_REPLICATION
</code>
</a>
statement or server shutdown.
Using
<a class="link" href="start-group-replication.html" title="15.4.3.1 START GROUP_REPLICATION Statement">
<code class="literal">
START GROUP_REPLICATION
</code>
</a>
to specify the user credentials therefore helps to secure the
Group Replication servers against unauthorized access.
However, this method is not compatible with starting Group
Replication automatically, as specified by the
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_start_on_boot">
<code class="literal">
group_replication_start_on_boot
</code>
</a>
system variable.
</p>
<p>
If you want to set the user credentials permanently using a
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE TO
</code>
</a>
statement, issue this statement on the member that is going to
join the group:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa26194437"><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></span> <span class="token keyword">CHANGE</span> <span class="token keyword">REPLICATION</span> <span class="token keyword">SOURCE</span> <span class="token keyword">TO</span> <span class="token keyword">SOURCE_USER</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">rec_ssl_user</em>'</span><span class="token punctuation">,</span>
<span class="token prompt"> -></span> <span class="token keyword">SOURCE_PASSWORD</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">password</em>'</span>
<span class="token prompt"> -></span> <span class="token keyword">FOR</span> <span class="token keyword">CHANNEL</span> <span class="token string">'group_replication_recovery'</span><span class="token punctuation">;</span></code></pre>
</div>
<p>
To supply the user credentials on
<a class="link" href="start-group-replication.html" title="15.4.3.1 START GROUP_REPLICATION Statement">
<code class="literal">
START
GROUP_REPLICATION
</code>
</a>
, issue this statement when
starting Group Replication for the first time, or after a
server restart:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa25516935"><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></span> <span class="token keyword">START</span> <span class="token keyword">GROUP_REPLICATION</span> <span class="token keyword">USER</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">rec_ssl_user</em>'</span><span class="token punctuation">,</span> <span class="token keyword">PASSWORD</span><span class="token operator">=</span><span class="token string">'<em class="replaceable">password</em>'</span><span class="token punctuation">;</span></code></pre>
</div>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
If you switch to using
<a class="link" href="start-group-replication.html" title="15.4.3.1 START GROUP_REPLICATION Statement">
<code class="literal">
START
GROUP_REPLICATION
</code>
</a>
to specify user credentials on a
server that previously supplied the credentials using
<a class="link" href="change-replication-source-to.html" title="15.4.2.2 CHANGE REPLICATION SOURCE TO Statement">
<code class="literal">
CHANGE REPLICATION SOURCE TO
</code>
</a>
,
you must complete the following steps to get the security
benefits of this change.
</p>
</div>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Stop Group Replication on the group member using a
<a class="link" href="stop-group-replication.html" title="15.4.3.2 STOP GROUP_REPLICATION Statement">
<code class="literal">
STOP GROUP_REPLICATION
</code>
</a>
statement. Although it is possible to take the following
two steps while Group Replication is running, you need to
restart Group Replication to implement the changes.
</p>
</li>
<li class="listitem">
<p>
Set the value of the
<a class="link" href="group-replication-system-variables.html#sysvar_group_replication_start_on_boot">
<code class="literal">
group_replication_start_on_boot
</code>
</a>
system variable to
<code class="literal">
OFF
</code>
(the default is
<code class="literal">
ON
</code>
).
</p>
</li>
<li class="listitem">
<p>
Remove the distributed recovery credentials from the
replica status tables by issuing this statement:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa87569379"><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></span> <span class="token keyword">CHANGE</span> <span class="token keyword">REPLICATION</span> <span class="token keyword">SOURCE</span> <span class="token keyword">TO</span> <span class="token keyword">SOURCE_USER</span><span class="token operator">=</span><span class="token string">''</span><span class="token punctuation">,</span> <span class="token keyword">SOURCE_PASSWORD</span><span class="token operator">=</span><span class="token string">''</span>
<span class="token prompt"> -></span> <span class="token keyword">FOR</span> <span class="token keyword">CHANNEL</span> <span class="token string">'group_replication_recovery'</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Restart Group Replication on the group member using a
<a class="link" href="start-group-replication.html" title="15.4.3.1 START GROUP_REPLICATION Statement">
<code class="literal">
START GROUP_REPLICATION
</code>
</a>
statement that specifies the distributed recovery user
credentials.
</p>
</li>
</ol>
</div>
<p>
Without these steps, the credentials remain stored in the
replica status tables, and can also be transferred to other
group members during remote cloning operations for distributed
recovery. The
<code class="literal">
group_replication_recovery
</code>
channel could then be inadvertently started with the stored
credentials, on either the original member or members that
were cloned from it. An automatic start of Group Replication
on server boot (including after a remote cloning operation)
would use the stored user credentials, and they would also be
used if an operator did not specify the distributed recovery
credentials as part of
<a class="link" href="start-group-replication.html" title="15.4.3.1 START GROUP_REPLICATION Statement">
<code class="literal">
START
GROUP_REPLICATION
</code>
</a>
.
</p>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/innodb-system-tablespace.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="innodb-system-tablespace">
</a>
17.6.3.1 The System Tablespace
</h4>
</div>
</div>
</div>
<p>
The system tablespace is the storage area for the change buffer.
It may also contain table and index data if tables are created in
the system tablespace rather than file-per-table or general
tablespaces.
</p>
<p>
The system tablespace can have one or more data files. By default,
a single system tablespace data file, named
<code class="filename">
ibdata1
</code>
, is created in the data directory.
The size and number of system tablespace data files is defined by
the
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
<code class="literal">
innodb_data_file_path
</code>
</a>
startup
option. For configuration information, see
<a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-data-file-configuration" title="System Tablespace Data File Configuration">
System Tablespace Data File Configuration
</a>
.
</p>
<p>
Additional information about the system tablespace is provided
under the following topics in the section:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
<a class="xref" href="innodb-system-tablespace.html#innodb-resize-system-tablespace" title="Resizing the System Tablespace">
Resizing the System Tablespace
</a>
</p>
</li>
<li class="listitem">
<p>
<a class="xref" href="innodb-system-tablespace.html#innodb-raw-devices" title="Using Raw Disk Partitions for the System Tablespace">
Using Raw Disk Partitions for the System Tablespace
</a>
</p>
</li>
</ul>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="innodb-resize-system-tablespace">
</a>
Resizing the System Tablespace
</h5>
</div>
</div>
</div>
<a class="indexterm" name="idm46045165573792">
</a>
<p>
This section describes how to increase or decrease the size of
the system tablespace.
</p>
<h6>
<a name="idm46045165571824">
</a>
Increasing the Size of the System Tablespace
</h6>
<p>
The easiest way to increase the size of the system tablespace is
to configure it to be auto-extending. To do so, specify the
<code class="literal">
autoextend
</code>
attribute for the last data file
in the
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
<code class="literal">
innodb_data_file_path
</code>
</a>
setting, and restart the server. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-ini"><div class="docs-select-all right" id="sa61591659"><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 constant">innodb_data_file_path</span><span class="token attr-value"><span class="token punctuation">=</span>ibdata1:10M:autoextend</span></code></pre>
</div>
<p>
When the
<code class="literal">
autoextend
</code>
attribute is specified,
the data file automatically increases in size by 8MB increments
as space is required. The
<a class="link" href="innodb-parameters.html#sysvar_innodb_autoextend_increment">
<code class="literal">
innodb_autoextend_increment
</code>
</a>
variable controls the increment size.
</p>
<p>
You can also increase system tablespace size by adding another
data file. To do so:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Stop the MySQL server.
</p>
</li>
<li class="listitem">
<p>
If the last data file in the
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
<code class="literal">
innodb_data_file_path
</code>
</a>
setting is defined with the
<code class="literal">
autoextend
</code>
attribute, remove it, and modify the size attribute to
reflect the current data file size. To determine the
appropriate data file size to specify, check your file
system for the file size, and round that value down to the
closest MB value, where a MB is equal to 1024 x 1024 bytes.
</p>
</li>
<li class="listitem">
<p>
Append a new data file to the
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
<code class="literal">
innodb_data_file_path
</code>
</a>
setting, optionally specifying the
<code class="literal">
autoextend
</code>
attribute. The
<code class="literal">
autoextend
</code>
attribute can be specified
only for the last data file in the
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
<code class="literal">
innodb_data_file_path
</code>
</a>
setting.
</p>
</li>
<li class="listitem">
<p>
Start the MySQL server.
</p>
</li>
</ol>
</div>
<p>
For example, this tablespace has one auto-extending data file:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-none"><div class="docs-select-all right" id="sa52578199"><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-none">innodb_data_home_dir =
innodb_data_file_path = /ibdata/ibdata1:10M:autoextend</code></pre>
</div>
<p>
Suppose that the data file has grown to 988MB over time. This is
the
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
<code class="literal">
innodb_data_file_path
</code>
</a>
setting after modifying the size attribute to reflect the
current data file size, and after specifying a new 50MB
auto-extending data file:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-none"><div class="docs-select-all right" id="sa29293315"><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-none">innodb_data_home_dir =
innodb_data_file_path = /ibdata/ibdata1:988M;/disk2/ibdata2:50M:autoextend</code></pre>
</div>
<p>
When adding a new data file, do not specify an existing file
name.
<code class="literal">
InnoDB
</code>
creates and initializes the new
data file when you start the server.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
You cannot increase the size of an existing system tablespace
data file by changing its size attribute. For example,
changing the
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
<code class="literal">
innodb_data_file_path
</code>
</a>
setting
from
<code class="literal">
ibdata1:10M:autoextend
</code>
to
<code class="literal">
ibdata1:12M:autoextend
</code>
produces the
following error when starting the server:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-terminal"><div class="docs-select-all right" id="sa84131290"><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 property"><span class="token punctuation">[</span>ERROR<span class="token punctuation">]</span></span> <span class="token punctuation">[</span>MY-012263<span class="token punctuation">]</span> <span class="token punctuation">[</span>InnoDB<span class="token punctuation">]</span> The Auto-extending innodb_system
data file <span class="token atrule">'./ibdata1'</span> is of a different size 640 pages <span class="token punctuation">(</span>rounded down to MB<span class="token punctuation">)</span> than
specified in the <span class="token punctuation">.</span>cnf file<span class="token punctuation">:</span> initial 768 pages<span class="token punctuation">,</span> max 0 <span class="token punctuation">(</span>relevant if non-zero<span class="token punctuation">)</span> pages!</code></pre>
</div>
<p>
The error indicates that the existing data file size
(expressed in
<code class="literal">
InnoDB
</code>
pages) is different
from the data file size specified in the configuration file.
If you encounter this error, restore the previous
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
<code class="literal">
innodb_data_file_path
</code>
</a>
setting, and refer to the system tablespace resizing
instructions.
</p>
</div>
<h6>
<a name="idm46045165540320">
</a>
Decreasing the Size of the InnoDB System Tablespace
</h6>
<p>
Decreasing the size of an existing system tablespace is not
supported. The only option to achieve a smaller system
tablespace is to restore your data from a backup to a new MySQL
instance created with the desired system tablespace size
configuration.
</p>
<p>
For information about creating backups, see
<a class="xref" href="innodb-backup.html" title="17.18.1 InnoDB Backup">
Section 17.18.1, “InnoDB Backup”
</a>
.
</p>
<p>
For information about configuring data files for a new system
tablespace. See
<a class="xref" href="innodb-init-startup-configuration.html#innodb-startup-data-file-configuration" title="System Tablespace Data File Configuration">
System Tablespace Data File Configuration
</a>
.
</p>
<p>
To avoid a large system tablespace, consider using
file-per-table tablespaces or general tablespaces for your data.
File-per-table tablespaces are the default tablespace type and
are used implicitly when creating an
<code class="literal">
InnoDB
</code>
table. Unlike the system tablespace, file-per-table tablespaces
return disk space to the operating system when they are
truncated or dropped. For more information, see
<a class="xref" href="innodb-file-per-table-tablespaces.html" title="17.6.3.2 File-Per-Table Tablespaces">
Section 17.6.3.2, “File-Per-Table Tablespaces”
</a>
. General
tablespaces are multi-table tablespaces that can also be used as
an alternative to the system tablespace. See
<a class="xref" href="general-tablespaces.html" title="17.6.3.3 General Tablespaces">
Section 17.6.3.3, “General Tablespaces”
</a>
.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="innodb-raw-devices">
</a>
Using Raw Disk Partitions for the System Tablespace
</h5>
</div>
</div>
</div>
<a class="indexterm" name="idm46045165532208">
</a>
<a class="indexterm" name="idm46045165530752">
</a>
<p>
Raw disk partitions can be used as system tablespace data files.
This technique enables nonbuffered I/O on Windows and some Linux
and Unix systems without file system overhead. Perform tests
with and without raw partitions to verify whether they improve
performance on your system.
</p>
<p>
When using a raw disk partition, ensure that the user ID that
runs the MySQL server has read and write privileges for that
partition. For example, if running the server as the
<code class="literal">
mysql
</code>
user, the partition must be readable
and writeable by
<code class="literal">
mysql
</code>
. If running the server
with the
<a class="link" href="server-options.html#option_mysqld_memlock">
<code class="option">
--memlock
</code>
</a>
option, the
server must be run as
<code class="literal">
root
</code>
, so the partition
must be readable and writeable by
<code class="literal">
root
</code>
.
</p>
<p>
The procedures described below involve option file modification.
For additional information, see
<a class="xref" href="option-files.html" title="6.2.2.2 Using Option Files">
Section 6.2.2.2, “Using Option Files”
</a>
.
</p>
<h6>
<a name="idm46045165523152">
</a>
Allocating a Raw Disk Partition on Linux and Unix Systems
</h6>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
To use a raw device for a new server instance, first prepare
the configuration file by setting
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
<code class="literal">
innodb_data_file_path
</code>
</a>
with
the
<code class="literal">
raw
</code>
keyword. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-ini"><div class="docs-select-all right" id="sa91974884"><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">innodb_data_home_dir</span><span class="token attr-value"><span class="token punctuation">=</span></span>
<span class="token constant">innodb_data_file_path</span><span class="token attr-value"><span class="token punctuation">=</span>/dev/hdd1:3Graw;/dev/hdd2:2Graw</span></code></pre>
</div>
<p>
The partition must be at least as large as the size that you
specify. Note that 1MB in
<code class="literal">
InnoDB
</code>
is 1024
× 1024 bytes, whereas 1MB in disk specifications
usually means 1,000,000 bytes.
</p>
</li>
<li class="listitem">
<p>
Then initialize the server for the first time by using
<a class="link" href="server-options.html#option_mysqld_initialize">
<code class="option">
--initialize
</code>
</a>
or
<a class="link" href="server-options.html#option_mysqld_initialize-insecure">
<code class="option">
--initialize-insecure
</code>
</a>
. InnoDB
notices the
<code class="literal">
raw
</code>
keyword and initializes
the new partition, and then it stops the server.
</p>
</li>
<li class="listitem">
<p>
Now restart the server.
<code class="literal">
InnoDB
</code>
now
permits changes to be made.
</p>
</li>
</ol>
</div>
<h6>
<a name="idm46045165510896">
</a>
Allocating a Raw Disk Partition on Windows
</h6>
<p>
On Windows systems, the same steps and accompanying guidelines
described for Linux and Unix systems apply except that the
<a class="link" href="innodb-parameters.html#sysvar_innodb_data_file_path">
<code class="literal">
innodb_data_file_path
</code>
</a>
setting
differs slightly on Windows. For example:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-none"><div class="docs-select-all right" id="sa29227001"><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-none">[mysqld]
innodb_data_home_dir=
innodb_data_file_path=//./D::10Graw</code></pre>
</div>
<p>
The
<code class="filename">
//./
</code>
corresponds to the Windows syntax
of
<code class="filename">
\\.\
</code>
for accessing physical drives. In
the example above,
<code class="literal">
D:
</code>
is the drive letter of
the partition.
</p>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/charset-general.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title">
<a name="charset-general">
</a>
12.1 Character Sets and Collations in General
</h2>
</div>
</div>
</div>
<p>
A
<span class="firstterm">
character set
</span>
is a set of
symbols and encodings. A
<span class="firstterm">
collation
</span>
is a set of rules
for comparing characters in a character set. Let's make the
distinction clear with an example of an imaginary character set.
</p>
<p>
Suppose that we have an alphabet with four letters:
<code class="literal">
A
</code>
,
<code class="literal">
B
</code>
,
<code class="literal">
a
</code>
,
<code class="literal">
b
</code>
. We give each letter a number:
<code class="literal">
A
</code>
= 0,
<code class="literal">
B
</code>
= 1,
<code class="literal">
a
</code>
= 2,
<code class="literal">
b
</code>
= 3. The letter
<code class="literal">
A
</code>
is a symbol, the number 0 is the
<span class="emphasis">
<em>
encoding
</em>
</span>
for
<code class="literal">
A
</code>
, and the
combination of all four letters and their encodings is a
<span class="emphasis">
<em>
character set
</em>
</span>
.
</p>
<p>
Suppose that we want to compare two string values,
<code class="literal">
A
</code>
and
<code class="literal">
B
</code>
. The simplest way to
do this is to look at the encodings: 0 for
<code class="literal">
A
</code>
and 1 for
<code class="literal">
B
</code>
. Because 0 is less than 1, we say
<code class="literal">
A
</code>
is less than
<code class="literal">
B
</code>
. What we've
just done is apply a collation to our character set. The collation
is a set of rules (only one rule in this case):
<span class="quote">
“
<span class="quote">
compare the
encodings.
</span>
”
</span>
We call this simplest of all possible
collations a
<span class="firstterm">
binary
</span>
collation.
</p>
<p>
But what if we want to say that the lowercase and uppercase
letters are equivalent? Then we would have at least two rules: (1)
treat the lowercase letters
<code class="literal">
a
</code>
and
<code class="literal">
b
</code>
as equivalent to
<code class="literal">
A
</code>
and
<code class="literal">
B
</code>
; (2) then compare the encodings. We call this
a
<span class="firstterm">
case-insensitive
</span>
collation. It is a little more complex than a binary collation.
</p>
<p>
In real life, most character sets have many characters: not just
<code class="literal">
A
</code>
and
<code class="literal">
B
</code>
but whole alphabets,
sometimes multiple alphabets or eastern writing systems with
thousands of characters, along with many special symbols and
punctuation marks. Also in real life, most collations have many
rules, not just for whether to distinguish lettercase, but also
for whether to distinguish accents (an
<span class="quote">
“
<span class="quote">
accent
</span>
”
</span>
is a
mark attached to a character as in German
<code class="literal">
Ö
</code>
),
and for multiple-character mappings (such as the rule that
<code class="literal">
Ö
</code>
=
<code class="literal">
OE
</code>
in one of the two
German collations).
</p>
<p>
MySQL can do these things for you:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Store strings using a variety of character sets.
</p>
</li>
<li class="listitem">
<p>
Compare strings using a variety of collations.
</p>
</li>
<li class="listitem">
<p>
Mix strings with different character sets or collations in the
same server, the same database, or even the same table.
</p>
</li>
<li class="listitem">
<p>
Enable specification of character set and collation at any
level.
</p>
</li>
</ul>
</div>
<p>
To use these features effectively, you must know what character
sets and collations are available, how to change the defaults, and
how they affect the behavior of string operators and functions.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/innodb-linux-native-aio.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="innodb-linux-native-aio">
</a>
17.8.6 Using Asynchronous I/O on Linux
</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46045162705696">
</a>
<a class="indexterm" name="idm46045162704240">
</a>
<a class="indexterm" name="idm46045162702752">
</a>
<a class="indexterm" name="idm46045162701680">
</a>
<p>
<code class="literal">
InnoDB
</code>
uses the asynchronous I/O subsystem
(native AIO) on Linux to perform read-ahead and write requests for
data file pages. This behavior is controlled by the
<a class="link" href="innodb-parameters.html#sysvar_innodb_use_native_aio">
<code class="literal">
innodb_use_native_aio
</code>
</a>
configuration option, which applies to Linux systems only and is
enabled by default. On other Unix-like systems,
<code class="literal">
InnoDB
</code>
uses synchronous I/O only. Historically,
<code class="literal">
InnoDB
</code>
only used asynchronous I/O on Windows
systems. Using the asynchronous I/O subsystem on Linux requires
the
<code class="literal">
libaio
</code>
library.
</p>
<p>
With synchronous I/O, query threads queue I/O requests, and
<code class="literal">
InnoDB
</code>
background threads retrieve the queued
requests one at a time, issuing a synchronous I/O call for each.
When an I/O request is completed and the I/O call returns, the
<code class="literal">
InnoDB
</code>
background thread that is handling the
request calls an I/O completion routine and returns to process the
next request. The number of requests that can be processed in
parallel is
<em class="replaceable">
<code>
n
</code>
</em>
, where
<em class="replaceable">
<code>
n
</code>
</em>
is the number of
<code class="literal">
InnoDB
</code>
background threads. The number of
<code class="literal">
InnoDB
</code>
background threads is controlled by
<a class="link" href="innodb-parameters.html#sysvar_innodb_read_io_threads">
<code class="literal">
innodb_read_io_threads
</code>
</a>
and
<a class="link" href="innodb-parameters.html#sysvar_innodb_write_io_threads">
<code class="literal">
innodb_write_io_threads
</code>
</a>
. See
<a class="xref" href="innodb-performance-multiple_io_threads.html" title="17.8.5 Configuring the Number of Background InnoDB I/O Threads">
Section 17.8.5, “Configuring the Number of Background InnoDB I/O Threads”
</a>
.
</p>
<p>
With native AIO, query threads dispatch I/O requests directly to
the operating system, thereby removing the limit imposed by the
number of background threads.
<code class="literal">
InnoDB
</code>
background
threads wait for I/O events to signal completed requests. When a
request is completed, a background thread calls an I/O completion
routine and resumes waiting for I/O events.
</p>
<p>
The advantage of native AIO is scalability for heavily I/O-bound
systems that typically show many pending reads and writes in
<code class="literal">
SHOW ENGINE INNODB STATUS
</code>
output. The increase
in parallel processing when using native AIO means that the type
of I/O scheduler or properties of the disk array controller have a
greater influence on I/O performance.
</p>
<p>
A potential disadvantage of native AIO for heavily I/O-bound
systems is lack of control over the number of I/O write requests
dispatched to the operating system at once. Too many I/O write
requests dispatched to the operating system for parallel
processing could, in some cases, result in I/O read starvation,
depending on the amount of I/O activity and system capabilities.
</p>
<p>
If a problem with the asynchronous I/O subsystem in the OS
prevents
<code class="literal">
InnoDB
</code>
from starting, you can start
the server with
<a class="link" href="innodb-parameters.html#sysvar_innodb_use_native_aio">
<code class="literal">
innodb_use_native_aio=0
</code>
</a>
. This
option may also be disabled automatically during startup if
<code class="literal">
InnoDB
</code>
detects a potential problem such as a
combination of
<code class="literal">
tmpdir
</code>
location,
<code class="literal">
tmpfs
</code>
file system, and Linux kernel that does
not support asynchronous I/O on
<code class="literal">
tmpfs
</code>
.
</p>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/x-plugin-checking-installation.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="x-plugin-checking-installation">
</a>
22.5.1 Checking X Plugin Installation
</h3>
</div>
</div>
</div>
<p>
X Plugin is enabled by default in MySQL 8, therefore installing
or upgrading to MySQL 8 makes the plugin available. You can verify
X Plugin is installed on an instance of MySQL server by using the
<a class="link" href="show-plugins.html" title="15.7.7.27 SHOW PLUGINS Statement">
<code class="literal">
SHOW plugins
</code>
</a>
statement to view the
plugins list.
</p>
<p>
To use MySQL Shell to verify X Plugin is installed, issue:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa5562932"><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">$> </span><span class="token command">mysqlsh</span> <span class="token property">-u</span> <em class="replaceable">user</em> <span class="token property">--sqlc</span> <span class="token property">-P</span> 3306 <span class="token property">-e</span> <span class="token atrule">"SHOW plugins"</span></code></pre>
</div>
<p>
To use MySQL Client to verify X Plugin is installed, issue:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa9381456"><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">$> </span><span class="token command">mysql</span> <span class="token property">-u</span> <em class="replaceable">user</em> <span class="token property">-p</span> <span class="token property">-e</span> <span class="token atrule">"SHOW plugins"</span></code></pre>
</div>
<p>
An example result if X Plugin is installed is highlighted here:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-none"><div class="docs-select-all right" id="sa27818434"><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-none">+----------------------------+----------+--------------------+---------+---------+
| Name | Status | Type | Library | License |
+----------------------------+----------+--------------------+---------+---------+
...
| mysqlx | ACTIVE | DAEMON | NULL | GPL |
...
+----------------------------+----------+--------------------+---------+---------+</code></pre>
</div>
</div>
<br/>
</div>
|
https://dev.mysql.com/doc/refman/8.4/en/innodb-information-schema-examples.html | <div id="docs-body">
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="innodb-information-schema-examples">
</a>
17.15.2.1 Using InnoDB Transaction and Locking Information
</h4>
</div>
</div>
</div>
<p>
This section describes the use of locking information as exposed
by the Performance Schema
<a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
<code class="literal">
data_locks
</code>
</a>
and
<a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
<code class="literal">
data_lock_waits
</code>
</a>
tables.
</p>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="innodb-information-schema-examples-simple-blocking">
</a>
Identifying Blocking Transactions
</h5>
</div>
</div>
</div>
<p>
It is sometimes helpful to identify which transaction blocks
another. The tables that contain information about
<code class="literal">
InnoDB
</code>
transactions and data locks enable
you to determine which transaction is waiting for another, and
which resource is being requested. (For descriptions of these
tables, see
<a class="xref" href="innodb-information-schema-transactions.html" title="17.15.2 InnoDB INFORMATION_SCHEMA Transaction and Locking Information">
Section 17.15.2, “InnoDB INFORMATION_SCHEMA Transaction and Locking Information”
</a>
.)
</p>
<p>
Suppose that three sessions are running concurrently. Each
session corresponds to a MySQL thread, and executes one
transaction after another. Consider the state of the system
when these sessions have issued the following statements, but
none has yet committed its transaction:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Session A:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa57025620"><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">BEGIN</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> a <span class="token keyword">FROM</span> t <span class="token keyword">FOR</span> <span class="token keyword">UPDATE</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> <span class="token function">SLEEP</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Session B:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa47984687"><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">SELECT</span> b <span class="token keyword">FROM</span> t <span class="token keyword">FOR</span> <span class="token keyword">UPDATE</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Session C:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa28718849"><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">SELECT</span> c <span class="token keyword">FROM</span> t <span class="token keyword">FOR</span> <span class="token keyword">UPDATE</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
</ul>
</div>
<p>
In this scenario, use the following query to see which
transactions are waiting and which transactions are blocking
them:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa59935054"><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">SELECT</span>
r<span class="token punctuation">.</span>trx_id waiting_trx_id<span class="token punctuation">,</span>
r<span class="token punctuation">.</span>trx_mysql_thread_id waiting_thread<span class="token punctuation">,</span>
r<span class="token punctuation">.</span>trx_query waiting_query<span class="token punctuation">,</span>
b<span class="token punctuation">.</span>trx_id blocking_trx_id<span class="token punctuation">,</span>
b<span class="token punctuation">.</span>trx_mysql_thread_id blocking_thread<span class="token punctuation">,</span>
b<span class="token punctuation">.</span>trx_query blocking_query
<span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>data_lock_waits w
<span class="token keyword">INNER</span> <span class="token keyword">JOIN</span> information_schema<span class="token punctuation">.</span>innodb_trx b
<span class="token keyword">ON</span> b<span class="token punctuation">.</span>trx_id <span class="token operator">=</span> w<span class="token punctuation">.</span>blocking_engine_transaction_id
<span class="token keyword">INNER</span> <span class="token keyword">JOIN</span> information_schema<span class="token punctuation">.</span>innodb_trx r
<span class="token keyword">ON</span> r<span class="token punctuation">.</span>trx_id <span class="token operator">=</span> w<span class="token punctuation">.</span>requesting_engine_transaction_id<span class="token punctuation">;</span></code></pre>
</div>
<p>
Or, more simply, use the
<code class="literal">
sys
</code>
schema
<a class="link" href="sys-innodb-lock-waits.html" title="30.4.3.9 The innodb_lock_waits and x$innodb_lock_waits Views">
<code class="literal">
innodb_lock_waits
</code>
</a>
view:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa21281945"><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">SELECT</span>
waiting_trx_id<span class="token punctuation">,</span>
waiting_pid<span class="token punctuation">,</span>
waiting_query<span class="token punctuation">,</span>
blocking_trx_id<span class="token punctuation">,</span>
blocking_pid<span class="token punctuation">,</span>
blocking_query
<span class="token keyword">FROM</span> sys<span class="token punctuation">.</span>innodb_lock_waits<span class="token punctuation">;</span></code></pre>
</div>
<p>
If a NULL value is reported for the blocking query, see
<a class="xref" href="innodb-information-schema-examples.html#innodb-information-schema-examples-null-blocking-query" title="Identifying a Blocking Query After the Issuing Session Becomes Idle">
Identifying a Blocking Query After the Issuing Session Becomes Idle
</a>
.
</p>
<div class="informaltable">
<table summary="The result set of a query against the perormance_schema.data_lock_waits and INFORMATION_SCHEMA.INNODB_TRX tables, shown in the preceding text, indicating which InnoDB threads are waiting for which other threads.">
<colgroup>
<col style="width: 9%"/>
<col style="width: 9%"/>
<col style="width: 33%"/>
<col style="width: 10%"/>
<col style="width: 10%"/>
<col style="width: 33%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
waiting trx id
</th>
<th scope="col">
waiting thread
</th>
<th scope="col">
waiting query
</th>
<th scope="col">
blocking trx id
</th>
<th scope="col">
blocking thread
</th>
<th scope="col">
blocking query
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<code class="literal">
A4
</code>
</th>
<td>
<code class="literal">
6
</code>
</td>
<td>
<code class="literal">
SELECT b FROM t FOR UPDATE
</code>
</td>
<td>
<code class="literal">
A3
</code>
</td>
<td>
<code class="literal">
5
</code>
</td>
<td>
<code class="literal">
SELECT SLEEP(100)
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
A5
</code>
</th>
<td>
<code class="literal">
7
</code>
</td>
<td>
<code class="literal">
SELECT c FROM t FOR UPDATE
</code>
</td>
<td>
<code class="literal">
A3
</code>
</td>
<td>
<code class="literal">
5
</code>
</td>
<td>
<code class="literal">
SELECT SLEEP(100)
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
A5
</code>
</th>
<td>
<code class="literal">
7
</code>
</td>
<td>
<code class="literal">
SELECT c FROM t FOR UPDATE
</code>
</td>
<td>
<code class="literal">
A4
</code>
</td>
<td>
<code class="literal">
6
</code>
</td>
<td>
<code class="literal">
SELECT b FROM t FOR UPDATE
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
In the preceding table, you can identify sessions by the
<span class="quote">
“
<span class="quote">
waiting query
</span>
”
</span>
or
<span class="quote">
“
<span class="quote">
blocking query
</span>
”
</span>
columns. As you can see:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Session B (trx id
<code class="literal">
A4
</code>
, thread
<code class="literal">
6
</code>
) and Session C (trx id
<code class="literal">
A5
</code>
, thread
<code class="literal">
7
</code>
) are
both waiting for Session A (trx id
<code class="literal">
A3
</code>
,
thread
<code class="literal">
5
</code>
).
</p>
</li>
<li class="listitem">
<p>
Session C is waiting for Session B as well as Session A.
</p>
</li>
</ul>
</div>
<p>
You can see the underlying data in the
<code class="literal">
INFORMATION_SCHEMA
</code>
<a class="link" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
<code class="literal">
INNODB_TRX
</code>
</a>
table and Performance
Schema
<a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
<code class="literal">
data_locks
</code>
</a>
and
<a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
<code class="literal">
data_lock_waits
</code>
</a>
tables.
</p>
<p>
The following table shows some sample contents of the
<a class="link" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
<code class="literal">
INNODB_TRX
</code>
</a>
table.
</p>
<div class="informaltable">
<a name="innodb-information-schema-examples-simple-blocking-trx">
</a>
<table summary="Sample data from the INFORMATION_SCHEMA.INNODB_TRX table, showing the typical types of entries for each column.">
<colgroup>
<col style="width: 10%"/>
<col style="width: 13%"/>
<col style="width: 36%"/>
<col style="width: 30%"/>
<col style="width: 36%"/>
<col style="width: 19%"/>
<col style="width: 23%"/>
<col style="width: 45%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
trx id
</th>
<th scope="col">
trx state
</th>
<th scope="col">
trx started
</th>
<th scope="col">
trx requested lock id
</th>
<th scope="col">
trx wait started
</th>
<th scope="col">
trx weight
</th>
<th scope="col">
trx mysql thread id
</th>
<th scope="col">
trx query
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<code class="literal">
A3
</code>
</th>
<td>
<code class="literal">
RUNNING
</code>
</td>
<td>
<code class="literal">
2008-01-15 16:44:54
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
2
</code>
</td>
<td>
<code class="literal">
5
</code>
</td>
<td>
<code class="literal">
SELECT SLEEP(100)
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
A4
</code>
</th>
<td>
<code class="literal">
LOCK WAIT
</code>
</td>
<td>
<code class="literal">
2008-01-15 16:45:09
</code>
</td>
<td>
<code class="literal">
A4:1:3:2
</code>
</td>
<td>
<code class="literal">
2008-01-15 16:45:09
</code>
</td>
<td>
<code class="literal">
2
</code>
</td>
<td>
<code class="literal">
6
</code>
</td>
<td>
<code class="literal">
SELECT b FROM t FOR UPDATE
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
A5
</code>
</th>
<td>
<code class="literal">
LOCK WAIT
</code>
</td>
<td>
<code class="literal">
2008-01-15 16:45:14
</code>
</td>
<td>
<code class="literal">
A5:1:3:2
</code>
</td>
<td>
<code class="literal">
2008-01-15 16:45:14
</code>
</td>
<td>
<code class="literal">
2
</code>
</td>
<td>
<code class="literal">
7
</code>
</td>
<td>
<code class="literal">
SELECT c FROM t FOR UPDATE
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The following table shows some sample contents of the
<a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
<code class="literal">
data_locks
</code>
</a>
table.
</p>
<div class="informaltable">
<a name="innodb-information-schema-examples-simple-blocking-locks">
</a>
<table summary="Sample data from the Performance Schema data_locks table, showing the typical types of entries for each column.">
<colgroup>
<col style="width: 26%"/>
<col style="width: 13%"/>
<col style="width: 14%"/>
<col style="width: 21%"/>
<col style="width: 16%"/>
<col style="width: 15%"/>
<col style="width: 29%"/>
<col style="width: 20%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
lock id
</th>
<th scope="col">
lock trx id
</th>
<th scope="col">
lock mode
</th>
<th scope="col">
lock type
</th>
<th scope="col">
lock schema
</th>
<th scope="col">
lock table
</th>
<th scope="col">
lock index
</th>
<th scope="col">
lock data
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<code class="literal">
A3:1:3:2
</code>
</th>
<td>
<code class="literal">
A3
</code>
</td>
<td>
<code class="literal">
X
</code>
</td>
<td>
<code class="literal">
RECORD
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t
</code>
</td>
<td>
<code class="literal">
PRIMARY
</code>
</td>
<td>
<code class="literal">
0x0200
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
A4:1:3:2
</code>
</th>
<td>
<code class="literal">
A4
</code>
</td>
<td>
<code class="literal">
X
</code>
</td>
<td>
<code class="literal">
RECORD
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t
</code>
</td>
<td>
<code class="literal">
PRIMARY
</code>
</td>
<td>
<code class="literal">
0x0200
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
A5:1:3:2
</code>
</th>
<td>
<code class="literal">
A5
</code>
</td>
<td>
<code class="literal">
X
</code>
</td>
<td>
<code class="literal">
RECORD
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t
</code>
</td>
<td>
<code class="literal">
PRIMARY
</code>
</td>
<td>
<code class="literal">
0x0200
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The following table shows some sample contents of the
<a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
<code class="literal">
data_lock_waits
</code>
</a>
table.
</p>
<div class="informaltable">
<a name="innodb-information-schema-examples-simple-blocking-waits">
</a>
<table summary="Sample data from the Performance Schema data_lock_waits table, showing the typical types of entries for each column.">
<colgroup>
<col style="width: 10%"/>
<col style="width: 15%"/>
<col style="width: 10%"/>
<col style="width: 15%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
requesting trx id
</th>
<th scope="col">
requested lock id
</th>
<th scope="col">
blocking trx id
</th>
<th scope="col">
blocking lock id
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<code class="literal">
A4
</code>
</th>
<td>
<code class="literal">
A4:1:3:2
</code>
</td>
<td>
<code class="literal">
A3
</code>
</td>
<td>
<code class="literal">
A3:1:3:2
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
A5
</code>
</th>
<td>
<code class="literal">
A5:1:3:2
</code>
</td>
<td>
<code class="literal">
A3
</code>
</td>
<td>
<code class="literal">
A3:1:3:2
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
A5
</code>
</th>
<td>
<code class="literal">
A5:1:3:2
</code>
</td>
<td>
<code class="literal">
A4
</code>
</td>
<td>
<code class="literal">
A4:1:3:2
</code>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="innodb-information-schema-examples-null-blocking-query">
</a>
Identifying a Blocking Query After the Issuing Session Becomes Idle
</h5>
</div>
</div>
</div>
<p>
When identifying blocking transactions, a NULL value is
reported for the blocking query if the session that issued the
query has become idle. In this case, use the following steps
to determine the blocking query:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1">
<li class="listitem">
<p>
Identify the processlist ID of the blocking transaction.
In the
<a class="link" href="sys-innodb-lock-waits.html" title="30.4.3.9 The innodb_lock_waits and x$innodb_lock_waits Views">
<code class="literal">
sys.innodb_lock_waits
</code>
</a>
table, the processlist ID of the blocking transaction is
the
<code class="literal">
blocking_pid
</code>
value.
</p>
</li>
<li class="listitem">
<p>
Using the
<code class="literal">
blocking_pid
</code>
, query the MySQL
Performance Schema
<a class="link" href="performance-schema-threads-table.html" title="29.12.22.8 The threads Table">
<code class="literal">
threads
</code>
</a>
table to determine the
<code class="literal">
THREAD_ID
</code>
of the
blocking transaction. For example, if the
<code class="literal">
blocking_pid
</code>
is 6, issue this query:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa55216958"><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">SELECT</span> THREAD_ID <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>threads <span class="token keyword">WHERE</span> PROCESSLIST_ID <span class="token operator">=</span> <span class="token number">6</span><span class="token punctuation">;</span></code></pre>
</div>
</li>
<li class="listitem">
<p>
Using the
<code class="literal">
THREAD_ID
</code>
, query the
Performance Schema
<a class="link" href="performance-schema-events-statements-current-table.html" title="29.12.6.1 The events_statements_current Table">
<code class="literal">
events_statements_current
</code>
</a>
table to determine the last query executed by the thread.
For example, if the
<code class="literal">
THREAD_ID
</code>
is 28,
issue this query:
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa29147017"><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">SELECT</span> THREAD_ID<span class="token punctuation">,</span> SQL_TEXT <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>events_statements_current
<span class="token keyword">WHERE</span> THREAD_ID <span class="token operator">=</span> <span class="token number">28</span>\G</code></pre>
</div>
</li>
<li class="listitem">
<p>
If the last query executed by the thread is not enough
information to determine why a lock is held, you can query
the Performance Schema
<a class="link" href="performance-schema-events-statements-history-table.html" title="29.12.6.2 The events_statements_history Table">
<code class="literal">
events_statements_history
</code>
</a>
table to view the last 10 statements executed by the
thread.
</p>
<div class="copytoclipboard-wrapper">
<pre class="programlisting language-sql"><div class="docs-select-all right" id="sa93028929"><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">SELECT</span> THREAD_ID<span class="token punctuation">,</span> SQL_TEXT <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>events_statements_history
<span class="token keyword">WHERE</span> THREAD_ID <span class="token operator">=</span> <span class="token number">28</span> <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> EVENT_ID<span class="token punctuation">;</span></code></pre>
</div>
</li>
</ol>
</div>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title">
<a name="innodb-information-schema-sample-locks">
</a>
Correlating InnoDB Transactions with MySQL Sessions
</h5>
</div>
</div>
</div>
<p>
Sometimes it is useful to correlate internal
<code class="literal">
InnoDB
</code>
locking information with the
session-level information maintained by MySQL. For example,
you might like to know, for a given
<code class="literal">
InnoDB
</code>
transaction ID, the corresponding MySQL session ID and name of
the session that may be holding a lock, and thus blocking
other transactions.
</p>
<p>
The following output from the
<code class="literal">
INFORMATION_SCHEMA
</code>
<a class="link" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
<code class="literal">
INNODB_TRX
</code>
</a>
table and Performance
Schema
<a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
<code class="literal">
data_locks
</code>
</a>
and
<a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
<code class="literal">
data_lock_waits
</code>
</a>
tables is taken
from a somewhat loaded system. As can be seen, there are
several transactions running.
</p>
<p>
The following
<a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
<code class="literal">
data_locks
</code>
</a>
and
<a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
<code class="literal">
data_lock_waits
</code>
</a>
tables show that:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Transaction
<code class="literal">
77F
</code>
(executing an
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
) is waiting for
transactions
<code class="literal">
77E
</code>
,
<code class="literal">
77D
</code>
, and
<code class="literal">
77B
</code>
to
commit.
</p>
</li>
<li class="listitem">
<p>
Transaction
<code class="literal">
77E
</code>
(executing an
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
) is waiting for
transactions
<code class="literal">
77D
</code>
and
<code class="literal">
77B
</code>
to commit.
</p>
</li>
<li class="listitem">
<p>
Transaction
<code class="literal">
77D
</code>
(executing an
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
) is waiting for
transaction
<code class="literal">
77B
</code>
to commit.
</p>
</li>
<li class="listitem">
<p>
Transaction
<code class="literal">
77B
</code>
(executing an
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
) is waiting for
transaction
<code class="literal">
77A
</code>
to commit.
</p>
</li>
<li class="listitem">
<p>
Transaction
<code class="literal">
77A
</code>
is running, currently
executing
<a class="link" href="select.html" title="15.2.13 SELECT Statement">
<code class="literal">
SELECT
</code>
</a>
.
</p>
</li>
<li class="listitem">
<p>
Transaction
<code class="literal">
E56
</code>
(executing an
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
) is waiting for
transaction
<code class="literal">
E55
</code>
to commit.
</p>
</li>
<li class="listitem">
<p>
Transaction
<code class="literal">
E55
</code>
(executing an
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
) is waiting for
transaction
<code class="literal">
19C
</code>
to commit.
</p>
</li>
<li class="listitem">
<p>
Transaction
<code class="literal">
19C
</code>
is running, currently
executing an
<a class="link" href="insert.html" title="15.2.7 INSERT Statement">
<code class="literal">
INSERT
</code>
</a>
.
</p>
</li>
</ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
There may be inconsistencies between queries shown in the
<code class="literal">
INFORMATION_SCHEMA
</code>
<a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
<code class="literal">
PROCESSLIST
</code>
</a>
and
<a class="link" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
<code class="literal">
INNODB_TRX
</code>
</a>
tables. For an
explanation, see
<a class="xref" href="innodb-information-schema-internal-data.html" title="17.15.2.3 Persistence and Consistency of InnoDB Transaction and Locking Information">
Section 17.15.2.3, “Persistence and Consistency of InnoDB Transaction and Locking
Information”
</a>
.
</p>
</div>
<p>
The following table shows the contents of the
<a class="link" href="information-schema-processlist-table.html" title="28.3.23 The INFORMATION_SCHEMA PROCESSLIST Table">
<code class="literal">
PROCESSLIST
</code>
</a>
table for a system
running a heavy
<a class="link" href="glossary.html#glos_workload" title="workload">
workload
</a>
.
</p>
<div class="informaltable">
<a name="innodb-information-schema-sample-processlist">
</a>
<table summary="Sample data from the INFORMATION_SCHEMA.PROCESSLIST table, showing the internal workings of MySQL processes under a heavy workload.">
<colgroup>
<col style="width: 8%"/>
<col style="width: 11%"/>
<col style="width: 21%"/>
<col style="width: 10%"/>
<col style="width: 20%"/>
<col style="width: 10%"/>
<col style="width: 20%"/>
<col style="width: 25%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
ID
</th>
<th scope="col">
USER
</th>
<th scope="col">
HOST
</th>
<th scope="col">
DB
</th>
<th scope="col">
COMMAND
</th>
<th scope="col">
TIME
</th>
<th scope="col">
STATE
</th>
<th scope="col">
INFO
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<code class="literal">
384
</code>
</th>
<td>
<code class="literal">
root
</code>
</td>
<td>
<code class="literal">
localhost
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
Query
</code>
</td>
<td>
<code class="literal">
10
</code>
</td>
<td>
<code class="literal">
update
</code>
</td>
<td>
<code class="literal">
INSERT INTO t2 VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
257
</code>
</th>
<td>
<code class="literal">
root
</code>
</td>
<td>
<code class="literal">
localhost
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
Query
</code>
</td>
<td>
<code class="literal">
3
</code>
</td>
<td>
<code class="literal">
update
</code>
</td>
<td>
<code class="literal">
INSERT INTO t2 VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
130
</code>
</th>
<td>
<code class="literal">
root
</code>
</td>
<td>
<code class="literal">
localhost
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
Query
</code>
</td>
<td>
<code class="literal">
0
</code>
</td>
<td>
<code class="literal">
update
</code>
</td>
<td>
<code class="literal">
INSERT INTO t2 VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
61
</code>
</th>
<td>
<code class="literal">
root
</code>
</td>
<td>
<code class="literal">
localhost
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
Query
</code>
</td>
<td>
<code class="literal">
1
</code>
</td>
<td>
<code class="literal">
update
</code>
</td>
<td>
<code class="literal">
INSERT INTO t2 VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
8
</code>
</th>
<td>
<code class="literal">
root
</code>
</td>
<td>
<code class="literal">
localhost
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
Query
</code>
</td>
<td>
<code class="literal">
1
</code>
</td>
<td>
<code class="literal">
update
</code>
</td>
<td>
<code class="literal">
INSERT INTO t2 VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
4
</code>
</th>
<td>
<code class="literal">
root
</code>
</td>
<td>
<code class="literal">
localhost
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
Query
</code>
</td>
<td>
<code class="literal">
0
</code>
</td>
<td>
<code class="literal">
preparing
</code>
</td>
<td>
<code class="literal">
SELECT * FROM PROCESSLIST
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
2
</code>
</th>
<td>
<code class="literal">
root
</code>
</td>
<td>
<code class="literal">
localhost
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
Sleep
</code>
</td>
<td>
<code class="literal">
566
</code>
</td>
<td>
<code class="literal">
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The following table shows the contents of the
<a class="link" href="information-schema-innodb-trx-table.html" title="28.4.28 The INFORMATION_SCHEMA INNODB_TRX Table">
<code class="literal">
INNODB_TRX
</code>
</a>
table for a system
running a heavy
<a class="link" href="glossary.html#glos_workload" title="workload">
workload
</a>
.
</p>
<div class="informaltable">
<a name="innodb-information-schema-sample-innodb-trx">
</a>
<table summary="Sample data from the INFORMATION_SCHEMA.INNODB_TRX table, showing the internal workings of InnoDB transactions under a heavy workload.">
<colgroup>
<col style="width: 8%"/>
<col style="width: 10%"/>
<col style="width: 19%"/>
<col style="width: 21%"/>
<col style="width: 19%"/>
<col style="width: 10%"/>
<col style="width: 10%"/>
<col style="width: 31%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
trx id
</th>
<th scope="col">
trx state
</th>
<th scope="col">
trx started
</th>
<th scope="col">
trx requested lock id
</th>
<th scope="col">
trx wait started
</th>
<th scope="col">
trx weight
</th>
<th scope="col">
trx mysql thread id
</th>
<th scope="col">
trx query
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<code class="literal">
77F
</code>
</th>
<td>
<code class="literal">
LOCK WAIT
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:16
</code>
</td>
<td>
<code class="literal">
77F
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:16
</code>
</td>
<td>
<code class="literal">
1
</code>
</td>
<td>
<code class="literal">
876
</code>
</td>
<td>
<code class="literal">
INSERT INTO t09 (D, B, C) VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77E
</code>
</th>
<td>
<code class="literal">
LOCK WAIT
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:16
</code>
</td>
<td>
<code class="literal">
77E
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:16
</code>
</td>
<td>
<code class="literal">
1
</code>
</td>
<td>
<code class="literal">
875
</code>
</td>
<td>
<code class="literal">
INSERT INTO t09 (D, B, C) VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77D
</code>
</th>
<td>
<code class="literal">
LOCK WAIT
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:16
</code>
</td>
<td>
<code class="literal">
77D
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:16
</code>
</td>
<td>
<code class="literal">
1
</code>
</td>
<td>
<code class="literal">
874
</code>
</td>
<td>
<code class="literal">
INSERT INTO t09 (D, B, C) VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77B
</code>
</th>
<td>
<code class="literal">
LOCK WAIT
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:16
</code>
</td>
<td>
<code class="literal">
77B:733:12:1
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:16
</code>
</td>
<td>
<code class="literal">
4
</code>
</td>
<td>
<code class="literal">
873
</code>
</td>
<td>
<code class="literal">
INSERT INTO t09 (D, B, C) VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77A
</code>
</th>
<td>
<code class="literal">
RUNNING
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:16
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
4
</code>
</td>
<td>
<code class="literal">
872
</code>
</td>
<td>
<code class="literal">
SELECT b, c FROM t09 WHERE …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
E56
</code>
</th>
<td>
<code class="literal">
LOCK WAIT
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:06
</code>
</td>
<td>
<code class="literal">
E56:743:6:2
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:06
</code>
</td>
<td>
<code class="literal">
5
</code>
</td>
<td>
<code class="literal">
384
</code>
</td>
<td>
<code class="literal">
INSERT INTO t2 VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
E55
</code>
</th>
<td>
<code class="literal">
LOCK WAIT
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:06
</code>
</td>
<td>
<code class="literal">
E55:743:38:2
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:10:13
</code>
</td>
<td>
<code class="literal">
965
</code>
</td>
<td>
<code class="literal">
257
</code>
</td>
<td>
<code class="literal">
INSERT INTO t2 VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
19C
</code>
</th>
<td>
<code class="literal">
RUNNING
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:09:10
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
2900
</code>
</td>
<td>
<code class="literal">
130
</code>
</td>
<td>
<code class="literal">
INSERT INTO t2 VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
E15
</code>
</th>
<td>
<code class="literal">
RUNNING
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:08:59
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
5395
</code>
</td>
<td>
<code class="literal">
61
</code>
</td>
<td>
<code class="literal">
INSERT INTO t2 VALUES …
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
51D
</code>
</th>
<td>
<code class="literal">
RUNNING
</code>
</td>
<td>
<code class="literal">
2008-01-15 13:08:47
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
9807
</code>
</td>
<td>
<code class="literal">
8
</code>
</td>
<td>
<code class="literal">
INSERT INTO t2 VALUES …
</code>
</td>
</tr>
</tbody>
</table>
</div>
<div class="informaltable">
<table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
<thead>
<tr>
<th scope="col" style="width: 55.7344px;">
trx id
</th>
<th scope="col" style="width: 70.1719px;">
trx state
</th>
<th scope="col" style="width: 132.094px;">
trx started
</th>
<th scope="col" style="width: 148.953px;">
trx requested lock id
</th>
<th scope="col" style="width: 132.094px;">
trx wait started
</th>
<th scope="col" style="width: 71.625px;">
trx weight
</th>
<th scope="col" style="width: 71.5312px;">
trx mysql thread id
</th>
<th scope="col" style="width: 55.7969px;">
trx query
</th>
</tr>
</thead>
</table>
</div>
<p>
The following table shows the contents of the
<a class="link" href="performance-schema-data-lock-waits-table.html" title="29.12.13.2 The data_lock_waits Table">
<code class="literal">
data_lock_waits
</code>
</a>
table for a
system running a heavy
<a class="link" href="glossary.html#glos_workload" title="workload">
workload
</a>
.
</p>
<div class="informaltable">
<a name="innodb-information-schema-sample-innodb-lock-waits">
</a>
<table summary="Sample data from the Performance Schema data_lock_waits table, showing the internal workings of InnoDB locking under a heavy workload.">
<colgroup>
<col style="width: 25%"/>
<col style="width: 25%"/>
<col style="width: 25%"/>
<col style="width: 25%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
requesting trx id
</th>
<th scope="col">
requested lock id
</th>
<th scope="col">
blocking trx id
</th>
<th scope="col">
blocking lock id
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<code class="literal">
77F
</code>
</th>
<td>
<code class="literal">
77F:806
</code>
</td>
<td>
<code class="literal">
77E
</code>
</td>
<td>
<code class="literal">
77E:806
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77F
</code>
</th>
<td>
<code class="literal">
77F:806
</code>
</td>
<td>
<code class="literal">
77D
</code>
</td>
<td>
<code class="literal">
77D:806
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77F
</code>
</th>
<td>
<code class="literal">
77F:806
</code>
</td>
<td>
<code class="literal">
77B
</code>
</td>
<td>
<code class="literal">
77B:806
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77E
</code>
</th>
<td>
<code class="literal">
77E:806
</code>
</td>
<td>
<code class="literal">
77D
</code>
</td>
<td>
<code class="literal">
77D:806
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77E
</code>
</th>
<td>
<code class="literal">
77E:806
</code>
</td>
<td>
<code class="literal">
77B
</code>
</td>
<td>
<code class="literal">
77B:806
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77D
</code>
</th>
<td>
<code class="literal">
77D:806
</code>
</td>
<td>
<code class="literal">
77B
</code>
</td>
<td>
<code class="literal">
77B:806
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77B
</code>
</th>
<td>
<code class="literal">
77B:733:12:1
</code>
</td>
<td>
<code class="literal">
77A
</code>
</td>
<td>
<code class="literal">
77A:733:12:1
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
E56
</code>
</th>
<td>
<code class="literal">
E56:743:6:2
</code>
</td>
<td>
<code class="literal">
E55
</code>
</td>
<td>
<code class="literal">
E55:743:6:2
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
E55
</code>
</th>
<td>
<code class="literal">
E55:743:38:2
</code>
</td>
<td>
<code class="literal">
19C
</code>
</td>
<td>
<code class="literal">
19C:743:38:2
</code>
</td>
</tr>
</tbody>
</table>
</div>
<p>
The following table shows the contents of the
<a class="link" href="performance-schema-data-locks-table.html" title="29.12.13.1 The data_locks Table">
<code class="literal">
data_locks
</code>
</a>
table for a system
running a heavy
<a class="link" href="glossary.html#glos_workload" title="workload">
workload
</a>
.
</p>
<div class="informaltable">
<a name="innodb-information-schema-sample-innodb-locks">
</a>
<table summary="Sample data from the Performance Schema data_locks table, showing the internal workings of InnoDB locking under a heavy workload.">
<colgroup>
<col style="width: 18%"/>
<col style="width: 9%"/>
<col style="width: 12%"/>
<col style="width: 12%"/>
<col style="width: 9%"/>
<col style="width: 8%"/>
<col style="width: 15%"/>
<col style="width: 17%"/>
</colgroup>
<thead>
<tr>
<th scope="col">
lock id
</th>
<th scope="col">
lock trx id
</th>
<th scope="col">
lock mode
</th>
<th scope="col">
lock type
</th>
<th scope="col">
lock schema
</th>
<th scope="col">
lock table
</th>
<th scope="col">
lock index
</th>
<th scope="col">
lock data
</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">
<code class="literal">
77F:806
</code>
</th>
<td>
<code class="literal">
77F
</code>
</td>
<td>
<code class="literal">
AUTO_INC
</code>
</td>
<td>
<code class="literal">
TABLE
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t09
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77E:806
</code>
</th>
<td>
<code class="literal">
77E
</code>
</td>
<td>
<code class="literal">
AUTO_INC
</code>
</td>
<td>
<code class="literal">
TABLE
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t09
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77D:806
</code>
</th>
<td>
<code class="literal">
77D
</code>
</td>
<td>
<code class="literal">
AUTO_INC
</code>
</td>
<td>
<code class="literal">
TABLE
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t09
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77B:806
</code>
</th>
<td>
<code class="literal">
77B
</code>
</td>
<td>
<code class="literal">
AUTO_INC
</code>
</td>
<td>
<code class="literal">
TABLE
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t09
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
<td>
<code class="literal">
NULL
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77B:733:12:1
</code>
</th>
<td>
<code class="literal">
77B
</code>
</td>
<td>
<code class="literal">
X
</code>
</td>
<td>
<code class="literal">
RECORD
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t09
</code>
</td>
<td>
<code class="literal">
PRIMARY
</code>
</td>
<td>
<code class="literal">
supremum pseudo-record
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
77A:733:12:1
</code>
</th>
<td>
<code class="literal">
77A
</code>
</td>
<td>
<code class="literal">
X
</code>
</td>
<td>
<code class="literal">
RECORD
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t09
</code>
</td>
<td>
<code class="literal">
PRIMARY
</code>
</td>
<td>
<code class="literal">
supremum pseudo-record
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
E56:743:6:2
</code>
</th>
<td>
<code class="literal">
E56
</code>
</td>
<td>
<code class="literal">
S
</code>
</td>
<td>
<code class="literal">
RECORD
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t2
</code>
</td>
<td>
<code class="literal">
PRIMARY
</code>
</td>
<td>
<code class="literal">
0, 0
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
E55:743:6:2
</code>
</th>
<td>
<code class="literal">
E55
</code>
</td>
<td>
<code class="literal">
X
</code>
</td>
<td>
<code class="literal">
RECORD
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t2
</code>
</td>
<td>
<code class="literal">
PRIMARY
</code>
</td>
<td>
<code class="literal">
0, 0
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
E55:743:38:2
</code>
</th>
<td>
<code class="literal">
E55
</code>
</td>
<td>
<code class="literal">
S
</code>
</td>
<td>
<code class="literal">
RECORD
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t2
</code>
</td>
<td>
<code class="literal">
PRIMARY
</code>
</td>
<td>
<code class="literal">
1922, 1922
</code>
</td>
</tr>
<tr>
<th scope="row">
<code class="literal">
19C:743:38:2
</code>
</th>
<td>
<code class="literal">
19C
</code>
</td>
<td>
<code class="literal">
X
</code>
</td>
<td>
<code class="literal">
RECORD
</code>
</td>
<td>
<code class="literal">
test
</code>
</td>
<td>
<code class="literal">
t2
</code>
</td>
<td>
<code class="literal">
PRIMARY
</code>
</td>
<td>
<code class="literal">
1922, 1922
</code>
</td>
</tr>
</tbody>
</table>
</div>
<div class="informaltable">
<table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 739px;">
<thead>
<tr>
<th scope="col" style="width: 132.844px;">
lock id
</th>
<th scope="col" style="width: 66.4062px;">
lock trx id
</th>
<th scope="col" style="width: 88.5469px;">
lock mode
</th>
<th scope="col" style="width: 88.5469px;">
lock type
</th>
<th scope="col" style="width: 66.4062px;">
lock schema
</th>
<th scope="col" style="width: 59.0312px;">
lock table
</th>
<th scope="col" style="width: 110.688px;">
lock index
</th>
<th scope="col" style="width: 125.531px;">
lock data
</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
<br/>
</div>
|
Subsets and Splits