Author: plavin
Date: 2007-12-20 19:00:21 +0100 (Thu, 20 Dec 2007)
New Revision: 9420
Log:
Rename programs-client, no dynamic content yet -- dynamic table doesn't validate
Removed:
0 Skipped: 0 Warnings: 0
trunk/refman-5.1/programs-client.xml
Renamed/Moved:
trunk/refman-5.1/programs-client-core.xml (from rev 9416, trunk/refman-5.1/programs-client.xml)
Modified:
trunk/refman-5.1/Makefile.depends
trunk/refman-5.1/programs.xml
Modified: trunk/refman-5.1/Makefile.depends
===================================================================
--- trunk/refman-5.1/programs-client-core.xml (rev 0)
+++ trunk/refman-5.1/programs-client-core.xml 2007-12-20 18:00:21 UTC (rev 9420)
Changed blocks: 25, Lines Added: 7898, Lines Deleted: 51; 263707 bytes
@@ -241,7 +241,7 @@
metadata/mysql-cluster-ccsg-merge-temp.idmap \
metadata/optimization.idmap \
metadata/precision-math.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/spatial-extensions.idmap \
metadata/sql-syntax.idmap
data-types.validpure: $(data_types_SOURCES)
@@ -425,7 +425,7 @@
metadata/optimization.idmap \
metadata/partitioning.idmap \
metadata/programs-admin-util.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/programs-installation.idmap \
metadata/programs-server.idmap \
metadata/programs-using.idmap \
@@ -509,7 +509,7 @@
metadata/language-structure-core.idmap \
metadata/optimization.idmap \
metadata/precision-math.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/sql-syntax.idmap \
metadata/stored-procedures.idmap \
metadata/tutorial.idmap
@@ -549,7 +549,7 @@
metadata/news.idmap \
metadata/optimization.idmap \
metadata/programs-admin-util.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/programs-installation.idmap \
metadata/programs-server.idmap \
metadata/programs-using.idmap \
@@ -586,7 +586,7 @@
metadata/internationalization.idmap \
metadata/introduction.idmap \
metadata/language-structure-core.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/sql-syntax.idmap
dynxml-local-language-structure.validpure: $(dynxml_local_language_structure_SOURCES)
dynxml-local-language-structure.titles: $(dynxml_local_language_structure_SOURCES)
@@ -651,6 +651,35 @@
dynxml-local-news-5.1-manprepped.xml: $(dynxml_local_news_5_1_SOURCES) $(dynxml_local_news_5_1_IDMAPS)
dynxml-local-news-5.1-remprepped.xml: $(dynxml_local_news_5_1_SOURCES) $(dynxml_local_news_5_1_IDMAPS)
dynxml-local-news-5.1.xml: $(dynxml_local_news_5_1_INCLUDES)
+dynxml_local_programs_client_INCLUDES = \
+ ../common/fixedchars.ent \
+ ../common/phrases.ent \
+ ../refman-common/urls.ent \
+ all-entities.ent \
+ versions.ent
+dynxml_local_programs_client_IMAGES =
+dynxml_local_programs_client_SOURCES = dynxml-local-programs-client.xml $(dynxml_local_programs_client_INCLUDES)
+dynxml_local_programs_client_IDMAPS = \
+ metadata/apis-c.idmap \
+ metadata/dba-core.idmap \
+ metadata/events.idmap \
+ metadata/internationalization.idmap \
+ metadata/optimization.idmap \
+ metadata/programs-admin-util.idmap \
+ metadata/programs-client-core.idmap \
+ metadata/programs-using.idmap \
+ metadata/restrictions.idmap \
+ metadata/sql-syntax.idmap \
+ metadata/tutorial.idmap
+dynxml-local-programs-client.validpure: $(dynxml_local_programs_client_SOURCES)
+dynxml-local-programs-client.titles: $(dynxml_local_programs_client_SOURCES)
+dynxml-local-programs-client.useless: $(dynxml_local_programs_client_SOURCES)
+dynxml-local-programs-client.valid: $(dynxml_local_programs_client_SOURCES) $(dynxml_local_programs_client_IDMAPS)
+dynxml-local-programs-client.validwarn: $(dynxml_local_programs_client_SOURCES) $(dynxml_local_programs_client_IDMAPS)
+dynxml-local-programs-client-prepped.xml: $(dynxml_local_programs_client_SOURCES) $(dynxml_local_programs_client_IDMAPS)
+dynxml-local-programs-client-manprepped.xml: $(dynxml_local_programs_client_SOURCES) $(dynxml_local_programs_client_IDMAPS)
+dynxml-local-programs-client-remprepped.xml: $(dynxml_local_programs_client_SOURCES) $(dynxml_local_programs_client_IDMAPS)
+dynxml-local-programs-client.xml: $(dynxml_local_programs_client_INCLUDES)
dynxml_local_se_innodb_INCLUDES = \
../common/fixedchars.ent \
../common/phrases.ent \
@@ -694,7 +723,7 @@
metadata/internationalization.idmap \
metadata/optimization.idmap \
metadata/programs-admin-util.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/sql-syntax.idmap
dynxml-local-se-myisam.validpure: $(dynxml_local_se_myisam_SOURCES)
dynxml-local-se-myisam.titles: $(dynxml_local_se_myisam_SOURCES)
@@ -757,7 +786,7 @@
metadata/functions-core.idmap \
metadata/information-schema.idmap \
metadata/language-structure-core.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/replication-notes.idmap \
metadata/restrictions.idmap \
metadata/sql-syntax.idmap \
@@ -999,7 +1028,7 @@
metadata/news.idmap \
metadata/optimization.idmap \
metadata/partitioning.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/programs-installation.idmap \
metadata/programs-miscellaneous.idmap \
metadata/programs.idmap \
@@ -1180,6 +1209,7 @@
dynxml-local-installing.xml \
dynxml-local-language-structure.xml \
dynxml-local-news-5.1.xml \
+ dynxml-local-programs-client.xml \
dynxml-local-se-innodb.xml \
dynxml-local-se-myisam.xml \
errmsgs-client.xml \
@@ -1218,7 +1248,6 @@
precision-math.xml \
preface.xml \
programs-admin-util.xml \
- programs-client.xml \
programs-development.xml \
programs-installation.xml \
programs-miscellaneous.xml \
@@ -1363,7 +1392,7 @@
metadata/partitioning.idmap \
metadata/precision-math.idmap \
metadata/programs-admin-util.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/programs-development.idmap \
metadata/programs-installation.idmap \
metadata/programs-miscellaneous.idmap \
@@ -1668,7 +1697,7 @@
metadata/mysql-cluster-backup.idmap \
metadata/mysql-cluster-ccsg-merge-temp.idmap \
metadata/news-5.1-core.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/replication-configuration.idmap \
metadata/replication-notes.idmap \
metadata/replication.idmap \
@@ -1810,7 +1839,7 @@
metadata/mysql-cluster-configuration.idmap \
metadata/news-5.1-core.idmap \
metadata/partitioning.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/programs-using.idmap \
metadata/replication-configuration.idmap \
metadata/replication-notes.idmap \
@@ -1907,7 +1936,7 @@
metadata/language-structure-core.idmap \
metadata/optimization.idmap \
metadata/partitioning.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/programs-using.idmap \
metadata/replication.idmap \
metadata/se-archive.idmap \
@@ -1944,7 +1973,7 @@
metadata/news-5.1-core.idmap \
metadata/optimization.idmap \
metadata/partitioning.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/sql-syntax.idmap
partitioning.validpure: $(partitioning_SOURCES)
partitioning.titles: $(partitioning_SOURCES)
@@ -2020,35 +2049,6 @@
programs-admin-util-manprepped.xml: $(programs_admin_util_SOURCES) $(programs_admin_util_IDMAPS)
programs-admin-util-remprepped.xml: $(programs_admin_util_SOURCES) $(programs_admin_util_IDMAPS)
-programs_client_INCLUDES = \
- ../common/fixedchars.ent \
- ../common/phrases.ent \
- ../refman-common/urls.ent \
- all-entities.ent \
- versions.ent
-programs_client_IMAGES =
-programs_client_SOURCES = programs-client.xml $(programs_client_INCLUDES)
-programs_client_IDMAPS = \
- metadata/apis-c.idmap \
- metadata/dba-core.idmap \
- metadata/events.idmap \
- metadata/internationalization.idmap \
- metadata/optimization.idmap \
- metadata/programs-admin-util.idmap \
- metadata/programs-client.idmap \
- metadata/programs-using.idmap \
- metadata/restrictions.idmap \
- metadata/sql-syntax.idmap \
- metadata/tutorial.idmap
-programs-client.validpure: $(programs_client_SOURCES)
-programs-client.titles: $(programs_client_SOURCES)
-programs-client.useless: $(programs_client_SOURCES)
-programs-client.valid: $(programs_client_SOURCES) $(programs_client_IDMAPS)
-programs-client.validwarn: $(programs_client_SOURCES) $(programs_client_IDMAPS)
-programs-client-prepped.xml: $(programs_client_SOURCES) $(programs_client_IDMAPS)
-programs-client-manprepped.xml: $(programs_client_SOURCES) $(programs_client_IDMAPS)
-programs-client-remprepped.xml: $(programs_client_SOURCES) $(programs_client_IDMAPS)
-
programs_development_INCLUDES = \
../common/fixedchars.ent \
../common/phrases.ent \
@@ -2159,8 +2159,8 @@
../common/phrases.ent \
../refman-common/urls.ent \
all-entities.ent \
+ dynxml-local-programs-client.xml \
programs-admin-util.xml \
- programs-client.xml \
programs-development.xml \
programs-installation.xml \
programs-miscellaneous.xml \
@@ -2179,7 +2179,7 @@
metadata/mysql-cluster-ccsg-merge-temp.idmap \
metadata/optimization.idmap \
metadata/programs-admin-util.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/programs-development.idmap \
metadata/programs-installation.idmap \
metadata/programs-miscellaneous.idmap \
@@ -2300,7 +2300,7 @@
replication_solutions_SOURCES = replication-solutions.xml $(replication_solutions_INCLUDES)
replication_solutions_IDMAPS = \
metadata/dba-core.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/replication-configuration.idmap \
metadata/replication-solutions.idmap \
metadata/sql-syntax.idmap
@@ -2344,7 +2344,7 @@
metadata/information-schema.idmap \
metadata/mysql-cluster-ccsg-merge-temp.idmap \
metadata/optimization.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/replication-configuration.idmap \
metadata/replication-implementation.idmap \
metadata/replication-notes.idmap \
@@ -2599,7 +2599,7 @@
metadata/optimization.idmap \
metadata/partitioning.idmap \
metadata/programs-admin-util.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/programs-installation.idmap \
metadata/replication-implementation.idmap \
metadata/replication-notes.idmap \
@@ -2665,7 +2665,7 @@
metadata/mysql-cluster-ccsg-merge-temp.idmap \
metadata/optimization.idmap \
metadata/programs-admin-util.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/programs-using.idmap \
metadata/replication-configuration.idmap \
metadata/se-archive.idmap \
@@ -2759,7 +2759,7 @@
metadata/introduction.idmap \
metadata/language-structure-core.idmap \
metadata/optimization.idmap \
- metadata/programs-client.idmap \
+ metadata/programs-client-core.idmap \
metadata/replication-notes.idmap \
metadata/se-innodb-core.idmap \
metadata/sql-syntax.idmap \
Copied: trunk/refman-5.1/programs-client-core.xml (from rev 9416, trunk/refman-5.1/programs-client.xml)
===================================================================
--- trunk/refman-5.1/programs-client-core.xml (rev 0)
+++ trunk/refman-5.1/programs-client-core.xml 2007-12-20 18:00:21 UTC (rev 9420)
@@ -0,0 +1,9575 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+<!ENTITY % all.entities SYSTEM "all-entities.ent">
+ %all.entities;
+]>
+<section id="programs-client">
+
+ <title>MySQL Client Programs</title>
+
+ <remark role="todo">
+ describe input-line editing
+ </remark>
+
+ <refentry id="mysql">
+
+ <indexterm>
+ <primary>mysql</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>command-line tool</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>tools</primary>
+ <secondary>command-line</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>scripts</primary>
+ <secondary>SQL</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>SQL scripts</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>batch SQL files</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle><command>mysql</command></refentrytitle>
+
+ <manvolnum>1</manvolnum>
+ <refmiscinfo class="manual">MySQL Database System</refmiscinfo>
+ <refmiscinfo class="source">MySQL</refmiscinfo>
+ <refmiscinfo class="version">¤t-series;</refmiscinfo>
+ <refmiscinfo class="refman">The MySQL Command-Line Tool</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>mysql</refname>
+
+ <refpurpose>the MySQL command-line tool</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>mysql [<replaceable>options</replaceable>] <replaceable>db_name</replaceable></command>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsection id="mysql-description">
+
+ <title>Description</title>
+
+ <para>
+ <command>mysql</command> is a simple SQL shell (with GNU
+ <literal>readline</literal> capabilities). It supports
+ interactive and non-interactive use. When used interactively,
+ query results are presented in an ASCII-table format. When used
+ non-interactively (for example, as a filter), the result is
+ presented in tab-separated format. The output format can be
+ changed using command options.
+ </para>
+
+ <para>
+ If you have problems due to insufficient memory for large result
+ sets, use the <option>--quick</option> option. This forces
+ <command>mysql</command> to retrieve results from the server a
+ row at a time rather than retrieving the entire result set and
+ buffering it in memory before displaying it. This is done by
+ returning the result set using the
+ <function role="capi">mysql_use_result()</function> C API
+ function in the client/server library rather than
+ <function role="capi">mysql_store_result()</function>.
+ </para>
+
+ <para>
+ Using <command>mysql</command> is very easy. Invoke it from the
+ prompt of your command interpreter as follows:
+ </para>
+
+<programlisting>
+shell> <userinput>mysql <replaceable>db_name</replaceable></userinput>
+</programlisting>
+
+ <para>
+ Or:
+ </para>
+
+<programlisting>
+shell> <userinput>mysql --user=<replaceable>user_name</replaceable> --password=<replaceable>your_password</replaceable> <replaceable>db_name</replaceable></userinput>
+</programlisting>
+
+ <para>
+ Then type an SQL statement, end it with
+ <quote><literal>;</literal></quote>, <literal>\g</literal>, or
+ <literal>\G</literal> and press Enter.
+ </para>
+
+ <para>
+ As of MySQL 5.1.10, typing Control-C causes
+ <command>mysql</command> to attempt to kill the current
+ statement. If this cannot be done, or Control-C is typed again
+ before the statement is killed, <command>mysql</command> exits.
+ Previously, Control-C caused <command>mysql</command> to exit in
+ all cases.
+ </para>
+
+ <para>
+ You can execute SQL statements in a script file (batch file)
+ like this:
+ </para>
+
+<programlisting>
+shell> <userinput>mysql <replaceable>db_name</replaceable> < <replaceable>script.sql</replaceable> > <replaceable>output.tab</replaceable></userinput>
+</programlisting>
+
+ </refsection>
+
+ <refsection id="mysql-command-options">
+
+ <title><command>mysql</command> Options</title>
+
+ <indexterm>
+ <primary>mysql command options</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>command options</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>options</primary>
+ <secondary>command-line</secondary>
+ <tertiary>mysql</tertiary>
+ </indexterm>
+
+ <indexterm>
+ <primary>startup parameters</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <para>
+ <command>mysql</command> supports the following options:
+ </para>
+
+ <!--para condition="dynamic:optvar:commandoptions" role="5.1:mysql:all"/-->
+
+ <itemizedlist>
+
+ <listitem>
+ <para id="option_mysql_help">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>help option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>help option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--help</option>, <option>-?</option>
+ </para>
+
+ <para>
+ Display a help message and exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_auto-rehash">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>auto-rehash option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>auto-rehash option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--auto-rehash</option>
+ </para>
+
+ <para>
+ Enable automatic rehashing. This option is on by default,
+ which enables table and column name completion. Use
+ <option>--skip-auto-rehash</option> to disable rehashing.
+ That causes <command>mysql</command> to start faster, but
+ you must issue the <literal>rehash</literal> command if you
+ want to use table and column name completion.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_batch">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>batch option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>batch option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--batch</option>, <option>-B</option>
+ </para>
+
+ <para>
+ Print results using tab as the column separator, with each
+ row on a new line. With this option,
+ <command>mysql</command> does not use the history file.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_character-sets-dir">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>character-sets-dir option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>character-sets-dir option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--character-sets-dir=<replaceable>path</replaceable></option>
+ </para>
+
+ <para>
+ The directory where character sets are installed. See
+ <xref linkend="charset-configuration"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_column-names">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>column-names option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>column-names option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--column-names</option>
+ </para>
+
+ <para>
+ Write column names in results.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_column-type-info">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>column-type-info option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>column-type-info option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--column-type-info</option>, <option>-m</option>
+ </para>
+
+ <para>
+ Display result set metadata. This option was added in MySQL
+ 5.1.14. (Before that, use <option>--debug-info</option>.)
+ The <option>-m</option> short option was added in MySQL
+ 5.1.21.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_comments">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>comments option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>comments option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--comments</option>, <option>-c</option>
+ </para>
+
+ <para>
+ Whether to preserve comments in statements sent to the
+ server. The default is --skip-comments (discard comments),
+ enable with --comments (preserve comments). This option was
+ added in MySQL 5.1.23.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_compress">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>compress option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>compress option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--compress</option>, <option>-C</option>
+ </para>
+
+ <para>
+ Compress all information sent between the client and the
+ server if both support compression.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_database">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>database option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>database option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--database=<replaceable>db_name</replaceable></option>,
+ <option>-D <replaceable>db_name</replaceable></option>
+ </para>
+
+ <para>
+ The database to use. This is useful primarily in an option
+ file.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_debug">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>debug option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--debug[=<replaceable>debug_options</replaceable>]</option>,
+ <option>-#
+ [<replaceable>debug_options</replaceable>]</option>
+ </para>
+
+ <para>
+ Write a debugging log. The
+ <replaceable>debug_options</replaceable> string often is
+ <literal>'d:t:o,<replaceable>file_name</replaceable>'</literal>.
+ The default is <literal>'d:t:o,/tmp/mysql.trace'</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_debug-check">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>debug-check option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug-check option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--debug-check</option>
+ </para>
+
+ <para>
+ Print some debugging information when the program exits.
+ This option was added in MySQL 5.1.21.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_debug-info">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>debug-info option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug-info option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--debug-info</option>, <option>-T</option>
+ </para>
+
+ <para>
+ Before MySQL 5.1.14, this option prints debugging
+ information and memory and CPU usage statistics when the
+ program exits, and also causes display of result set
+ metadata during execution. As of MySQL 5.1.14, use
+ <option>--column-type-info</option> to display result set
+ metadata.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_default-character-set">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>default-character-set option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>default-character-set option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--default-character-set=<replaceable>charset_name</replaceable></option>
+ </para>
+
+ <para>
+ Use <replaceable>charset_name</replaceable> as the default
+ character set. See <xref linkend="charset-configuration"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_delimiter">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>delimiter option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>delimiter option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--delimiter=<replaceable>str</replaceable></option>
+ </para>
+
+ <para>
+ Set the statement delimiter. The default is the semicolon
+ character (<quote><literal>;</literal></quote>).
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_execute">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>execute option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>execute option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--execute=<replaceable>statement</replaceable></option>,
+ <option>-e <replaceable>statement</replaceable></option>
+ </para>
+
+ <para>
+ Execute the statement and quit. The default output format is
+ like that produced with <option>--batch</option>. See
+ <xref linkend="command-line-options"/>, for some examples.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_force">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>force option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>force option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--force</option>, <option>-f</option>
+ </para>
+
+ <para>
+ Continue even if an SQL error occurs.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_host">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>host option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>host option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--host=<replaceable>host_name</replaceable></option>,
+ <option>-h <replaceable>host_name</replaceable></option>
+ </para>
+
+ <para>
+ Connect to the MySQL server on the given host.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_html">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>html option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>html option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--html</option>, <option>-H</option>
+ </para>
+
+ <para>
+ Produce HTML output.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_ignore-spaces">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>ignore-spaces option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>ignore-spaces option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--ignore-spaces</option>, <option>-i</option>
+ </para>
+
+ <para>
+ Ignore spaces after function names. The effect of this is
+ described in the discussion for the
+ <literal>IGNORE_SPACE</literal> SQL mode (see
+ <xref linkend="server-sql-mode"/>).
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_line-numbers">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>line-numbers option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>line-numbers option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--line-numbers</option>
+ </para>
+
+ <para>
+ Write line numbers for errors. Disable this with
+ <option>--skip-line-numbers</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_local-infile">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>local-infile option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>local-infile option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--local-infile[={0|1}]</option>
+ </para>
+
+ <para>
+ Enable or disable <literal>LOCAL</literal> capability for
+ <literal>LOAD DATA INFILE</literal>. With no value, the
+ option enables <literal>LOCAL</literal>. The option may be
+ given as <option>--local-infile=0</option> or
+ <option>--local-infile=1</option> to explicitly disable or
+ enable <literal>LOCAL</literal>. Enabling
+ <literal>LOCAL</literal> has no effect if the server does
+ not also support it.
+ </para>
+
+ <formalpara role="mnmas">
+
+ <title>MySQL Enterprise</title>
+
+ <para>
+ For expert advice on the security implications of enabling
+ <literal>LOCAL</literal>, subscribe to the MySQL
+ Enterprise Monitor. For more information see
+ <ulink url="&base-url-enterprise;advisors.html"/>.
+ </para>
+
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_named-commands">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>named-commands option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>named-commands option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--named-commands</option>, <option>-G</option>
+ </para>
+
+ <para>
+ Enable named <command>mysql</command> commands. Long-format
+ commands are allowed, not just short-format commands. For
+ example, <literal>quit</literal> and <literal>\q</literal>
+ both are recognized. Use
+ <option>--skip-named-commands</option> to disable named
+ commands. See <xref linkend="mysql-commands"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_no-auto-rehash">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>no-auto-rehash option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>no-auto-rehash option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--no-auto-rehash</option>, <option>-A</option>
+ </para>
+
+ <para>
+ Deprecated form of <option>-skip-auto-rehash</option>. See
+ the description for <option>--auto-rehash</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_no-beep">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>no-beep option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>no-beep option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--no-beep</option>, <option>-b</option>
+ </para>
+
+ <para>
+ Do not beep when errors occur.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_no-named-commands">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>no-named-commands option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>no-named-commands option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--no-named-commands</option>, <option>-g</option>
+ </para>
+
+ <para>
+ Disable named commands. Use the <literal>\*</literal> form
+ only, or use named commands only at the beginning of a line
+ ending with a semicolon
+ (<quote><literal>;</literal></quote>).
+ <command>mysql</command> starts with this option
+ <emphasis>enabled</emphasis> by default. However, even with
+ this option, long-format commands still work from the first
+ line. See <xref linkend="mysql-commands"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_no-pager">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>no-pager option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>no-pager option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--no-pager</option>
+ </para>
+
+ <para>
+ Deprecated form of <option>--skip-pager</option>. See the
+ <option>--pager</option> option.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_no-tee">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>no-tee option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>no-tee option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--no-tee</option>
+ </para>
+
+ <para>
+ Do not copy output to a file.
+ <xref linkend="mysql-commands"/>, discusses tee files
+ further.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_one-database">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>one-database option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>one-database option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--one-database</option>, <option>-o</option>
+ </para>
+
+ <para>
+ Ignore statements except those for the default database
+ named on the command line. This is useful for skipping
+ updates to other databases in the binary log.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_pager">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>pager option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>pager option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--pager[=<replaceable>command</replaceable>]</option>
+ </para>
+
+ <para>
+ Use the given command for paging query output. If the
+ command is omitted, the default pager is the value of your
+ <literal>PAGER</literal> environment variable. Valid pagers
+ are <command>less</command>, <command>more</command>,
+ <command>cat [> filename]</command>, and so forth. This
+ option works only on Unix. It does not work in batch mode.
+ To disable paging, use <option>--skip-pager</option>.
+ <xref linkend="mysql-commands"/>, discusses output paging
+ further.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_password">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>password option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>password option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--password[=<replaceable>password</replaceable>]</option>,
+ <option>-p[<replaceable>password</replaceable>]</option>
+ </para>
+
+ <para>
+ The password to use when connecting to the server. If you
+ use the short option form (<option>-p</option>), you
+ <emphasis>cannot</emphasis> have a space between the option
+ and the password. If you omit the
+ <replaceable>password</replaceable> value following the
+ <option>--password</option> or <option>-p</option> option on
+ the command line, you are prompted for one.
+ </para>
+
+ <para>
+ Specifying a password on the command line should be
+ considered insecure. See
+ <xref linkend="password-security"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_port">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>port option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>port option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--port=<replaceable>port_num</replaceable></option>,
+ <option>-P <replaceable>port_num</replaceable></option>
+ </para>
+
+ <para>
+ The TCP/IP port number to use for the connection.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_prompt">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>prompt option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>prompt option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--prompt=<replaceable>format_str</replaceable></option>
+ </para>
+
+ <para>
+ Set the prompt to the specified format. The default is
+ <literal>mysql></literal>. The special sequences that the
+ prompt can contain are described in
+ <xref linkend="mysql-commands"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_protocol">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>protocol option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>protocol option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--protocol={TCP|SOCKET|PIPE|MEMORY}</option>
+ </para>
+
+ <para>
+ The connection protocol to use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_quick">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>quick option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>quick option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--quick</option>, <option>-q</option>
+ </para>
+
+ <para>
+ Do not cache each query result, print each row as it is
+ received. This may slow down the server if the output is
+ suspended. With this option, <command>mysql</command> does
+ not use the history file.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_raw">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>raw option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>raw option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--raw</option>, <option>-r</option>
+ </para>
+
+ <para>
+ Write column values without escape conversion. Often used
+ with the <option>--batch</option> option.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_reconnect">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>reconnect option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>reconnect option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--reconnect</option>
+ </para>
+
+ <para>
+ If the connection to the server is lost, automatically try
+ to reconnect. A single reconnect attempt is made each time
+ the connection is lost. To suppress reconnection behavior,
+ use <option>--skip-reconnect</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_safe-updates">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>safe-updates option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>safe-updates option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>i-am-a-dummy option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>i-am-a-dummy option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--safe-updates</option>,
+ <option>--i-am-a-dummy</option>, <option>-U</option>
+ </para>
+
+ <para>
+ Allow only those <literal>UPDATE</literal> and
+ <literal>DELETE</literal> statements that specify which rows
+ to modify by using key values. If you have set this option
+ in an option file, you can override it by using
+ <option>--safe-updates</option> on the command line. See
+ <xref linkend="mysql-tips"/>, for more information about
+ this option.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_secure_auth">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>secure-auth option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>secure-auth option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--secure-auth</option>
+ </para>
+
+ <para>
+ Do not send passwords to the server in old (pre-4.1.1)
+ format. This prevents connections except for servers that
+ use the newer password format.
+ </para>
+
+ <formalpara role="mnmas">
+
+ <title>MySQL Enterprise</title>
+
+ <para>
+ For expert advice on database security, subscribe to the
+ MySQL Enterprise Monitor. For more information see
+ <ulink url="&base-url-enterprise;advisors.html"/>.
+ </para>
+
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_show-warnings">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>show-warnings option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>show-warnings option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--show-warnings</option>
+ </para>
+
+ <para>
+ Cause warnings to be shown after each statement if there are
+ any. This option applies to interactive and batch mode.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_sigint-ignore">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>sigint-ignore option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>sigint-ignore option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--sigint-ignore</option>
+ </para>
+
+ <para>
+ Ignore <literal>SIGINT</literal> signals (typically the
+ result of typing Control-C).
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_silent">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>silent option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>silent option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--silent</option>, <option>-s</option>
+ </para>
+
+ <para>
+ Silent mode. Produce less output. This option can be given
+ multiple times to produce less and less output.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_skip-column-names">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>skip-column-names option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>skip-column-names option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--skip-column-names</option>, <option>-N</option>
+ </para>
+
+ <para>
+ Do not write column names in results.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_skip-line-numbers">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>skip-line-numbers option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>skip-line-numbers option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--skip-line-numbers</option>, <option>-L</option>
+ </para>
+
+ <para>
+ Do not write line numbers for errors. Useful when you want
+ to compare result files that include error messages.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_socket">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>socket option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>socket option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--socket=<replaceable>path</replaceable></option>,
+ <option>-S <replaceable>path</replaceable></option>
+ </para>
+
+ <para>
+ For connections to <literal>localhost</literal>, the Unix
+ socket file to use, or, on Windows, the name of the named
+ pipe to use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_ssl">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>SSL options</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>SSL options</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--ssl*</option>
+ </para>
+
+ <para>
+ Options that begin with <option>--ssl</option> specify
+ whether to connect to the server via SSL and indicate where
+ to find SSL keys and certificates. See
+ <xref linkend="ssl-options"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_table">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>table option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>table option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--table</option>, <option>-t</option>
+ </para>
+
+ <para>
+ Display output in table format. This is the default for
+ interactive use, but can be used to produce table output in
+ batch mode.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_tee">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>tee option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>tee option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--tee=<replaceable>file_name</replaceable></option>
+ </para>
+
+ <para>
+ Append a copy of output to the given file. This option does
+ not work in batch mode. in <xref linkend="mysql-commands"/>,
+ discusses tee files further.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_unbuffered">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>unbuffered option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>unbuffered option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--unbuffered</option>, <option>-n</option>
+ </para>
+
+ <para>
+ Flush the buffer after each query.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_user">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>user option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>user option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--user=<replaceable>user_name</replaceable></option>,
+ <option>-u <replaceable>user_name</replaceable></option>
+ </para>
+
+ <para>
+ The MySQL username to use when connecting to the server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_verbose">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>verbose option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>verbose option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--verbose</option>, <option>-v</option>
+ </para>
+
+ <para>
+ Verbose mode. Produce more output about what the program
+ does. This option can be given multiple times to produce
+ more and more output. (For example, <option>-v -v
+ -v</option> produces table output format even in batch
+ mode.)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_version">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>version option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>version option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--version</option>, <option>-V</option>
+ </para>
+
+ <para>
+ Display version information and exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_vertical">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>vertical option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>vertical option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--vertical</option>, <option>-E</option>
+ </para>
+
+ <para>
+ Print query output rows vertically (one line per column
+ value). Without this option, you can specify vertical output
+ for individual statements by terminating them with
+ <literal>\G</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_wait">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>wait option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>wait option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--wait</option>, <option>-w</option>
+ </para>
+
+ <para>
+ If the connection cannot be established, wait and retry
+ instead of aborting.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_xml">
+ <indexterm>
+ <primary>mysql</primary>
+ <secondary>xml option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>xml option</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <option>--xml</option>, <option>-X</option>
+ </para>
+
+ <para>
+ Produce XML output.
+ </para>
+
+ <note>
+ <para>
+ Prior to MySQL 5.1.12, there was no differentiation in the
+ output when using this option between columns containing
+ the <literal>NULL</literal> value and columns containing
+ the string literal <literal>'NULL'</literal>; both were
+ represented as
+ </para>
+ </note>
+
+<programlisting>
+<field name="<replaceable>column_name</replaceable>">NULL</field>
+</programlisting>
+
+ <para>
+ Beginning with MySQL 5.1.12, the output when
+ <option>--xml</option> is used with <command>mysql</command>
+ matches that of <command>mysqldump
+ <option>--xml</option></command>. See
+ <link linkend="option_mysqldump_xml">the section of the
+ Manual which discusses the <option>--xml</option> option for
+ <command>mysqldump</command></link> for details.
+ </para>
+
+ <para>
+ Beginning with MySQL 5.1.18, the XML output also uses an XML
+ namespace, as shown here:
+
+<programlisting>
+shell> <userinput>mysql --xml -uroot -e "SHOW VARIABLES LIKE 'version%'"</userinput>
+<?xml version="1.0"?>
+
+<resultset statement="SHOW VARIABLES LIKE 'version%'" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<row>
+<field name="Variable_name">version</field>
+<field name="Value">5.0.40-debug</field>
+</row>
+
+<row>
+<field name="Variable_name">version_comment</field>
+<field name="Value">Source distribution</field>
+</row>
+
+<row>
+<field name="Variable_name">version_compile_machine</field>
+<field name="Value">i686</field>
+</row>
+
+<row>
+<field name="Variable_name">version_compile_os</field>
+<field name="Value">suse-linux-gnu</field>
+</row>
+</resultset>
+</programlisting>
+
+ (See Bug #25946.)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ You can also set the following variables by using
+ <option>--<replaceable>var_name</replaceable>=<replaceable>value</replaceable></option>
+ syntax:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para id="option_mysql_connect_timeout">
+ <indexterm>
+ <primary>timeout</primary>
+ <secondary>connect_timeout variable</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>connect_timeout variable</primary>
+ </indexterm>
+
+ <literal>connect_timeout</literal>
+ </para>
+
+ <para>
+ The number of seconds before connection timeout. (Default
+ value is <literal>0</literal>.)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_max_alowed_packet">
+ <indexterm>
+ <primary>max_allowed_packet variable</primary>
+ </indexterm>
+
+ <literal>max_allowed_packet</literal>
+ </para>
+
+ <para>
+ The maximum packet length to send to or receive from the
+ server. (Default value is 16MB.)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_max_join_size">
+ <indexterm>
+ <primary>max_join_size variable</primary>
+ </indexterm>
+
+ <literal>max_join_size</literal>
+ </para>
+
+ <para>
+ The automatic limit for rows in a join when using
+ <option>--safe-updates</option>. (Default value is
+ 1,000,000.)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>net_buffer_length variable</primary>
+ </indexterm>
+
+ <literal>net_buffer_length</literal>
+ </para>
+
+ <para>
+ The buffer size for TCP/IP and socket communication.
+ (Default value is 16KB.)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysql_select_limit">
+ <indexterm>
+ <primary>select_limit variable</primary>
+ </indexterm>
+
+ <literal>select_limit</literal>
+ </para>
+
+ <para>
+ The automatic limit for <literal>SELECT</literal> statements
+ when using <option>--safe-updates</option>. (Default value
+ is 1,000.)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ It is also possible to set variables by using
+ <option>--set-variable=<replaceable>var_name</replaceable>=<replaceable>value</replaceable></option>
+ or <option>-O
+ <replaceable>var_name</replaceable>=<replaceable>value</replaceable></option>
+ syntax. <emphasis>This syntax is deprecated</emphasis>.
+ </para>
+
+ <indexterm>
+ <primary>MYSQL_HISTFILE environment variable</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>environment variable</primary>
+ <secondary>MYSQL_HISTFILE</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>HOME environment variable</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>environment variable</primary>
+ <secondary>HOME</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>mysql history file</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>command-line history</primary>
+ <secondary>mysql</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>.mysql_history file</primary>
+ </indexterm>
+
+ <para>
+ On Unix, the <command>mysql</command> client writes a record of
+ executed statements to a history file. By default, the history
+ file is named <filename>.mysql_history</filename> and is created
+ in your home directory. To specify a different file, set the
+ value of the <literal>MYSQL_HISTFILE</literal> environment
+ variable.
+ </para>
+
+ <para>
+ If you do not want to maintain a history file, first remove
+ <filename>.mysql_history</filename> if it exists, and then use
+ either of the following techniques:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Set the <literal>MYSQL_HISTFILE</literal> variable to
+ <filename>/dev/null</filename>. To cause this setting to
+ take effect each time you log in, put the setting in one of
+ your shell's startup files.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Create <filename>.mysql_history</filename> as a symbolic
+ link to <filename>/dev/null</filename>:
+ </para>
+
+<programlisting>
+shell> <userinput>ln -s /dev/null $HOME/.mysql_history</userinput>
+</programlisting>
+
+ <para>
+ You need do this only once.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </refsection>
+
+ <refsection id="mysql-commands">
+
+ <title><command>mysql</command> Commands</title>
+
+ <para>
+ <command>mysql</command> sends each SQL statement that you issue
+ to the server to be executed. There is also a set of commands
+ that <command>mysql</command> itself interprets. For a list of
+ these commands, type <literal>help</literal> or
+ <literal>\h</literal> at the <literal>mysql></literal>
+ prompt:
+ </para>
+
+ <indexterm>
+ <primary>mysql commands</primary>
+ <secondary>list of</secondary>
+ </indexterm>
+
+ <remark role="note">
+ Output from 5.1.2-alpha
+ </remark>
+
+<programlisting>
+mysql> <userinput>help</userinput>
+
+List of all MySQL commands:
+Note that all text commands must be first on line and end with ';'
+? (\?) Synonym for `help'.
+charset (\C) Switch to another charset. Might be needed for processing
+ binlog with multi-byte charsets.
+clear (\c) Clear command.
+connect (\r) Reconnect to the server. Optional arguments are db and host.
+delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line as
+ new delimiter.
+edit (\e) Edit command with $EDITOR.
+ego (\G) Send command to mysql server, display result vertically.
+exit (\q) Exit mysql. Same as quit.
+go (\g) Send command to mysql server.
+help (\h) Display this help.
+nopager (\n) Disable pager, print to stdout.
+notee (\t) Don't write into outfile.
+pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
+print (\p) Print current command.
+prompt (\R) Change your mysql prompt.
+quit (\q) Quit mysql.
+rehash (\#) Rebuild completion hash.
+source (\.) Execute an SQL script file. Takes a file name as an argument.
+status (\s) Get status information from the server.
+system (\!) Execute a system shell command.
+tee (\T) Set outfile [to_outfile]. Append everything into given
+ outfile.
+use (\u) Use another database. Takes database name as argument.
+warnings (\W) Show warnings after every statement.
+nowarning (\w) Don't show warnings after every statement.
+
+For server side help, type 'help contents'
+</programlisting>
+
+ <para>
+ Each command has both a long and short form. The long form is
+ not case sensitive; the short form is. The long form can be
+ followed by an optional semicolon terminator, but the short form
+ should not.
+ </para>
+
+ <para>
+ The use of short-form commands within multi-line <literal>/* ...
+ */</literal> comments is not supported.
+ </para>
+
+ <para>
+ If you provide an argument to the <literal>help</literal>
+ command, <command>mysql</command> uses it as a search string to
+ access server-side help from the contents of the MySQL Reference
+ Manual. For more information, see
+ <xref linkend="mysql-server-side-help"/>.
+ </para>
+
+ <para>
+ The <literal>charset</literal> command changes the default
+ character set and issues a <literal>SET NAMES</literal>
+ statement. This enables the character set to remain synchronized
+ on the client and server if <command>mysql</command> is run with
+ auto-reconnect enabled (which is not recommended), because the
+ changed character set is used for reconnects. This command was
+ added in MySQL 5.1.12.
+ </para>
+
+ <para>
+ In the <literal>delimiter</literal> command, you should avoid
+ the use of the backslash (<quote><literal>\</literal></quote>)
+ character because that is the escape character for MySQL.
+ </para>
+
+ <para>
+ The <command>edit</command>, <command>nopager</command>,
+ <command>pager</command>, and <command>system</command> commands
+ work only in Unix.
+ </para>
+
+ <indexterm>
+ <primary>mysql status command</primary>
+ </indexterm>
+
+ <para>
+ The <literal>status</literal> command provides some information
+ about the connection and the server you are using. If you are
+ running in <option>--safe-updates</option> mode,
+ <literal>status</literal> also prints the values for the
+ <command>mysql</command> variables that affect your queries.
+ </para>
+
+ <para>
+ To log queries and their output, use the <command>tee</command>
+ command. All the data displayed on the screen is appended into a
+ given file. This can be very useful for debugging purposes also.
+ You can enable this feature on the command line with the
+ <option>--tee</option> option, or interactively with the
+ <command>tee</command> command. The <command>tee</command> file
+ can be disabled interactively with the <command>notee</command>
+ command. Executing <command>tee</command> again re-enables
+ logging. Without a parameter, the previous file is used. Note
+ that <command>tee</command> flushes query results to the file
+ after each statement, just before <command>mysql</command>
+ prints its next prompt.
+ </para>
+
+ <para>
+ By using the <option>--pager</option> option, it is possible to
+ browse or search query results in interactive mode with Unix
+ programs such as <command>less</command>,
+ <command>more</command>, or any other similar program. If you
+ specify no value for the option, <command>mysql</command> checks
+ the value of the <literal>PAGER</literal> environment variable
+ and sets the pager to that. Output paging can be enabled
+ interactively with the <command>pager</command> command and
+ disabled with <command>nopager</command>. The command takes an
+ optional argument; if given, the paging program is set to that.
+ With no argument, the pager is set to the pager that was set on
+ the command line, or <literal>stdout</literal> if no pager was
+ specified.
+ </para>
+
+ <para>
+ Output paging works only in Unix because it uses the
+ <literal>popen()</literal> function, which does not exist on
+ Windows. For Windows, the <command>tee</command> option can be
+ used instead to save query output, although this is not as
+ convenient as <command>pager</command> for browsing output in
+ some situations.
+ </para>
+
+ <para>
+ Here are a few tips about the <command>pager</command> command:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ You can use it to write to a file and the results go only to
+ the file:
+ </para>
+
+<programlisting>
+mysql> <userinput>pager cat > /tmp/log.txt</userinput>
+</programlisting>
+
+ <para>
+ You can also pass any options for the program that you want
+ to use as your pager:
+ </para>
+
+<programlisting>
+mysql> <userinput>pager less -n -i -S</userinput>
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ In the preceding example, note the <option>-S</option>
+ option. You may find it very useful for browsing wide query
+ results. Sometimes a very wide result set is difficult to
+ read on the screen. The <option>-S</option> option to
+ <command>less</command> can make the result set much more
+ readable because you can scroll it horizontally using the
+ left-arrow and right-arrow keys. You can also use
+ <option>-S</option> interactively within
+ <command>less</command> to switch the horizontal-browse mode
+ on and off. For more information, read the
+ <command>less</command> manual page:
+ </para>
+
+<programlisting>
+shell> <userinput>man less</userinput>
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ You can specify very complex pager commands for handling
+ query output:
+ </para>
+
+<programlisting>
+mysql> <userinput>pager cat | tee /dr1/tmp/res.txt \</userinput>
+ <userinput>| tee /dr2/tmp/res2.txt | less -n -i -S</userinput>
+</programlisting>
+
+ <para>
+ In this example, the command would send query results to two
+ files in two different directories on two different
+ filesystems mounted on <filename>/dr1</filename> and
+ <filename>/dr2</filename>, yet still display the results
+ onscreen via <command>less</command>.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ You can also combine the <command>tee</command> and
+ <command>pager</command> functions. Have a
+ <command>tee</command> file enabled and <command>pager</command>
+ set to <command>less</command>, and you are able to browse the
+ results using the <command>less</command> program and still have
+ everything appended into a file the same time. The difference
+ between the Unix <command>tee</command> used with the
+ <command>pager</command> command and the
+ <command>mysql</command> built-in <command>tee</command> command
+ is that the built-in <command>tee</command> works even if you do
+ not have the Unix <command>tee</command> available. The built-in
+ <command>tee</command> also logs everything that is printed on
+ the screen, whereas the Unix <command>tee</command> used with
+ <command>pager</command> does not log quite that much.
+ Additionally, <command>tee</command> file logging can be turned
+ on and off interactively from within <command>mysql</command>.
+ This is useful when you want to log some queries to a file, but
+ not others.
+ </para>
+
+ <indexterm>
+ <primary>mysql prompt command</primary>
+ </indexterm>
+
+ <para>
+ The default <literal>mysql></literal> prompt can be
+ reconfigured. The string for defining the prompt can contain the
+ following special sequences:
+ </para>
+
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colwidth="15*"/>
+ <colspec colwidth="75*"/>
+ <tbody>
+ <row>
+ <entry><emphasis role="bold">Option</emphasis></entry>
+ <entry><emphasis role="bold">Description</emphasis></entry>
+ </row>
+ <row>
+ <entry><literal>\v</literal></entry>
+ <entry>The server version</entry>
+ </row>
+ <row>
+ <entry><literal>\d</literal></entry>
+ <entry>The default database</entry>
+ </row>
+ <row>
+ <entry><literal>\h</literal></entry>
+ <entry>The server host</entry>
+ </row>
+ <row>
+ <entry><literal>\p</literal></entry>
+ <entry>The current TCP/IP port or socket file</entry>
+ </row>
+ <row>
+ <entry><literal>\u</literal></entry>
+ <entry>Your username</entry>
+ </row>
+ <row>
+ <entry><literal>\U</literal></entry>
+ <entry>Your full
+ <literal><replaceable>user_name</replaceable>@<replaceable>host_name</replaceable></literal>
+ account name</entry>
+ </row>
+ <row>
+ <entry><literal>\\</literal></entry>
+ <entry>A literal <quote><literal>\</literal></quote> backslash character</entry>
+ </row>
+ <row>
+ <entry><literal>\n</literal></entry>
+ <entry>A newline character</entry>
+ </row>
+ <row>
+ <entry><literal>\t</literal></entry>
+ <entry>A tab character</entry>
+ </row>
+ <row>
+ <entry><literal>\ </literal></entry>
+ <entry>A space (a space follows the backslash)</entry>
+ </row>
+ <row>
+ <entry><literal>\_</literal></entry>
+ <entry>A space</entry>
+ </row>
+ <row>
+ <entry><literal>\R</literal></entry>
+ <entry>The current time, in 24-hour military time (0-23)</entry>
+ </row>
+ <row>
+ <entry><literal>\r</literal></entry>
+ <entry>The current time, standard 12-hour time (1-12)</entry>
+ </row>
+ <row>
+ <entry><literal>\m</literal></entry>
+ <entry>Minutes of the current time</entry>
+ </row>
+ <row>
+ <entry><literal>\y</literal></entry>
+ <entry>The current year, two digits</entry>
+ </row>
+ <row>
+ <entry><literal>\Y</literal></entry>
+ <entry>The current year, four digits</entry>
+ </row>
+ <row>
+ <entry><literal>\D</literal></entry>
+ <entry>The full current date</entry>
+ </row>
+ <row>
+ <entry><literal>\s</literal></entry>
+ <entry>Seconds of the current time</entry>
+ </row>
+ <row>
+ <entry><literal>\w</literal></entry>
+ <entry>The current day of the week in three-letter format (Mon, Tue, …)</entry>
+ </row>
+ <row>
+ <entry><literal>\P</literal></entry>
+ <entry>am/pm</entry>
+ </row>
+ <row>
+ <entry><literal>\o</literal></entry>
+ <entry>The current month in numeric format</entry>
+ </row>
+ <row>
+ <entry><literal>\O</literal></entry>
+ <entry>The current month in three-letter format (Jan, Feb, …)</entry>
+ </row>
+ <row>
+ <entry><literal>\c</literal></entry>
+ <entry>A counter that increments for each statement you issue</entry>
+ </row>
+ <row>
+ <entry><literal>\l</literal></entry>
+ <entry>The current delimiter. (New in 5.1.12)</entry>
+ </row>
+ <row>
+ <entry><literal>\S</literal></entry>
+ <entry>Semicolon</entry>
+ </row>
+ <row>
+ <entry><literal>\'</literal></entry>
+ <entry>Single quote</entry>
+ </row>
+ <row>
+ <entry><literal>\"</literal></entry>
+ <entry>Double quote</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+
+ <para>
+ <quote><literal>\</literal></quote> followed by any other letter
+ just becomes that letter.
+ </para>
+
+ <para>
+ If you specify the <literal>prompt</literal> command with no
+ argument, <command>mysql</command> resets the prompt to the
+ default of <literal>mysql></literal>.
+ </para>
+
+ <para>
+ You can set the prompt in several ways:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <emphasis>Use an environment variable.</emphasis> You can
+ set the <literal>MYSQL_PS1</literal> environment variable to
+ a prompt string. For example:
+ </para>
+
+<programlisting>
+shell> <userinput>export MYSQL_PS1="(\u@\h) [\d]> "</userinput>
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ <emphasis>Use a command-line option.</emphasis> You can set
+ the <option>--prompt</option> option on the command line to
+ <command>mysql</command>. For example:
+ </para>
+
+<programlisting>
+shell> <userinput>mysql --prompt="(\u@\h) [\d]> "</userinput>
+(user@host) [database]>
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ <emphasis>Use an option file.</emphasis> You can set the
+ <literal>prompt</literal> option in the
+ <literal>[mysql]</literal> group of any MySQL option file,
+ such as <filename>/etc/my.cnf</filename> or the
+ <filename>.my.cnf</filename> file in your home directory.
+ For example:
+ </para>
+
+<programlisting>
+[mysql]
+prompt=(\\u@\\h) [\\d]>\\_
+</programlisting>
+
+ <para>
+ In this example, note that the backslashes are doubled. If
+ you set the prompt using the <literal>prompt</literal>
+ option in an option file, it is advisable to double the
+ backslashes when using the special prompt options. There is
+ some overlap in the set of allowable prompt options and the
+ set of special escape sequences that are recognized in
+ option files. (These sequences are listed in
+ <xref linkend="option-files"/>.) The overlap may cause you
+ problems if you use single backslashes. For example,
+ <literal>\s</literal> is interpreted as a space rather than
+ as the current seconds value. The following example shows
+ how to define a prompt within an option file to include the
+ current time in <literal>HH:MM:SS></literal> format:
+ </para>
+
+<programlisting>
+[mysql]
+prompt="\\r:\\m:\\s> "
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ <emphasis>Set the prompt interactively.</emphasis> You can
+ change your prompt interactively by using the
+ <literal>prompt</literal> (or <literal>\R</literal>)
+ command. For example:
+ </para>
+
+<programlisting>
+mysql> <userinput>prompt (\u@\h) [\d]>\_</userinput>
+PROMPT set to '(\u@\h) [\d]>\_'
+(<replaceable>user</replaceable>@<replaceable>host</replaceable>) [<replaceable>database</replaceable>]>
+(<replaceable>user</replaceable>@<replaceable>host</replaceable>) [<replaceable>database</replaceable>]> prompt
+Returning to default PROMPT of mysql>
+mysql><userinput/>
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para/>
+ </listitem>
+
+ </itemizedlist>
+
+ </refsection>
+
+ <refsection id="mysql-server-side-help">
+
+ <title><command>mysql</command> Server-Side Help</title>
+
+ <remark role="help-category" condition="Administration"/>
+
+ <remark role="help-topic" condition="HELP command"/>
+
+ <remark role="help-keywords">
+ HELP
+ </remark>
+
+ <remark role="help-syntax"/>
+
+<programlisting>
+mysql> <userinput>help <replaceable>search_string</replaceable></userinput>
+</programlisting>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ If you provide an argument to the <literal>help</literal>
+ command, <command>mysql</command> uses it as a search string to
+ access server-side help from the contents of the MySQL Reference
+ Manual. The proper operation of this command requires that the
+ help tables in the <literal>mysql</literal> database be
+ initialized with help topic information (see
+ <xref linkend="server-side-help-support"/>).
+ </para>
+
+ <para>
+ If there is no match for the search string, the search fails:
+ </para>
+
+<programlisting>
+mysql> <userinput>help me</userinput>
+
+Nothing found
+Please try to run 'help contents' for a list of all accessible topics
+</programlisting>
+
+ <para>
+ Use <command>help contents</command> to see a list of the help
+ categories:
+ </para>
+
+<programlisting>
+mysql> <userinput>help contents</userinput>
+You asked for help about help category: "Contents"
+For more information, type 'help <item>', where <item> is one of the
+following categories:
+ Account Management
+ Administration
+ Data Definition
+ Data Manipulation
+ Data Types
+ Functions
+ Functions and Modifiers for Use with GROUP BY
+ Geographic Features
+ Language Structure
+ Plugins
+ Storage Engines
+ Stored Routines
+ Table Maintenance
+ Transactions
+ Triggers
+</programlisting>
+
+ <para>
+ If the search string matches multiple items,
+ <command>mysql</command> shows a list of matching topics:
+ </para>
+
+<programlisting>
+mysql> <userinput>help logs</userinput>
+Many help items for your request exist.
+To make a more specific request, please type 'help <item>',
+where <item> is one of the following topics:
+ SHOW
+ SHOW BINARY LOGS
+ SHOW ENGINE
+ SHOW LOGS
+</programlisting>
+
+ <para>
+ Use a topic as the search string to see the help entry for that
+ topic:
+ </para>
+
+<programlisting>
+mysql> <userinput>help show binary logs</userinput>
+Name: 'SHOW BINARY LOGS'
+Description:
+Syntax:
+SHOW BINARY LOGS
+SHOW MASTER LOGS
+
+Lists the binary log files on the server. This statement is used as
+part of the procedure described in [purge-master-logs], that shows how
+to determine which logs can be purged.
+
+mysql> SHOW BINARY LOGS;
++---------------+-----------+
+| Log_name | File_size |
++---------------+-----------+
+| binlog.000015 | 724935 |
+| binlog.000016 | 733481 |
++---------------+-----------+
+</programlisting>
+
+ <remark role="help-description-end"/>
+
+ </refsection>
+
+ <refsection id="batch-commands">
+
+ <title>Executing SQL Statements from a Text File</title>
+
+ <indexterm>
+ <primary>executing SQL statements from text files</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>importing</primary>
+ <secondary>data</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>data</primary>
+ <secondary>importing</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>files</primary>
+ <secondary>text</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>text files</primary>
+ <secondary>importing</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>source (mysql client command)</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>\. (mysql client command)</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>mysql source (command for reading from text files)</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>mysql \. (command for reading from text files)</primary>
+ </indexterm>
+
+ <para>
+ The <command>mysql</command> client typically is used
+ interactively, like this:
+ </para>
+
+<programlisting>
+shell> <userinput>mysql <replaceable>db_name</replaceable></userinput>
+</programlisting>
+
+ <para>
+ However, it is also possible to put your SQL statements in a
+ file and then tell <command>mysql</command> to read its input
+ from that file. To do so, create a text file
+ <replaceable>text_file</replaceable> that contains the
+ statements you wish to execute. Then invoke
+ <command>mysql</command> as shown here:
+ </para>
+
+<programlisting>
+shell> <userinput>mysql <replaceable>db_name</replaceable> < <replaceable>text_file</replaceable></userinput>
+</programlisting>
+
+ <para>
+ If you place a <literal>USE
+ <replaceable>db_name</replaceable></literal> statement as the
+ first statement in the file, it is unnecessary to specify the
+ database name on the command line:
+ </para>
+
+<programlisting>
+shell> <userinput>mysql < text_file</userinput>
+</programlisting>
+
+ <para>
+ If you are already running <command>mysql</command>, you can
+ execute an SQL script file using the <literal>source</literal>
+ command or <literal>\.</literal> command:
+ </para>
+
+<programlisting>
+mysql> <userinput>source <replaceable>file_name</replaceable></userinput>
+mysql> <userinput>\. <replaceable>file_name</replaceable></userinput>
+</programlisting>
+
+ <para>
+ Sometimes you may want your script to display progress
+ information to the user. For this you can insert statements like
+ this:
+ </para>
+
+<programlisting>
+SELECT '<info_to_display>' AS ' ';
+</programlisting>
+
+ <para>
+ The statement shown outputs
+ <literal><info_to_display></literal>.
+ </para>
+
+ <para>
+ As of MySQL 5.1.23, <command>mysql</command> ignores Unicode
+ byte order mark (BOM) characters at the beginning of input
+ files. Previously, it read them and sent them to the server,
+ resulting in a syntax error. Presence of a BOM does not cause
+ <command>mysql</command> to change its default character set. To
+ do that, invoke <command>mysql</command> with an option such as
+ <option>--default-character-set=utf8</option>.
+ </para>
+
+ <para>
+ For more information about batch mode, see
+ <xref linkend="batch-mode"/>.
+ </para>
+
+ </refsection>
+
+ <refsection id="mysql-tips">
+
+ <title><command>mysql</command> Tips</title>
+
+ <para>
+ This section describes some techniques that can help you use
+ <command>mysql</command> more effectively.
+ </para>
+
+ <refsection id="vertical-query-results">
+
+ <title>Displaying Query Results Vertically</title>
+
+ <para>
+ Some query results are much more readable when displayed
+ vertically, instead of in the usual horizontal table format.
+ Queries can be displayed vertically by terminating the query
+ with \G instead of a semicolon. For example, longer text
+ values that include newlines often are much easier to read
+ with vertical output:
+ </para>
+
+<programlisting>
+mysql> <userinput>SELECT * FROM mails WHERE LENGTH(txt) < 300 LIMIT 300,1\G</userinput>
+*************************** 1. row ***************************
+ msg_nro: 3068
+ date: 2000-03-01 23:29:50
+time_zone: +0200
+mail_from: Monty
+ reply: monty@stripped
+ mail_to: "Thimble Smith" <tim@stripped>
+ sbj: UTF-8
+ txt: >>>>> "Thimble" == Thimble Smith writes:
+
+Thimble> Hi. I think this is a good idea. Is anyone familiar
+Thimble> with UTF-8 or Unicode? Otherwise, I'll put this on my
+Thimble> TODO list and see what happens.
+
+Yes, please do that.
+
+Regards,
+Monty
+ file: inbox-jani-1
+ hash: 190402944
+1 row in set (0.09 sec)
+</programlisting>
+
+ </refsection>
+
+ <refsection id="safe-updates">
+
+ <title>Using the <option>--safe-updates</option> Option</title>
+
+ <indexterm>
+ <primary>safe-updates option</primary>
+ </indexterm>
+
+ <para>
+ For beginners, a useful startup option is
+ <option>--safe-updates</option> (or
+ <option>--i-am-a-dummy</option>, which has the same effect).
+ It is helpful for cases when you might have issued a
+ <literal>DELETE FROM
+ <replaceable>tbl_name</replaceable></literal> statement but
+ forgotten the <literal>WHERE</literal> clause. Normally, such
+ a statement deletes all rows from the table. With
+ <option>--safe-updates</option>, you can delete rows only by
+ specifying the key values that identify them. This helps
+ prevent accidents.
+ </para>
+
+ <para>
+ When you use the <option>--safe-updates</option> option,
+ <command>mysql</command> issues the following statement when
+ it connects to the MySQL server:
+ </para>
+
+<programlisting>
+SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=1000, SQL_MAX_JOIN_SIZE=1000000;
+</programlisting>
+
+ <para>
+ See <xref linkend="set-option"/>.
+ </para>
+
+ <para>
+ The <literal>SET</literal> statement has the following
+ effects:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ You are not allowed to execute an
+ <literal>UPDATE</literal> or <literal>DELETE</literal>
+ statement unless you specify a key constraint in the
+ <literal>WHERE</literal> clause or provide a
+ <literal>LIMIT</literal> clause (or both). For example:
+ </para>
+
+<programlisting>
+UPDATE <replaceable>tbl_name</replaceable> SET <replaceable>not_key_column</replaceable>=<replaceable>val</replaceable> WHERE <replaceable>key_column</replaceable>=<replaceable>val</replaceable>;
+
+UPDATE <replaceable>tbl_name</replaceable> SET <replaceable>not_key_column</replaceable>=<replaceable>val</replaceable> LIMIT 1;
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ The server limits all large <literal>SELECT</literal>
+ results to 1,000 rows unless the statement includes a
+ <literal>LIMIT</literal> clause.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ The server aborts multiple-table <literal>SELECT</literal>
+ statements that probably need to examine more than
+ 1,000,000 row combinations.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ To specify limits different from 1,000 and 1,000,000, you can
+ override the defaults by using the
+ <option>--select_limit</option> and
+ <option>--max_join_size</option> options:
+ </para>
+
+<programlisting>
+shell> <userinput>mysql --safe-updates --select_limit=500 --max_join_size=10000</userinput>
+</programlisting>
+
+ </refsection>
+
+ <refsection id="mysql-reconnect">
+
+ <title>Disabling <command>mysql</command> Auto-Reconnect</title>
+
+ <para>
+ If the <command>mysql</command> client loses its connection to
+ the server while sending a statement, it immediately and
+ automatically tries to reconnect once to the server and send
+ the statement again. However, even if <command>mysql</command>
+ succeeds in reconnecting, your first connection has ended and
+ all your previous session objects and settings are lost:
+ temporary tables, the autocommit mode, and user-defined and
+ session variables. Also, any current transaction rolls back.
+ This behavior may be dangerous for you, as in the following
+ example where the server was shut down and restarted between
+ the first and second statements without you knowing it:
+ </para>
+
+<programlisting>
+mysql> <userinput>SET @a=1;</userinput>
+Query OK, 0 rows affected (0.05 sec)
+
+mysql> <userinput>INSERT INTO t VALUES(@a);</userinput>
+ERROR 2006: MySQL server has gone away
+No connection. Trying to reconnect...
+Connection id: 1
+Current database: test
+
+Query OK, 1 row affected (1.30 sec)
+
+mysql> <userinput>SELECT * FROM t;</userinput>
++------+
+| a |
++------+
+| NULL |
++------+
+1 row in set (0.05 sec)
+</programlisting>
+
+ <para>
+ The <literal>@a</literal> user variable has been lost with the
+ connection, and after the reconnection it is undefined. If it
+ is important to have <command>mysql</command> terminate with
+ an error if the connection has been lost, you can start the
+ <command>mysql</command> client with the
+ <option>--skip-reconnect</option> option.
+ </para>
+
+ <para>
+ For more information about auto-reconnect and its effect on
+ state information when a reconnection occurs, see
+ <xref linkend="auto-reconnect"/>.
+ </para>
+
+ </refsection>
+
+ </refsection>
+
+ </refentry>
+
+ <refentry id="mysqladmin">
+
+ <indexterm>
+ <primary>mysqladmin</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>administration</primary>
+ <secondary>server</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>server administration</primary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle><command>mysqladmin</command></refentrytitle>
+
+ <manvolnum>1</manvolnum>
+ <refmiscinfo class="manual">MySQL Database System</refmiscinfo>
+ <refmiscinfo class="source">MySQL</refmiscinfo>
+ <refmiscinfo class="version">¤t-series;</refmiscinfo>
+ <refmiscinfo class="refman">Client for Administering a MySQL Server</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>mysqladmin</refname>
+
+ <refpurpose>client for administering a MySQL server</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>mysqladmin [<replaceable>options</replaceable>] <replaceable>command</replaceable> [<replaceable>command-options</replaceable>] [<replaceable>command</replaceable> [<replaceable>command-options</replaceable>]] ...</command>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsection id="mysqladmin-description">
+
+ <title>Description</title>
+
+ <para>
+ <command>mysqladmin</command> is a client for performing
+ administrative operations. You can use it to check the server's
+ configuration and current status, to create and drop databases,
+ and more.
+ </para>
+
+ <para>
+ Invoke <command>mysqladmin</command> like this:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqladmin [<replaceable>options</replaceable>] <replaceable>command</replaceable> [<replaceable>command-arg</replaceable>] [<replaceable>command</replaceable> [<replaceable>command-arg</replaceable>]] ...</userinput>
+</programlisting>
+
+ <para>
+ <command>mysqladmin</command> supports the commands described in
+ the following list. Some of the commands take an argument
+ following the command name.
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para id="command_mysqladmin_db_name">
+ <literal>create <replaceable>db_name</replaceable></literal>
+ </para>
+
+ <para>
+ Create a new database named
+ <replaceable>db_name</replaceable>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_debug">
+ <literal>debug</literal>
+ </para>
+
+ <para>
+ Tell the server to write debug information to the error log.
+ </para>
+
+ <para>
+ Beginning with MySQL 5.1.12, this includes information about
+ the Event Scheduler. See
+ <xref linkend="events-status-info"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_debug-check">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>debug-check option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug-check option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--debug-check</option>
+ </para>
+
+ <para>
+ Print some debugging information when the program exits.
+ This option was added in MySQL 5.1.21.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_debug-info">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>debug-info option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug-info option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--debug-info</option>
+ </para>
+
+ <para>
+ Print debugging information and memory and CPU usage
+ statistics when the program exits. This option was added in
+ MySQL 5.1.21.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_drop">
+ <literal>drop <replaceable>db_name</replaceable></literal>
+ </para>
+
+ <para>
+ Delete the database named <replaceable>db_name</replaceable>
+ and all its tables.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_extended-status">
+ <literal>extended-status</literal>
+ </para>
+
+ <para>
+ Display the server status variables and their values.
+ </para>
+
+ <formalpara role="mnmas">
+
+ <title>MySQL Enterprise</title>
+
+ <para>
+ For expert advice on using server status variables,
+ subscribe to the MySQL Enterprise Monitor. For more
+ information see
+ <ulink url="&base-url-enterprise;advisors.html"/>.
+ </para>
+
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_flush-hosts">
+ <literal>flush-hosts</literal>
+ </para>
+
+ <para>
+ Flush all information in the host cache.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_flush-logs">
+ <literal>flush-logs</literal>
+ </para>
+
+ <para>
+ Flush all logs.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_flush-privileges">
+ <literal>flush-privileges</literal>
+ </para>
+
+ <para>
+ Reload the grant tables (same as <literal>reload</literal>).
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_flush-status">
+ <literal>flush-status</literal>
+ </para>
+
+ <para>
+ Clear status variables.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_flush-tables">
+ <literal>flush-tables</literal>
+ </para>
+
+ <para>
+ Flush all tables.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_flush-threads">
+ <literal>flush-threads</literal>
+ </para>
+
+ <para>
+ Flush the thread cache.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_kill">
+ <literal>kill
+ <replaceable>id</replaceable>,<replaceable>id</replaceable>,...</literal>
+ </para>
+
+ <para>
+ Kill server threads. If multiple thread ID values are given,
+ there must be no spaces in the list.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_old-password">
+ <literal>old-password
+ <replaceable>new-password</replaceable></literal>
+ </para>
+
+ <para>
+ This is like the <literal>password</literal> command but
+ stores the password using the old (pre-4.1) password-hashing
+ format. (See <xref linkend="password-hashing"/>.)
+ </para>
+
+ <formalpara role="mnmas">
+
+ <title>MySQL Enterprise</title>
+
+ <para>
+ For expert advice on the security implications of using
+ the <literal>old-password</literal> command, subscribe to
+ the MySQL Enterprise Monitor. For more information see
+ <ulink url="&base-url-enterprise;advisors.html"/>.
+ </para>
+
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_password">
+ <literal>password
+ <replaceable>new-password</replaceable></literal>
+ </para>
+
+ <para>
+ Set a new password. This changes the password to
+ <replaceable>new-password</replaceable> for the account that
+ you use with <command>mysqladmin</command> for connecting to
+ the server. Thus, the next time you invoke
+ <command>mysqladmin</command> (or any other client program)
+ using the same account, you will need to specify the new
+ password.
+ </para>
+
+ <para>
+ If the <replaceable>new-password</replaceable> value
+ contains spaces or other characters that are special to your
+ command interpreter, you need to enclose it within quotes.
+ On Windows, be sure to use double quotes rather than single
+ quotes; single quotes are not stripped from the password,
+ but rather are interpreted as part of the password. For
+ example:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqladmin password "my new password"</userinput>
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_ping">
+ <literal>ping</literal>
+ </para>
+
+ <para>
+ Check whether the server is alive. The return status from
+ <command>mysqladmin</command> is 0 if the server is running,
+ 1 if it is not. This is 0 even in case of an error such as
+ <literal>Access denied</literal>, because this means that
+ the server is running but refused the connection, which is
+ different from the server not running.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_processlist">
+ <literal>processlist</literal>
+ </para>
+
+ <para>
+ Show a list of active server threads. This is like the
+ output of the <literal>SHOW PROCESSLIST</literal> statement.
+ If the <option>--verbose</option> option is given, the
+ output is like that of <literal>SHOW FULL
+ PROCESSLIST</literal>. (See
+ <xref linkend="show-processlist"/>.)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_reload">
+ <literal>reload</literal>
+ </para>
+
+ <para>
+ Reload the grant tables.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_refresh">
+ <literal>refresh</literal>
+ </para>
+
+ <para>
+ Flush all tables and close and open log files.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_shutdown">
+ <literal>shutdown</literal>
+ </para>
+
+ <para>
+ Stop the server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_start-slave">
+ <literal>start-slave</literal>
+ </para>
+
+ <para>
+ Start replication on a slave server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_status">
+ <literal>status</literal>
+ </para>
+
+ <para>
+ Display a short server status message.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_stop-slave">
+ <literal>stop-slave</literal>
+ </para>
+
+ <para>
+ Stop replication on a slave server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_variables">
+ <literal>variables</literal>
+ </para>
+
+ <para>
+ Display the server system variables and their values.
+ </para>
+
+ <formalpara role="mnmas">
+
+ <title>MySQL Enterprise</title>
+
+ <para>
+ For expert advice on using server system variables,
+ subscribe to the MySQL Enterprise Monitor. For more
+ information see
+ <ulink url="&base-url-enterprise;advisors.html"/>.
+ </para>
+
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <para id="command_mysqladmin_version">
+ <literal>version</literal>
+ </para>
+
+ <para>
+ Display version information from the server.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ All commands can be shortened to any unique prefix. For example:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqladmin proc stat</userinput>
++----+-------+-----------+----+---------+------+-------+------------------+
+| Id | User | Host | db | Command | Time | State | Info |
++----+-------+-----------+----+---------+------+-------+------------------+
+| 51 | monty | localhost | | Query | 0 | | show processlist |
++----+-------+-----------+----+---------+------+-------+------------------+
+Uptime: 1473624 Threads: 1 Questions: 39487
+Slow queries: 0 Opens: 541 Flush tables: 1
+Open tables: 19 Queries per second avg: 0.0268
+</programlisting>
+
+ <indexterm>
+ <primary>status command</primary>
+ <secondary>results</secondary>
+ </indexterm>
+
+ <para>
+ The <command>mysqladmin status</command> command result displays
+ the following values:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>uptime</primary>
+ </indexterm>
+
+ <literal>Uptime</literal>
+ </para>
+
+ <para>
+ The number of seconds the MySQL server has been running.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>threads</primary>
+ </indexterm>
+
+ <literal>Threads</literal>
+ </para>
+
+ <para>
+ The number of active threads (clients).
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>questions</primary>
+ </indexterm>
+
+ <literal>Questions</literal>
+ </para>
+
+ <para>
+ The number of questions (queries) from clients since the
+ server was started.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>slow queries</primary>
+ </indexterm>
+
+ <literal>Slow queries</literal>
+ </para>
+
+ <para>
+ The number of queries that have taken more than
+ <literal>long_query_time</literal> seconds. See
+ <xref linkend="slow-query-log"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>opens</primary>
+ </indexterm>
+
+ <literal>Opens</literal>
+ </para>
+
+ <para>
+ The number of tables the server has opened.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>flush tables</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>tables</primary>
+ <secondary>flush</secondary>
+ </indexterm>
+
+ <literal>Flush tables</literal>
+ </para>
+
+ <para>
+ The number of <literal>flush-*</literal>,
+ <literal>refresh</literal>, and <literal>reload</literal>
+ commands the server has executed.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>open tables</primary>
+ </indexterm>
+
+ <literal>Open tables</literal>
+ </para>
+
+ <para>
+ The number of tables that currently are open.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>memory use</primary>
+ </indexterm>
+
+ <literal>Memory in use</literal>
+ </para>
+
+ <para>
+ The amount of memory allocated directly by
+ <command>mysqld</command>. This value is displayed only when
+ MySQL has been compiled with
+ <option>--with-debug=full</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>maximum memory used</primary>
+ </indexterm>
+
+ <literal>Maximum memory used</literal>
+ </para>
+
+ <para>
+ The maximum amount of memory allocated directly by
+ <command>mysqld</command>. This value is displayed only when
+ MySQL has been compiled with
+ <option>--with-debug=full</option>.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ If you execute <command>mysqladmin shutdown</command> when
+ connecting to a local server using a Unix socket file,
+ <command>mysqladmin</command> waits until the server's process
+ ID file has been removed, to ensure that the server has stopped
+ properly.
+ </para>
+
+ <indexterm>
+ <primary>mysqladmin command options</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>command options</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>options</primary>
+ <secondary>command-line</secondary>
+ <tertiary>mysqladmin</tertiary>
+ </indexterm>
+
+ <indexterm>
+ <primary>startup parameters</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <para>
+ <command>mysqladmin</command> supports the following options:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para id="option_mysqladmin_help">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>help option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>help option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--help</option>, <option>-?</option>
+ </para>
+
+ <para>
+ Display a help message and exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_character-sets-dir">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>character-sets-dir option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>character-sets-dir option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--character-sets-dir=<replaceable>path</replaceable></option>
+ </para>
+
+ <para>
+ The directory where character sets are installed. See
+ <xref linkend="charset-configuration"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_compress">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>compress option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>compress option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--compress</option>, <option>-C</option>
+ </para>
+
+ <para>
+ Compress all information sent between the client and the
+ server if both support compression.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_count">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>count option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>count option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--count=<replaceable>N</replaceable></option>,
+ <option>-c <replaceable>N</replaceable></option>
+ </para>
+
+ <para>
+ The number of iterations to make for repeated command
+ execution. This works only with the <option>--sleep</option>
+ option.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_debug">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>debug option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--debug[=<replaceable>debug_options</replaceable>]</option>,
+ <option>-#
+ [<replaceable>debug_options</replaceable>]</option>
+ </para>
+
+ <para>
+ Write a debugging log. The
+ <replaceable>debug_options</replaceable> string often is
+ <literal>'d:t:o,<replaceable>file_name</replaceable>'</literal>.
+ The default is
+ <literal>'d:t:o,/tmp/mysqladmin.trace'</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_default-character-set">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>default-character-set option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>default-character-set option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--default-character-set=<replaceable>charset_name</replaceable></option>
+ </para>
+
+ <para>
+ Use <replaceable>charset_name</replaceable> as the default
+ character set. See <xref linkend="charset-configuration"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_force">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>force option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>force option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--force</option>, <option>-f</option>
+ </para>
+
+ <para>
+ Do not ask for confirmation for the <literal>drop
+ <replaceable>db_name</replaceable></literal> command. With
+ multiple commands, continue even if an error occurs.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_host">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>host option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>host option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--host=<replaceable>host_name</replaceable></option>,
+ <option>-h <replaceable>host_name</replaceable></option>
+ </para>
+
+ <para>
+ Connect to the MySQL server on the given host.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_no-beep">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>no-beep option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>no-beep option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--no-beep</option>, <option>-b</option>
+ </para>
+
+ <para>
+ Suppress the warning beep that is emitted by default for
+ errors such as a failure to connect to the server. This
+ option was added in MySQL 5.1.17.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_password">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>password option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>password option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--password[=<replaceable>password</replaceable>]</option>,
+ <option>-p[<replaceable>password</replaceable>]</option>
+ </para>
+
+ <para>
+ The password to use when connecting to the server. If you
+ use the short option form (<option>-p</option>), you
+ <emphasis>cannot</emphasis> have a space between the option
+ and the password. If you omit the
+ <replaceable>password</replaceable> value following the
+ <option>--password</option> or <option>-p</option> option on
+ the command line, you are prompted for one.
+ </para>
+
+ <para>
+ Specifying a password on the command line should be
+ considered insecure. See
+ <xref linkend="password-security"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_port">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>port option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>port option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--port=<replaceable>port_num</replaceable></option>,
+ <option>-P <replaceable>port_num</replaceable></option>
+ </para>
+
+ <para>
+ The TCP/IP port number to use for the connection.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_protocol">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>protocol option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>protocol option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--protocol={TCP|SOCKET|PIPE|MEMORY}</option>
+ </para>
+
+ <para>
+ The connection protocol to use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_relative">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>relative option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>relative option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--relative</option>, <option>-r</option>
+ </para>
+
+ <para>
+ Show the difference between the current and previous values
+ when used with the <option>--sleep</option> option.
+ Currently, this option works only with the
+ <literal>extended-status</literal> command.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_silent">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>silent option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>silent option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--silent</option>, <option>-s</option>
+ </para>
+
+ <para>
+ Exit silently if a connection to the server cannot be
+ established.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_sleep">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>sleep option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>sleep option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--sleep=<replaceable>delay</replaceable></option>,
+ <option>-i <replaceable>delay</replaceable></option>
+ </para>
+
+ <para>
+ Execute commands repeatedly, sleeping for
+ <replaceable>delay</replaceable> seconds in between. The
+ <option>--count</option> option determines the number of
+ iterations.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_socket">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>socket option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>socket option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--socket=<replaceable>path</replaceable></option>,
+ <option>-S <replaceable>path</replaceable></option>
+ </para>
+
+ <para>
+ For connections to <literal>localhost</literal>, the Unix
+ socket file to use, or, on Windows, the name of the named
+ pipe to use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_ssl">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>SSL options</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>SSL options</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--ssl*</option>
+ </para>
+
+ <para>
+ Options that begin with <option>--ssl</option> specify
+ whether to connect to the server via SSL and indicate where
+ to find SSL keys and certificates. See
+ <xref linkend="ssl-options"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_user">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>user option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>user option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--user=<replaceable>user_name</replaceable></option>,
+ <option>-u <replaceable>user_name</replaceable></option>
+ </para>
+
+ <para>
+ The MySQL username to use when connecting to the server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_verbose">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>verbose option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>verbose option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--verbose</option>, <option>-v</option>
+ </para>
+
+ <para>
+ Verbose mode. Print more information about what the program
+ does.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_version">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>version option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>version option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--version</option>, <option>-V</option>
+ </para>
+
+ <para>
+ Display version information and exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_vertical">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>vertical option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>vertical option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--vertical</option>, <option>-E</option>
+ </para>
+
+ <para>
+ Print output vertically. This is similar to
+ <option>--relative</option>, but prints output vertically.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_wait">
+ <indexterm>
+ <primary>mysqladmin</primary>
+ <secondary>wait option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>wait option</primary>
+ <secondary>mysqladmin</secondary>
+ </indexterm>
+
+ <option>--wait[=<replaceable>count</replaceable>]</option>,
+ <option>-w[<replaceable>count</replaceable>]</option>
+ </para>
+
+ <para>
+ If the connection cannot be established, wait and retry
+ instead of aborting. If a <replaceable>count</replaceable>
+ value is given, it indicates the number of times to retry.
+ The default is one time.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ You can also set the following variables by using
+ <option>--<replaceable>var_name</replaceable>=<replaceable>value</replaceable></option>
+ syntax:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para id="option_mysqladmin_connect_timeout">
+ <indexterm>
+ <primary>connect_timeout variable</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>timeout</primary>
+ <secondary>connect_timeout variable</secondary>
+ </indexterm>
+
+ <literal>connect_timeout</literal>
+ </para>
+
+ <para>
+ The maximum number of seconds before connection timeout. The
+ default value is 43200 (12 hours).
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqladmin_shutdown_timeout">
+ <indexterm>
+ <primary>shutdown_timeout variable</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>timeout</primary>
+ <secondary>shutdown_timeout variable</secondary>
+ </indexterm>
+
+ <literal>shutdown_timeout</literal>
+ </para>
+
+ <para>
+ The maximum number of seconds to wait for server shutdown.
+ The default value is 3600 (1 hour).
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ It is also possible to set variables by using
+ <option>--set-variable=<replaceable>var_name</replaceable>=<replaceable>value</replaceable></option>
+ or <option>-O
+ <replaceable>var_name</replaceable>=<replaceable>value</replaceable></option>
+ syntax. <emphasis>This syntax is deprecated</emphasis>.
+ </para>
+
+ </refsection>
+
+ </refentry>
+
+ <refentry id="mysqlcheck">
+
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>maintenance</primary>
+ <secondary>tables</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>repair</primary>
+ <secondary>tables</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>tables</primary>
+ <secondary>maintenance</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>tables</primary>
+ <secondary>repair</secondary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle><command>mysqlcheck</command></refentrytitle>
+
+ <manvolnum>1</manvolnum>
+ <refmiscinfo class="manual">MySQL Database System</refmiscinfo>
+ <refmiscinfo class="source">MySQL</refmiscinfo>
+ <refmiscinfo class="version">¤t-series;</refmiscinfo>
+ <refmiscinfo class="refman">A Table Maintenance and Repair Program</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>mysqlcheck</refname>
+
+ <refpurpose>a table maintenance and repair program</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>mysqlcheck [<replaceable>options</replaceable>] [<replaceable>db_name</replaceable> [<replaceable>tbl_name</replaceable> ...]]</command>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsection id="mysqlcheck-description">
+
+ <title>Description</title>
+
+ <remark role="todo">
+ This is no longer fully accurate. mysqlcheck can be used for
+ some operations on storage engines other than MyISAM. There
+ probably should be more reference to this program from within
+ the table maintenance section.
+ </remark>
+
+ <para>
+ The <command>mysqlcheck</command> client checks, repairs,
+ optimizes, and analyzes tables.
+ </para>
+
+ <para>
+ <command>mysqlcheck</command> is similar in function to
+ <command>myisamchk</command>, but works differently. The main
+ operational difference is that <command>mysqlcheck</command>
+ must be used when the <command>mysqld</command> server is
+ running, whereas <command>myisamchk</command> should be used
+ when it is not. The benefit of using
+ <command>mysqlcheck</command> is that you do not have to stop
+ the server to check or repair your tables.
+ </para>
+
+ <para>
+ <command>mysqlcheck</command> uses the SQL statements
+ <literal>CHECK TABLE</literal>, <literal>REPAIR TABLE</literal>,
+ <literal>ANALYZE TABLE</literal>, and <literal>OPTIMIZE
+ TABLE</literal> in a convenient way for the user. It determines
+ which statements to use for the operation you want to perform,
+ and then sends the statements to the server to be executed. For
+ details about which storage engines each statement works with,
+ see the descriptions for those statements in
+ <xref linkend="sql-syntax"/>.
+ </para>
+
+ <para>
+ The <literal>MyISAM</literal> storage engine supports all four
+ statements, so <command>mysqlcheck</command> can be used to
+ perform all four operations on <literal>MyISAM</literal> tables.
+ Other storage engines do not necessarily support all operations.
+ In such cases, an error message is displayed. For example, if
+ <literal>test.t</literal> is a <literal>MEMORY</literal> table,
+ an attempt to check it produces this result:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqlcheck test t</userinput>
+test.t
+note : The storage engine for the table doesn't support check
+</programlisting>
+
+ <caution>
+ <para>
+ It is best to make a backup of a table before performing a
+ table repair operation; under some circumstances the operation
+ might cause data loss. Possible causes include but are not
+ limited to filesystem errors.
+ </para>
+ </caution>
+
+ <para>
+ There are three general ways to invoke
+ <command>mysqlcheck</command>:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqlcheck [<replaceable>options</replaceable>] <replaceable>db_name</replaceable> [<replaceable>tables</replaceable>]</userinput>
+shell> <userinput>mysqlcheck [<replaceable>options</replaceable>] --databases <replaceable>db_name1</replaceable> [<replaceable>db_name2</replaceable> <replaceable>db_name3</replaceable>...]</userinput>
+shell> <userinput>mysqlcheck [<replaceable>options</replaceable>] --all-databases</userinput>
+</programlisting>
+
+ <para>
+ If you do not name any tables following
+ <replaceable>db_name</replaceable> or if you use the
+ <option>--databases</option> or <option>--all-databases</option>
+ option, entire databases are checked.
+ </para>
+
+ <para>
+ <command>mysqlcheck</command> has a special feature compared to
+ other client programs. The default behavior of checking tables
+ (<option>--check</option>) can be changed by renaming the
+ binary. If you want to have a tool that repairs tables by
+ default, you should just make a copy of
+ <command>mysqlcheck</command> named
+ <command>mysqlrepair</command>, or make a symbolic link to
+ <command>mysqlcheck</command> named
+ <command>mysqlrepair</command>. If you invoke
+ <command>mysqlrepair</command>, it repairs tables.
+ </para>
+
+ <para>
+ The following names can be used to change
+ <command>mysqlcheck</command> default behavior:
+ </para>
+
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colwidth="25*"/>
+ <colspec colwidth="75*"/>
+ <tbody>
+ <row>
+ <entry><command>mysqlrepair</command></entry>
+ <entry>The default option is <option>--repair</option></entry>
+ </row>
+ <row>
+ <entry><command>mysqlanalyze</command></entry>
+ <entry>The default option is <option>--analyze</option></entry>
+ </row>
+ <row>
+ <entry><command>mysqloptimize</command></entry>
+ <entry>The default option is <option>--optimize</option></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+
+ <para>
+ <command>mysqlcheck</command> supports the following options:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para id="option_mysqlcheck_help">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>help option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>help option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--help</option>, <option>-?</option>
+ </para>
+
+ <para>
+ Display a help message and exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_all-databases">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>all-databases option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>all-databases option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--all-databases</option>, <option>-A</option>
+ </para>
+
+ <para>
+ Check all tables in all databases. This is the same as using
+ the <option>--databases</option> option and naming all the
+ databases on the command line.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_all-in-1 ">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>all-in-1 option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>all-in-1 option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--all-in-1</option>, <option>-1</option>
+ </para>
+
+ <para>
+ Instead of issuing a statement for each table, execute a
+ single statement for each database that names all the tables
+ from that database to be processed.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_analyze">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>analyze option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>analyze option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--analyze</option>, <option>-a</option>
+ </para>
+
+ <para>
+ Analyze the tables.
+ </para>
+
+ <formalpara role="mnmas">
+
+ <title>MySQL Enterprise</title>
+
+ <para>
+ For expert advice on optimizing tables, subscribe to the
+ MySQL Enterprise Monitor. For more information see
+ <ulink url="&base-url-enterprise;advisors.html"/>.
+ </para>
+
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_auto-repair">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>auto-repair option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>auto-repair option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--auto-repair</option>
+ </para>
+
+ <para>
+ If a checked table is corrupted, automatically fix it. Any
+ necessary repairs are done after all tables have been
+ checked.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_character-sets-dir">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>character-sets-dir option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>character-sets-dir option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--character-sets-dir=<replaceable>path</replaceable></option>
+ </para>
+
+ <para>
+ The directory where character sets are installed. See
+ <xref linkend="charset-configuration"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_check">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>check option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>check option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--check</option>, <option>-c</option>
+ </para>
+
+ <para>
+ Check the tables for errors. This is the default operation.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_check-only-changed">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>check-only-changed option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>check-only-changed option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--check-only-changed</option>, <option>-C</option>
+ </para>
+
+ <para>
+ Check only tables that have changed since the last check or
+ that have not been closed properly.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="coption_mysqlcheck_check-upgrade">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>check-upgrade option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>check-upgrade option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--check-upgrade</option>, <option>-g</option>
+ </para>
+
+ <para>
+ Invoke <literal>CHECK TABLE</literal> with the <literal>FOR
+ UPGRADE</literal> option to check tables for
+ incompatibilities with the current version of the server.
+ This option automatically enables the
+ <option>--fix-db-names</option> and
+ <option>--fix-table-names</option> options.
+ <option>--check-upgrade</option> was added in MySQL 5.1.7.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_compress">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>compress option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>compress option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--compress</option>
+ </para>
+
+ <para>
+ Compress all information sent between the client and the
+ server if both support compression.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_databases">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>databases option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>databases option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--databases</option>, <option>-B</option>
+ </para>
+
+ <para>
+ Process all tables in the named databases. Normally,
+ <command>mysqlcheck</command> treats the first name argument
+ on the command line as a database name and following names
+ as table names. With this option, it treats all name
+ arguments as database names.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_debug">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>debug option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--debug[=<replaceable>debug_options</replaceable>]</option>,
+ <option>-#
+ [<replaceable>debug_options</replaceable>]</option>
+ </para>
+
+ <para>
+ Write a debugging log. A typical
+ <replaceable>debug_options</replaceable> string is often
+ <literal>'d:t:o,<replaceable>file_name</replaceable>'</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_debug-check">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>debug-check option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug-check option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--debug-check</option>
+ </para>
+
+ <para>
+ Print some debugging information when the program exits.
+ This option was added in MySQL 5.1.21.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_debug-info">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>debug-info option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug-info option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--debug-info</option>
+ </para>
+
+ <para>
+ Print debugging information and memory and CPU usage
+ statistics when the program exits. This option was added in
+ MySQL 5.1.21.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_default-character-set">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>default-character-set option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>default-character-set option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--default-character-set=<replaceable>charset_name</replaceable></option>
+ </para>
+
+ <para>
+ Use <replaceable>charset_name</replaceable> as the default
+ character set. See <xref linkend="charset-configuration"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_extended">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>extended option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>extended option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--extended</option>, <option>-e</option>
+ </para>
+
+ <para>
+ If you are using this option to check tables, it ensures
+ that they are 100% consistent but takes a long time.
+ </para>
+
+ <para>
+ If you are using this option to repair tables, it runs an
+ extended repair that may not only take a long time to
+ execute, but may produce a lot of garbage rows also!
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_fast">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>fast option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>fast option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--fast</option>, <option>-F</option>
+ </para>
+
+ <para>
+ Check only tables that have not been closed properly.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_fix-db-names">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>fix-db-names option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>fix-db-names option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--fix-db-names</option>
+ </para>
+
+ <para>
+ Convert database names to 5.1 format. Only database names
+ that contain special characters are affected. This option
+ was added in MySQL 5.1.7.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_fix-table-names">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>fix-table-names option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>fix-table-names option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--fix-table-names</option>
+ </para>
+
+ <para>
+ Convert table names to 5.1 format. Only table names that
+ contain special characters are affected. This option was
+ added in MySQL 5.1.7. As of MySQL 5.1.23, this option also
+ applies to views.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_force">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>force option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>force option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--force</option>, <option>-f</option>
+ </para>
+
+ <para>
+ Continue even if an SQL error occurs.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_host">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>host option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>host option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--host=<replaceable>host_name</replaceable></option>,
+ <option>-h <replaceable>host_name</replaceable></option>
+ </para>
+
+ <para>
+ Connect to the MySQL server on the given host.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_medium-check">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>medium-check option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>medium-check option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--medium-check</option>, <option>-m</option>
+ </para>
+
+ <para>
+ Do a check that is faster than an
+ <option>--extended</option> operation. This finds only
+ 99.99% of all errors, which should be good enough in most
+ cases.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_optimized">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>optimize option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>optimize option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--optimize</option>, <option>-o</option>
+ </para>
+
+ <para>
+ Optimize the tables.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_password">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>password option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>password option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--password[=<replaceable>password</replaceable>]</option>,
+ <option>-p[<replaceable>password</replaceable>]</option>
+ </para>
+
+ <para>
+ The password to use when connecting to the server. If you
+ use the short option form (<option>-p</option>), you
+ <emphasis>cannot</emphasis> have a space between the option
+ and the password. If you omit the
+ <replaceable>password</replaceable> value following the
+ <option>--password</option> or <option>-p</option> option on
+ the command line, you are prompted for one.
+ </para>
+
+ <para>
+ Specifying a password on the command line should be
+ considered insecure. See
+ <xref linkend="password-security"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_port">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>port option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>port option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--port=<replaceable>port_num</replaceable></option>,
+ <option>-P <replaceable>port_num</replaceable></option>
+ </para>
+
+ <para>
+ The TCP/IP port number to use for the connection.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_protocol">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>protocol option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>protocol option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--protocol={TCP|SOCKET|PIPE|MEMORY}</option>
+ </para>
+
+ <para>
+ The connection protocol to use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_quick">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>quick option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>quick option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--quick</option>, <option>-q</option>
+ </para>
+
+ <para>
+ If you are using this option to check tables, it prevents
+ the check from scanning the rows to check for incorrect
+ links. This is the fastest check method.
+ </para>
+
+ <para>
+ If you are using this option to repair tables, it tries to
+ repair only the index tree. This is the fastest repair
+ method.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_repair">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>repair option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>repair option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--repair</option>, <option>-r</option>
+ </para>
+
+ <para>
+ Perform a repair that can fix almost anything except unique
+ keys that are not unique.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_silent">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>silent option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>silent option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--silent</option>, <option>-s</option>
+ </para>
+
+ <para>
+ Silent mode. Print only error messages.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_socket">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>socket option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>socket option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--socket=<replaceable>path</replaceable></option>,
+ <option>-S <replaceable>path</replaceable></option>
+ </para>
+
+ <para>
+ For connections to <literal>localhost</literal>, the Unix
+ socket file to use, or, on Windows, the name of the named
+ pipe to use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_ssl">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>SSL options</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>SSL options</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--ssl*</option>
+ </para>
+
+ <para>
+ Options that begin with <option>--ssl</option> specify
+ whether to connect to the server via SSL and indicate where
+ to find SSL keys and certificates. See
+ <xref linkend="ssl-options"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_tables">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>tables option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>tables option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--tables</option>
+ </para>
+
+ <para>
+ Overrides the <option>--databases</option> or
+ <option>-B</option> option. All name arguments following the
+ option are regarded as table names.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_use-frm">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>use-frm option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>use-frm option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--use-frm</option>
+ </para>
+
+ <para>
+ For repair operations on <literal>MyISAM</literal> tables,
+ get the table structure from the <filename>.frm</filename>
+ file so that the table can be repaired even if the
+ <filename>.MYI</filename> header is corrupted.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_user">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>user option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>user option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--user=<replaceable>user_name</replaceable></option>,
+ <option>-u <replaceable>user_name</replaceable></option>
+ </para>
+
+ <para>
+ The MySQL username to use when connecting to the server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_verbose">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>verbose option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>verbose option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--verbose</option>, <option>-v</option>
+ </para>
+
+ <para>
+ Verbose mode. Print information about the various stages of
+ program operation.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlcheck_version">
+ <indexterm>
+ <primary>mysqlcheck</primary>
+ <secondary>version option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>version option</primary>
+ <secondary>mysqlcheck</secondary>
+ </indexterm>
+
+ <option>--version</option>, <option>-V</option>
+ </para>
+
+ <para>
+ Display version information and exit.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ </refsection>
+
+ </refentry>
+
+ <refentry id="mysqldump">
+
+ <indexterm>
+ <primary>mysqldump</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>dumping</primary>
+ <secondary>databases and tables</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>backups</primary>
+ <secondary>databases and tables</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>databases</primary>
+ <secondary>dumping</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>tables</primary>
+ <secondary>dumping</secondary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle><command>mysqldump</command></refentrytitle>
+
+ <manvolnum>1</manvolnum>
+ <refmiscinfo class="manual">MySQL Database System</refmiscinfo>
+ <refmiscinfo class="source">MySQL</refmiscinfo>
+ <refmiscinfo class="version">¤t-series;</refmiscinfo>
+ <refmiscinfo class="refman">A Database Backup Program</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>mysqldump</refname>
+
+ <refpurpose>a database backup program</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>mysqldump [<replaceable>options</replaceable>] [<replaceable>db_name</replaceable> [<replaceable>tbl_name</replaceable> ...]]</command>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsection id="mysqldump-description">
+
+ <title>Description</title>
+
+ <remark role="todo">
+ indicate what privileges are required for the various dump
+ operations (SELECT, LOCK, RELOAD, ...)
+ </remark>
+
+ <para>
+ The <command>mysqldump</command> client is a backup program
+ originally written by Igor Romanenko. It can be used to dump a
+ database or a collection of databases for backup or transfer to
+ another SQL server (not necessarily a MySQL server). The dump
+ typically contains SQL statements to create the table, populate
+ it, or both. However, <command>mysqldump</command> can also be
+ used to generate files in CSV, other delimited text, or XML
+ format.
+ </para>
+
+ <para>
+ If you are doing a backup on the server and your tables all are
+ <literal>MyISAM</literal> tables, consider using the
+ <command>mysqlhotcopy</command> instead because it can
+ accomplish faster backups and faster restores. See
+ <xref linkend="mysqlhotcopy"/>.
+ </para>
+
+ <para>
+ There are three general ways to invoke
+ <command>mysqldump</command>:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqldump [<replaceable>options</replaceable>] <replaceable>db_name</replaceable> [<replaceable>tables</replaceable>]</userinput>
+shell> <userinput>mysqldump [<replaceable>options</replaceable>] --databases <replaceable>db_name1</replaceable> [<replaceable>db_name2</replaceable> <replaceable>db_name3</replaceable>...]</userinput>
+shell> <userinput>mysqldump [<replaceable>options</replaceable>] --all-databases</userinput>
+</programlisting>
+
+ <para>
+ If you do not name any tables following
+ <replaceable>db_name</replaceable> or if you use the
+ <option>--databases</option> or <option>--all-databases</option>
+ option, entire databases are dumped.
+ </para>
+
+ <para>
+ To get a list of the options your version of
+ <command>mysqldump</command> supports, execute
+ <command>mysqldump --help</command>.
+ </para>
+
+ <para>
+ Some <command>mysqldump</command> options are shorthand for
+ groups of other options. <option>--opt</option> and
+ <option>--compact</option> fall into this category. For example,
+ use of <option>--opt</option> is the same as specifying
+ <option>--add-drop-table --add-locks --create-options
+ --disable-keys --extended-insert --lock-tables --quick
+ --set-charset</option>. Note that as of MySQL ¤t-series;,
+ all of the options that <option>--opt</option> stands for also
+ are on by default because <option>--opt</option> is on by
+ default.
+ </para>
+
+ <para>
+ To reverse the effect of a group option, uses its
+ <option>--skip-<replaceable>xxx</replaceable></option> form
+ (<option>--skip-opt</option> or
+ <option>--skip-compact</option>). It is also possible to select
+ only part of the effect of a group option by following it with
+ options that enable or disable specific features. Here are some
+ examples:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ To select the effect of <option>--opt</option> except for
+ some features, use the <option>--skip</option> option for
+ each feature. For example, to disable extended inserts and
+ memory buffering, use <option>--opt --skip-extended-insert
+ --skip-quick</option>. (As of MySQL ¤t-series;,
+ <option>--skip-extended-insert --skip-quick</option> is
+ sufficient because <option>--opt</option> is on by default.)
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To reverse <option>--opt</option> for all features except
+ index disabling and table locking, use <option>--skip-opt
+ --disable-keys --lock-tables</option>.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ When you selectively enable or disable the effect of a group
+ option, order is important because options are processed first
+ to last. For example, <option>--disable-keys --lock-tables
+ --skip-opt</option> would not have the intended effect; it is
+ the same as <option>--skip-opt</option> by itself.
+ </para>
+
+ <para>
+ <command>mysqldump</command> can retrieve and dump table
+ contents row by row, or it can retrieve the entire content from
+ a table and buffer it in memory before dumping it. Buffering in
+ memory can be a problem if you are dumping large tables. To dump
+ tables row by row, use the <option>--quick</option> option (or
+ <option>--opt</option>, which enables <option>--quick</option>).
+ <option>--opt</option> (and hence <option>--quick</option>) is
+ enabled by default as of MySQL ¤t-series; to enable memory
+ buffering, use <option>--skip-quick</option>.
+ </para>
+
+ <para>
+ If you are using a recent version of
+ <command>mysqldump</command> to generate a dump to be reloaded
+ into a very old MySQL server, you should not use the
+ <option>--opt</option> or <option>--extended-insert</option>
+ option. Use <option>--skip-opt</option> instead.
+ </para>
+
+ <para>
+ Before MySQL 4.1.2, out-of-range numeric values such as
+ <literal>-inf</literal> and <literal>inf</literal>, as well as
+ <literal>NaN</literal> (not-a-number) values are dumped by
+ <command>mysqldump</command> as <literal>NULL</literal>. You can
+ see this using the following sample table:
+ </para>
+
+<programlisting>
+mysql> <userinput>CREATE TABLE t (f DOUBLE);</userinput>
+mysql> <userinput>INSERT INTO t VALUES(1e+111111111111111111111);</userinput>
+mysql> <userinput>INSERT INTO t VALUES(-1e111111111111111111111);</userinput>
+mysql> <userinput>SELECT f FROM t;</userinput>
++------+
+| f |
++------+
+| inf |
+| -inf |
++------+
+</programlisting>
+
+ <para>
+ For this table, <command>mysqldump</command> produces the
+ following data output:
+ </para>
+
+<programlisting>
+--
+-- Dumping data for table `t`
+--
+
+INSERT INTO t VALUES (NULL);
+INSERT INTO t VALUES (NULL);
+</programlisting>
+
+ <para>
+ The significance of this behavior is that if you dump and
+ restore the table, the new table has contents that differ from
+ the original contents. This problem is fixed as of MySQL 4.1.2;
+ you cannot insert <literal>inf</literal> in the table, so this
+ <command>mysqldump</command> behavior is only relevant when you
+ deal with old servers.
+ </para>
+
+ <note>
+ <para>
+ <literal>mysqldump</literal> from the MySQL 5.1.21
+ distribution cannot be used to create dumps from MySQL server
+ versions 5.1.20 and older. This issue is fixed in MySQL
+ 5.1.22. (Bug #30123)
+ </para>
+ </note>
+
+ <para>
+ <command>mysqldump</command> supports the following options:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para id="option_mysqldump_help">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>help option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>help option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--help</option>, <option>-?</option>
+ </para>
+
+ <para>
+ Display a help message and exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_add-drop-database">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>add-drop-database option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>add-drop-database option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--add-drop-database</option>
+ </para>
+
+ <para>
+ Add a <literal>DROP DATABASE</literal> statement before each
+ <literal>CREATE DATABASE</literal> statement.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_add-drop-table">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>add-drop-table option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>add-drop-table option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--add-drop-table</option>
+ </para>
+
+ <para>
+ Add a <literal>DROP TABLE</literal> statement before each
+ <literal>CREATE TABLE</literal> statement.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_add-locks">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>add-locks option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>add-locks option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--add-locks</option>
+ </para>
+
+ <para>
+ Surround each table dump with <literal>LOCK TABLES</literal>
+ and <literal>UNLOCK TABLES</literal> statements. This
+ results in faster inserts when the dump file is reloaded.
+ See <xref linkend="insert-speed"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_all-databases">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>all-databases option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>all-databases option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--all-databases</option>, <option>-A</option>
+ </para>
+
+ <para>
+ Dump all tables in all databases. This is the same as using
+ the <option>--databases</option> option and naming all the
+ databases on the command line.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_all-tablespaces">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>all-tablespaces option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>all-tablespaces option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--all-tablespaces</option>, <option>-Y</option>
+ </para>
+
+ <para>
+ Adds to a table dump all SQL statements needed to create any
+ tablespaces used by an <literal>NDB Cluster</literal> table.
+ This information is not otherwise included in the output
+ from <command>mysqldump</command>. This option is currently
+ relevant only to MySQL Cluster tables.
+ </para>
+
+ <para>
+ This option was added in MySQL 5.1.6.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_allow-keywords">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>allow-keywords option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>allow-keywords option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--allow-keywords</option>
+ </para>
+
+ <para>
+ Allow creation of column names that are keywords. This works
+ by prefixing each column name with the table name.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_character-sets-dir">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>character-sets-dir option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>character-sets-dir option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--character-sets-dir=<replaceable>path</replaceable></option>
+ </para>
+
+ <para>
+ The directory where character sets are installed. See
+ <xref linkend="charset-configuration"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_comments">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>comments option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>comments option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--comments</option>, <option>-i</option>
+ </para>
+
+ <para>
+ Write additional information in the dump file such as
+ program version, server version, and host. This option is
+ enabled by default. To suppress this additional information,
+ use <option>--skip-comments</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_compact">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>compact option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>compact option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--compact</option>
+ </para>
+
+ <para>
+ Produce less verbose output. This option enables the
+ <option>--skip-add-drop-table</option>,
+ <option>--skip-add-locks</option>,
+ <option>--skip-comments</option>,
+ <option>--skip-disable-keys</option>, and
+ <option>--skip-set-charset</option> options.
+ </para>
+
+ <note>
+ <para>
+ Prior to release 5.1.21, this option did not create valid
+ SQL if the database dump contained views. The recreation
+ of views requires the creation and removal of temporary
+ tables and this option suppressed the removal of those
+ temporary tables. As a workaround, use
+ <option>--compress</option> with the
+ <option>--add-drop-table</option> option and then manually
+ adjust the dump file.
+ </para>
+ </note>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_compatible">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>compatible option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>compatible option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--compatible=<replaceable>name</replaceable></option>
+ </para>
+
+ <para>
+ Produce output that is more compatible with other database
+ systems or with older MySQL servers. The value of
+ <literal>name</literal> can be <literal>ansi</literal>,
+ <literal>mysql323</literal>, <literal>mysql40</literal>,
+ <literal>postgresql</literal>, <literal>oracle</literal>,
+ <literal>mssql</literal>, <literal>db2</literal>,
+ <literal>maxdb</literal>, <literal>no_key_options</literal>,
+ <literal>no_table_options</literal>, or
+ <literal>no_field_options</literal>. To use several values,
+ separate them by commas. These values have the same meaning
+ as the corresponding options for setting the server SQL
+ mode. See <xref linkend="server-sql-mode"/>.
+ </para>
+
+ <para>
+ This option does not guarantee compatibility with other
+ servers. It only enables those SQL mode values that are
+ currently available for making dump output more compatible.
+ For example, <option>--compatible=oracle</option> does not
+ map data types to Oracle types or use Oracle comment syntax.
+ </para>
+
+ <para>
+ <emphasis>This option requires a server version of 4.1.0 or
+ higher</emphasis>. With older servers, it does nothing.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_complete-insert-option">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>complete-insert option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>complete-insert option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--complete-insert</option>, <option>-c</option>
+ </para>
+
+ <para>
+ Use complete <literal>INSERT</literal> statements that
+ include column names.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_compress">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>compress option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>compress option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--compress</option>, <option>-C</option>
+ </para>
+
+ <para>
+ Compress all information sent between the client and the
+ server if both support compression.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_create-options">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>create-options option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>create-options option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--create-options</option>
+ </para>
+
+ <para>
+ Include all MySQL-specific table options in the
+ <literal>CREATE TABLE</literal> statements.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_databases">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>databases option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>databases option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--databases</option>, <option>-B</option>
+ </para>
+
+ <para>
+ Dump several databases. Normally,
+ <command>mysqldump</command> treats the first name argument
+ on the command line as a database name and following names
+ as table names. With this option, it treats all name
+ arguments as database names. <literal>CREATE
+ DATABASE</literal> and <literal>USE</literal> statements are
+ included in the output before each new database.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_debug">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>debug option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--debug[=<replaceable>debug_options</replaceable>]</option>,
+ <option>-#
+ [<replaceable>debug_options</replaceable>]</option>
+ </para>
+
+ <para>
+ Write a debugging log. The
+ <replaceable>debug_options</replaceable> string is often
+ <literal>'d:t:o,<replaceable>file_name</replaceable>'</literal>.
+ The default value is
+ <literal>'d:t:o,/tmp/mysqldump.trace'</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_debug-check">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>debug-check option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug-check option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--debug-check</option>
+ </para>
+
+ <para>
+ Print some debugging information when the program exits.
+ This option was added in MySQL 5.1.21.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_debug-info">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>debug-info option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug-info option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--debug-info</option>
+ </para>
+
+ <para>
+ Print debugging information and memory and CPU usage
+ statistics when the program exits. This option was added in
+ MySQL 5.1.21.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_default-character-set">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>default-character-set option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>default-character-set option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--default-character-set=<replaceable>charset_name</replaceable></option>
+ </para>
+
+ <para>
+ Use <replaceable>charset_name</replaceable> as the default
+ character set. See <xref linkend="charset-configuration"/>.
+ If no character set is specified,
+ <command>mysqldump</command> uses <literal>utf8</literal>,
+ and earlier versions use <literal>latin1</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_delayed-insert">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>delayed-insert option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>delayed-insert option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--delayed-insert</option>
+ </para>
+
+ <para>
+ Write <literal>INSERT DELAYED</literal> statements rather
+ than <literal>INSERT</literal> statements.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_delete-master-logs">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>delete-master-logs option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>delete-master-logs option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--delete-master-logs</option>
+ </para>
+
+ <para>
+ On a master replication server, delete the binary logs after
+ performing the dump operation. This option automatically
+ enables <option>--master-data</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_disable-keys">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>disable-keys option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>disable-keys option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--disable-keys</option>, <option>-K</option>
+ </para>
+
+ <para>
+ For each table, surround the <literal>INSERT</literal>
+ statements with <literal>/*!40000 ALTER TABLE
+ <replaceable>tbl_name</replaceable> DISABLE KEYS
+ */;</literal> and <literal>/*!40000 ALTER TABLE
+ <replaceable>tbl_name</replaceable> ENABLE KEYS
+ */;</literal> statements. This makes loading the dump file
+ faster because the indexes are created after all rows are
+ inserted. This option is effective only for non-unique
+ indexes of <literal>MyISAM</literal> tables.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_dump-date">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>dump-date option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>dump-date option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--dump-date</option>
+ </para>
+
+ <para>
+ <command>mysqldump</command> produces a <literal>-- Dump
+ completed on <replaceable>DATE</replaceable></literal>
+ comment at the end of the dump if the
+ <option>--comments</option> option is given. However, the
+ date causes dump files for identical data take at different
+ times to appear to be different.
+ <option>--dump-date</option> and
+ <option>--skip-dump-date</option> control whether the date
+ is added to the comment. The default is
+ <option>--dump-date</option> (include the date in the
+ comment). <option>--skip-dump-date</option> suppresses date
+ printing. This option was added in MySQL 5.1.23.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_events">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>events option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>events option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--events</option>, <option>-E</option>
+ </para>
+
+ <para>
+ Dump events from the dumped databases. This option was added
+ in MySQL 5.1.8.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_extended-insert">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>extended-insert option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>extended-insert option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--extended-insert</option>, <option>-e</option>
+ </para>
+
+ <para>
+ Use multiple-row <literal>INSERT</literal> syntax that
+ include several <literal>VALUES</literal> lists. This
+ results in a smaller dump file and speeds up inserts when
+ the file is reloaded.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_fields">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>fields-terminated-by option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>fields-terminated-by option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--fields-terminated-by=...</option>,
+
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>fields-enclosed-by option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>fields-enclosed-by option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--fields-enclosed-by=...</option>,
+
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>fields-optionally-enclosed-by option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>fields-optionally-enclosed-by option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--fields-optionally-enclosed-by=...</option>,
+
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>fields-escaped-by option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>fields-escaped-by option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--fields-escaped-by=...</option>
+ </para>
+
+ <para>
+ These options are used with the <option>-T</option> option
+ and have the same meaning as the corresponding clauses for
+ <literal>LOAD DATA INFILE</literal>. See
+ <xref linkend="load-data"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_first-slave">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>first-slave option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>first-slave option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--first-slave</option>, <option>-x</option>
+ </para>
+
+ <para>
+ Deprecated. Now renamed to
+ <option>--lock-all-tables</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_flush-logs">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>flush-logs option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>flush-logs option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--flush-logs</option>, <option>-F</option>
+ </para>
+
+ <para>
+ Flush the MySQL server log files before starting the dump.
+ This option requires the <literal>RELOAD</literal>
+ privilege. Note that if you use this option in combination
+ with the <option>--all-databases</option> (or
+ <option>-A</option>) option, the logs are flushed
+ <emphasis>for each database dumped</emphasis>. The exception
+ is when using <option>--lock-all-tables</option> or
+ <option>--master-data</option>: In this case, the logs are
+ flushed only once, corresponding to the moment that all
+ tables are locked. If you want your dump and the log flush
+ to happen at exactly the same moment, you should use
+ <option>--flush-logs</option> together with either
+ <option>--lock-all-tables</option> or
+ <option>--master-data</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_flush-privileges">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>flush-privileges option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>flush-privileges option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--flush-privileges</option>
+ </para>
+
+ <para>
+ Emit a <literal>FLUSH PRIVILEGES</literal> statement after
+ dumping the <literal>mysql</literal> database. This option
+ should be used any time the dump contains the
+ <literal>mysql</literal> database and any other database
+ that depends on the data in the <literal>mysql</literal>
+ database for proper restoration. This option was added in
+ MySQL 5.1.12.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_force">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>force option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>force option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--force</option>, <option>-f</option>
+ </para>
+
+ <para>
+ Continue even if an SQL error occurs during a table dump.
+ </para>
+
+ <para>
+ One use for this option is to cause
+ <command>mysqldump</command> to continue executing even when
+ it encounters a view that has become invalid because the
+ defintion refers to a table that has been dropped. Without
+ <option>--force</option>, <command>mysqldump</command> exits
+ with an error message. With <option>--force</option>,
+ <command>mysqldump</command> prints the error message, but
+ it also writes a SQL comment containing the view definition
+ to the dump output and continues executing.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_host">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>host option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>host option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--host=<replaceable>host_name</replaceable></option>,
+ <option>-h <replaceable>host_name</replaceable></option>
+ </para>
+
+ <para>
+ Dump data from the MySQL server on the given host. The
+ default host is <literal>localhost</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_hex-blob">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>hex-blob option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>hex-blob option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--hex-blob</option>
+ </para>
+
+ <para>
+ Dump binary columns using hexadecimal notation (for example,
+ <literal>'abc'</literal> becomes
+ <literal>0x616263</literal>). The affected data types are
+ <literal>BINARY</literal>, <literal>VARBINARY</literal>,
+ <literal>BLOB</literal>, and <literal>BIT</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_ignore-table">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>ignore-table option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>ignore-table option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--ignore-table=<replaceable>db_name.tbl_name</replaceable></option>
+ </para>
+
+ <para>
+ Do not dump the given table, which must be specified using
+ both the database and table names. To ignore multiple
+ tables, use this option multiple times.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_insert-ignore">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>insert-ignore option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>insert-ignore option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--insert-ignore</option>
+ </para>
+
+ <para>
+ Write <literal>INSERT</literal> statements with the
+ <literal>IGNORE</literal> option.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_lines-terminated-by">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>lines-terminated-by option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>lines-terminated-by option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--lines-terminated-by=...</option>
+ </para>
+
+ <para>
+ This option is used with the <option>-T</option> option and
+ has the same meaning as the corresponding clause for
+ <literal>LOAD DATA INFILE</literal>. See
+ <xref linkend="load-data"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_lock-all-tables">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>lock-all-tables option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>lock-all-tables option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--lock-all-tables</option>, <option>-x</option>
+ </para>
+
+ <para>
+ Lock all tables across all databases. This is achieved by
+ acquiring a global read lock for the duration of the whole
+ dump. This option automatically turns off
+ <option>--single-transaction</option> and
+ <option>--lock-tables</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_lock-tables">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>lock-tables option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>lock-tables option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--lock-tables</option>, <option>-l</option>
+ </para>
+
+ <para>
+ Lock all tables before dumping them. The tables are locked
+ with <literal>READ LOCAL</literal> to allow concurrent
+ inserts in the case of <literal>MyISAM</literal> tables. For
+ transactional tables such as <literal>InnoDB</literal> and
+ <literal>BDB</literal>,
+ <option>--single-transaction</option> is a much better
+ option, because it does not need to lock the tables at all.
+ </para>
+
+ <para>
+ Please note that when dumping multiple databases,
+ <option>--lock-tables</option> locks tables for each
+ database separately. Therefore, this option does not
+ guarantee that the tables in the dump file are logically
+ consistent between databases. Tables in different databases
+ may be dumped in completely different states.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_log-error">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>log-error option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>log-error option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--log-error=<replaceable>file_name</replaceable></option>
+ </para>
+
+ <para>
+ Append warnings and errors to the named file. This option
+ was added in MySQL 5.1.18.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_master-data">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>master-data option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>master-data option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--master-data[=<replaceable>value</replaceable>]</option>
+ </para>
+
+ <para>
+ Write the binary log filename and position to the output.
+ This option requires the <literal>RELOAD</literal> privilege
+ and the binary log must be enabled. If the option value is
+ equal to 1, the position and filename are written to the
+ dump output in the form of a <literal>CHANGE
+ MASTER</literal> statement. If the dump is from a master
+ server and you use it to set up a slave server, the
+ <literal>CHANGE MASTER</literal> statement causes the slave
+ to start from the correct position in the master's binary
+ logs. If the option value is equal to 2, the <literal>CHANGE
+ MASTER</literal> statement is written as an SQL comment. If
+ the value is not specified, then the default value is 1.
+ </para>
+
+ <para>
+ The <option>--master-data</option> option automatically
+ turns off <option>--lock-tables</option>. It also turns on
+ <option>--lock-all-tables</option>, unless
+ <option>--single-transaction</option> also is specified (in
+ which case, a global read lock is acquired only for a short
+ time at the beginning of the dump. See also the description
+ for <option>--single-transaction</option>. In all cases, any
+ action on logs happens at the exact moment of the dump.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_no-autocommit">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>no-autocommit option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>no-autocommit option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--no-autocommit</option>
+ </para>
+
+ <para>
+ Enclose the <literal>INSERT</literal> statements for each
+ dumped table within <literal>SET AUTOCOMMIT=0</literal> and
+ <literal>COMMIT</literal> statements.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_no-create-db">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>no-create-db option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>no-create-db option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--no-create-db</option>, <option>-n</option>
+ </para>
+
+ <para>
+ This option suppresses the <literal>CREATE
+ DATABASE</literal> statements that are otherwise included in
+ the output if the <option>--databases</option> or
+ <option>--all-databases</option> option is given.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_no-create-info">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>no-create-info option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>no-create-info option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--no-create-info</option>, <option>-t</option>
+ </para>
+
+ <para>
+ Do not write <literal>CREATE TABLE</literal> statements that
+ re-create each dumped table.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_no-data">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>no-data option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>no-data option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--no-data</option>, <option>-d</option>
+ </para>
+
+ <para>
+ Do not write any table row information (that is, do not dump
+ table contents). This is very useful if you want to dump
+ only the <literal>CREATE TABLE</literal> statement for the
+ table.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_opt">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>opt option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>opt option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--opt</option>
+ </para>
+
+ <para>
+ This option is shorthand; it is the same as specifying
+ <option>--add-drop-table --add-locks --create-options
+ --disable-keys --extended-insert --lock-tables --quick
+ --set-charset</option>. It should give you a fast dump
+ operation and produce a dump file that can be reloaded into
+ a MySQL server quickly.
+ </para>
+
+ <para>
+ <emphasis>The <option>--opt</option> option is enabled by
+ default. Use <option>--skip-opt</option> to disable
+ it.</emphasis> See the discussion at the beginning of this
+ section for information about selectively enabling or
+ disabling certain of the options affected by
+ <option>--opt</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_order-by-primary">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>order-by-primary option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>order-by-primary option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--order-by-primary</option>
+ </para>
+
+ <para>
+ Sorts each table's rows by its primary key, or by its first
+ unique index, if such an index exists. This is useful when
+ dumping a <literal>MyISAM</literal> table to be loaded into
+ an <literal>InnoDB</literal> table, but will make the dump
+ itself take considerably longer.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_password">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>password option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>password option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--password[=<replaceable>password</replaceable>]</option>,
+ <option>-p[<replaceable>password</replaceable>]</option>
+ </para>
+
+ <para>
+ The password to use when connecting to the server. If you
+ use the short option form (<option>-p</option>), you
+ <emphasis>cannot</emphasis> have a space between the option
+ and the password. If you omit the
+ <replaceable>password</replaceable> value following the
+ <option>--password</option> or <option>-p</option> option on
+ the command line, you are prompted for one.
+ </para>
+
+ <para>
+ Specifying a password on the command line should be
+ considered insecure. See
+ <xref linkend="password-security"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_port">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>port option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>port option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--port=<replaceable>port_num</replaceable></option>,
+ <option>-P <replaceable>port_num</replaceable></option>
+ </para>
+
+ <para>
+ The TCP/IP port number to use for the connection.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_protocol">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>protocol option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>protocol option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--protocol={TCP|SOCKET|PIPE|MEMORY}</option>
+ </para>
+
+ <para>
+ The connection protocol to use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_quick">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>quick option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>quick option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--quick</option>, <option>-q</option>
+ </para>
+
+ <para>
+ This option is useful for dumping large tables. It forces
+ <command>mysqldump</command> to retrieve rows for a table
+ from the server a row at a time rather than retrieving the
+ entire row set and buffering it in memory before writing it
+ out.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_quote-names">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>quote-names option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>quote-names option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--quote-names</option>, <option>-Q</option>
+ </para>
+
+ <para>
+ Quote database, table, and column names within
+ <quote><literal>`</literal></quote> characters. If the
+ <literal>ANSI_QUOTES</literal> SQL mode is enabled, names
+ are quoted within <quote><literal>"</literal></quote>
+ characters. This option is enabled by default. It can be
+ disabled with <option>--skip-quote-names</option>, but this
+ option should be given after any option such as
+ <option>--compatible</option> that may enable
+ <option>--quote-names</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_replace">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>replace option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>replace option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--replace</option>
+ </para>
+
+ <para>
+ Write <literal>REPLACE</literal> statements rather than
+ <literal>INSERT</literal> statements. Available as of MySQL
+ 5.1.3.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_result-file">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>result-file option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>result-file option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--result-file=<replaceable>file</replaceable></option>,
+ <option>-r <replaceable>file</replaceable></option>
+ </para>
+
+ <para>
+ Direct output to a given file. This option should be used on
+ Windows to prevent newline
+ <quote><literal>\n</literal></quote> characters from being
+ converted to <quote><literal>\r\n</literal></quote> carriage
+ return/newline sequences. The result file is created and its
+ contents overwritten, even if an error occurs while
+ generating the dump. The previous contents are lost.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_routines">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>routines option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>routines option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--routines</option>, <option>-R</option>
+ </para>
+
+ <para>
+ Dump stored routines (functions and procedures) from the
+ dumped databases. Use of this option requires the
+ <literal>SELECT</literal> privilege for the
+ <literal>mysql.proc</literal> table. The output generated by
+ using <option>--routines</option> contains <literal>CREATE
+ PROCEDURE</literal> and <literal>CREATE FUNCTION</literal>
+ statements to re-create the routines. However, these
+ statements do not include attributes such as the routine
+ creation and modification timestamps. This means that when
+ the routines are reloaded, they will be created with the
+ timestamps equal to the reload time.
+ </para>
+
+ <para>
+ If you require routines to be re-created with their original
+ timestamp attributes, do not use
+ <option>--routines</option>. Instead, dump and reload the
+ contents of the <literal>mysql.proc</literal> table
+ directly, using a MySQL account that has appropriate
+ privileges for the <literal>mysql</literal> database.
+ </para>
+
+ <para>
+ This option was added in MySQL 5.1.2. Before that, stored
+ routines are not dumped. Routine <literal>DEFINER</literal>
+ values are not dumped until MySQL 5.1.8. This means that
+ before 5.1.8, when routines are reloaded, they will be
+ created with the definer set to the reloading user. If you
+ require routines to be re-created with their original
+ definer, dump and load the contents of the
+ <literal>mysql.proc</literal> table directly as described
+ earlier.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_set-charset">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>set-charset option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>set-charset option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--set-charset</option>
+ </para>
+
+ <para>
+ Add <literal>SET NAMES
+ <replaceable>default_character_set</replaceable></literal>
+ to the output. This option is enabled by default. To
+ suppress the <literal>SET NAMES</literal> statement, use
+ <option>--skip-set-charset</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_single-transaction">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>single-transaction option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>single-transaction option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--single-transaction</option>
+ </para>
+
+ <para>
+ This option issues a <literal>BEGIN</literal> SQL statement
+ before dumping data from the server. It is useful only with
+ transactional tables such as <literal>InnoDB</literal>,
+ because then it dumps the consistent state of the database
+ at the time when <literal>BEGIN</literal> was issued without
+ blocking any applications.
+ </para>
+
+ <para>
+ When using this option, you should keep in mind that only
+ <literal>InnoDB</literal> tables are dumped in a consistent
+ state. For example, any <literal>MyISAM</literal> or
+ <literal>MEMORY</literal> tables dumped while using this
+ option may still change state.
+ </para>
+
+ <para>
+ While a <option>--single-transaction</option> dump is in
+ process, to ensure a valid dump file (correct table contents
+ and binary log position), no other connection should use the
+ following statements: <literal>ALTER TABLE</literal>,
+ <literal>DROP TABLE</literal>, <literal>RENAME
+ TABLE</literal>, <literal>TRUNCATE TABLE</literal>. A
+ consistent read is not isolated from those statements, so
+ use of them on a table to be dumped can cause the
+ <literal>SELECT</literal> performed by
+ <command>mysqldump</command> to retrieve the table contents
+ to obtain incorrect contents or fail.
+ </para>
+
+ <para>
+ This option is not supported for MySQL Cluster tables; the
+ results cannot be guaranteed to be consistent due to the
+ fact that the <literal>NDBCluster</literal> storage engine
+ supports only the <literal>READ_COMMITTED</literal>
+ transaction isolation level. You should always use
+ <literal>NDB</literal> backup and restore instead.
+ </para>
+
+ <para>
+ The <option>--single-transaction</option> option and the
+ <option>--lock-tables</option> option are mutually
+ exclusive, because <literal>LOCK TABLES</literal> causes any
+ pending transactions to be committed implicitly.
+ </para>
+
+ <para>
+ To dump large tables, you should combine this option with
+ <option>--quick</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_skip-comments">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>skip-comments option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>skip-comments option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--skip-comments</option>
+ </para>
+
+ <para>
+ See the description for the <option>--comments</option>
+ option.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_skip-opt">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>skip-opt option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>skip-opt option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--skip-opt</option>
+ </para>
+
+ <para>
+ See the description for the <option>--opt</option> option.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_socket">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>socket option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>socket option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--socket=<replaceable>path</replaceable></option>,
+ <option>-S <replaceable>path</replaceable></option>
+ </para>
+
+ <para>
+ For connections to <literal>localhost</literal>, the Unix
+ socket file to use, or, on Windows, the name of the named
+ pipe to use.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_ssl">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>SSL options</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>SSL options</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--ssl*</option>
+ </para>
+
+ <para>
+ Options that begin with <option>--ssl</option> specify
+ whether to connect to the server via SSL and indicate where
+ to find SSL keys and certificates. See
+ <xref linkend="ssl-options"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_tab">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>tab option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>tab option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--tab=<replaceable>path</replaceable></option>,
+ <option>-T <replaceable>path</replaceable></option>
+ </para>
+
+ <para>
+ Produce tab-separated data files. For each dumped table,
+ <command>mysqldump</command> creates a
+ <filename><replaceable>tbl_name</replaceable>.sql</filename>
+ file that contains the <literal>CREATE TABLE</literal>
+ statement that creates the table, and a
+ <filename><replaceable>tbl_name</replaceable>.txt</filename>
+ file that contains its data. The option value is the
+ directory in which to write the files.
+ </para>
+
+ <para>
+ By default, the <filename>.txt</filename> data files are
+ formatted using tab characters between column values and a
+ newline at the end of each line. The format can be specified
+ explicitly using the
+ <option>--fields-<replaceable>xxx</replaceable></option> and
+ <option>--lines-terminated-by</option> options.
+ </para>
+
+ <note>
+ <para>
+ This option should be used only when
+ <command>mysqldump</command> is run on the same machine as
+ the <command>mysqld</command> server. You must have the
+ <literal>FILE</literal> privilege, and the server must
+ have permission to write files in the directory that you
+ specify.
+ </para>
+ </note>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_tables">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>tables option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>tables option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--tables</option>
+ </para>
+
+ <para>
+ Override the <option>--databases</option> or
+ <option>-B</option> option. <command>mysqldump</command>
+ regards all name arguments following the option as table
+ names.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>triggers option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>triggers option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--triggers</option>
+ </para>
+
+ <para>
+ Dump triggers for each dumped table. This option is enabled
+ by default; disable it with
+ <option>--skip-triggers</option>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_tz-utc">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>tz-utc option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>tz-utc option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--tz-utc</option>
+ </para>
+
+ <para>
+ Add <literal>SET TIME_ZONE='+00:00'</literal> to the dump
+ file so that <literal>TIMESTAMP</literal> columns can be
+ dumped and reloaded between servers in different time zones.
+ Without this option, <literal>TIMESTAMP</literal> columns
+ are dumped and reloaded in the time zones local to the
+ source and destination servers, which can cause the values
+ to change. <option>--tz-utc</option> also protects against
+ changes due to daylight saving time.
+ <option>--tz-utc</option> is enabled by default. To disable
+ it, use <option>--skip-tz-utc</option>. This option was
+ added in MySQL 5.1.2.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_user">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>user option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>user option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--user=<replaceable>user_name</replaceable></option>,
+ <option>-u <replaceable>user_name</replaceable></option>
+ </para>
+
+ <para>
+ The MySQL username to use when connecting to the server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_verbose">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>verbose option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>verbose option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--verbose</option>, <option>-v</option>
+ </para>
+
+ <para>
+ Verbose mode. Print more information about what the program
+ does.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_version">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>version option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>version option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--version</option>, <option>-V</option>
+ </para>
+
+ <para>
+ Display version information and exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_where">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>where option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>where option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--where='<replaceable>where_condition</replaceable>'</option>,
+ <option>-w
+ '<replaceable>where_condition</replaceable>'</option>
+ </para>
+
+ <para>
+ Dump only rows selected by the given
+ <literal>WHERE</literal> condition. Quotes around the
+ condition are mandatory if it contains spaces or other
+ characters that are special to your command interpreter.
+ </para>
+
+ <para>
+ Examples:
+ </para>
+
+<programlisting>
+--where="user='jimf'"
+-w"userid>1"
+-w"userid<1"
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_xml">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>xml option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>xml option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--xml</option>, <option>-X</option>
+ </para>
+
+ <para>
+ Write dump output as well-formed XML.
+ </para>
+
+ <para>
+ <emphasis role="bold"><literal>NULL</literal>,
+ <literal>'NULL'</literal>, and Empty Values</emphasis>: For
+ some column named <replaceable>column_name</replaceable>,
+ the <literal>NULL</literal> value, an empty string, and the
+ string value <literal>'NULL'</literal> are distinguished
+ from one another in the output generated by this option as
+ follows:
+ </para>
+
+ <informaltable>
+ <tgroup cols="2">
+ <colspec colwidth="50*"/>
+ <colspec colwidth="50*"/>
+ <tbody>
+ <row>
+ <entry><emphasis role="bold">Value</emphasis>:</entry>
+ <entry><emphasis role="bold">XML Representation</emphasis>:</entry>
+ </row>
+ <row>
+ <entry><literal>NULL</literal> (<emphasis>unknown value</emphasis>)</entry>
+ <entry><literal><field name="<replaceable>column_name</replaceable>"
+ xsi:nil="true" /></literal></entry>
+ </row>
+ <row>
+ <entry><literal>''</literal> (<emphasis>empty string</emphasis>)</entry>
+ <entry><literal><field
+ name="<replaceable>column_name</replaceable>"></field></literal></entry>
+ </row>
+ <row>
+ <entry><literal>'NULL'</literal> (<emphasis>string value</emphasis>)</entry>
+ <entry><literal><field
+ name="<replaceable>column_name</replaceable>">NULL</field></literal></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+
+ <para>
+ Beginning with MySQL 5.1.12, the output from the
+ <command>mysql</command> client when run using the
+ <option>--xml</option> option also follows these rules. (See
+ <xref linkend="mysql-command-options"/>.)
+ </para>
+
+ <para>
+ Beginning with MySQL 5.1.18, XML output from
+ <command>mysqldump</command> includes the XML namespace, as
+ shown here:
+
+<programlisting>
+shell> <userinput>mysqldump --xml -u root world City</userinput>
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<database name="world">
+<table_structure name="City">
+<field Field="ID" Type="int(11)" Null="NO" Key="PRI" Extra="auto_increment" />
+<field Field="Name" Type="char(35)" Null="NO" Key="" Default="" Extra="" />
+<field Field="CountryCode" Type="char(3)" Null="NO" Key="" Default="" Extra="" />
+<field Field="District" Type="char(20)" Null="NO" Key="" Default="" Extra="" />
+<field Field="Population" Type="int(11)" Null="NO" Key="" Default="0" Extra="" />
+<key Table="City" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="ID" Collation="A" Cardinality="4079"
+Null="" Index_type="BTREE" Comment="" />
+<options Name="City" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="4079" Avg_row_length="67" Data_length="27329
+3" Max_data_length="18858823439613951" Index_length="43008" Data_free="0" Auto_increment="4080" Create_time="2007-03-31 01:47:01" Updat
+e_time="2007-03-31 01:47:02" Collation="latin1_swedish_ci" Create_options="" Comment="" />
+</table_structure>
+<table_data name="City">
+<row>
+<field name="ID">1</field>
+<field name="Name">Kabul</field>
+<field name="CountryCode">AFG</field>
+<field name="District">Kabol</field>
+<field name="Population">1780000</field>
+</row>
+
+<replaceable>...</replaceable>
+
+<row>
+<field name="ID">4079</field>
+<field name="Name">Rafah</field>
+<field name="CountryCode">PSE</field>
+<field name="District">Rafah</field>
+<field name="Population">92020</field>
+</row>
+</table_data>
+</database>
+</mysqldump>
+</programlisting>
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ You can also set the following variables by using
+ <option>--<replaceable>var_name</replaceable>=<replaceable>value</replaceable></option>
+ syntax:
+ </para>
+
+ <itemizedlist>
+
+ <listitem id="option_mysqldump_max-allowed-packet">
+ <para>
+ <literal>max_allowed_packet</literal>
+ </para>
+
+ <para>
+ The maximum size of the buffer for client/server
+ communication. The maximum is 1GB.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqldump_net-buffer-length">
+ <literal>net_buffer_length</literal>
+ </para>
+
+ <para>
+ The initial size of the buffer for client/server
+ communication. When creating multiple-row-insert statements
+ (as with option <option>--extended-insert</option> or
+ <option>--opt</option>), <command>mysqldump</command>
+ creates rows up to <literal>net_buffer_length</literal>
+ length. If you increase this variable, you should also
+ ensure that the <literal>net_buffer_length</literal>
+ variable in the MySQL server is at least this large.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ It is also possible to set variables by using
+ <option>--set-variable=<replaceable>var_name</replaceable>=<replaceable>value</replaceable></option>
+ or <option>-O
+ <replaceable>var_name</replaceable>=<replaceable>value</replaceable></option>
+ syntax. <emphasis>This syntax is deprecated</emphasis>.
+ </para>
+
+ <para>
+ The most common use of <command>mysqldump</command> is probably
+ for making a backup of an entire database:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqldump <replaceable>db_name</replaceable> > <replaceable>backup-file.sql</replaceable></userinput>
+</programlisting>
+
+ <para>
+ You can read the dump file back into the server like this:
+ </para>
+
+<programlisting>
+shell> <userinput>mysql <replaceable>db_name</replaceable> < <replaceable>backup-file.sql</replaceable></userinput>
+</programlisting>
+
+ <para>
+ Or like this:
+ </para>
+
+<programlisting>
+shell> <userinput>mysql -e "source <replaceable>/path-to-backup/backup-file.sql</replaceable>" <replaceable>db_name</replaceable></userinput>
+</programlisting>
+
+ <para>
+ <command>mysqldump</command> is also very useful for populating
+ databases by copying data from one MySQL server to another:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqldump --opt <replaceable>db_name</replaceable> | mysql --host=<replaceable>remote_host</replaceable> -C <replaceable>db_name</replaceable></userinput>
+</programlisting>
+
+ <para>
+ It is possible to dump several databases with one command:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqldump --databases <replaceable>db_name1</replaceable> [<replaceable>db_name2</replaceable> ...] > my_databases.sql</userinput>
+</programlisting>
+
+ <para>
+ To dump all databases, use the <option>--all-databases</option>
+ option:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqldump --all-databases > all_databases.sql</userinput>
+</programlisting>
+
+ <para>
+ For <literal>InnoDB</literal> tables,
+ <literal>mysqldump</literal> provides a way of making an online
+ backup:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqldump --all-databases --single-transaction > all_databases.sql</userinput>
+</programlisting>
+
+ <para>
+ This backup just needs to acquire a global read lock on all
+ tables (using <literal>FLUSH TABLES WITH READ LOCK</literal>) at
+ the beginning of the dump. As soon as this lock has been
+ acquired, the binary log coordinates are read and the lock is
+ released. If and only if one long updating statement is running
+ when the <literal>FLUSH</literal> statement is issued, the MySQL
+ server may get stalled until that long statement finishes, and
+ then the dump becomes lock-free. If the update statements that
+ the MySQL server receives are short (in terms of execution
+ time), the initial lock period should not be noticeable, even
+ with many updates.
+ </para>
+
+ <para>
+ For point-in-time recovery (also known as
+ <quote>roll-forward,</quote> when you need to restore an old
+ backup and replay the changes that happened since that backup),
+ it is often useful to rotate the binary log (see
+ <xref linkend="binary-log"/>) or at least know the binary log
+ coordinates to which the dump corresponds:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqldump --all-databases --master-data=2 > all_databases.sql</userinput>
+</programlisting>
+
+ <para>
+ Or:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqldump --all-databases --flush-logs --master-data=2</userinput>
+ <userinput>> all_databases.sql</userinput>
+</programlisting>
+
+ <para>
+ The <option>--master-data</option> and
+ <option>--single-transaction</option> options can be used
+ simultaneously, which provides a convenient way to make an
+ online backup suitable for point-in-time recovery if tables are
+ stored using the <literal>InnoDB</literal> storage engine.
+ </para>
+
+ <para>
+ For more information on making backups, see
+ <xref linkend="backup"/>, and
+ <xref linkend="backup-strategy-example"/>.
+ </para>
+
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>views</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>problems</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>workarounds</secondary>
+ </indexterm>
+
+ <para>
+ If you encounter problems backing up views, please read the
+ section that covers restrictions on views which describes a
+ workaround for backing up views when this fails due to
+ insufficient privileges. See
+ <xref linkend="view-restrictions"/>.
+ </para>
+
+ <formalpara role="mnmas-kb">
+
+ <title>MySQL Enterprise</title>
+
+ <para>
+ MySQL Enterprise subscribers will find more information about
+ <command>mysqldump</command> in the Knowledge Base article,
+ <ulink url="https://kb.mysql.com/view.php?id=5285"> How Can I
+ Avoid Inserting Duplicate Rows From a Dump File?</ulink>.
+ Access to the MySQL Knowledge Base collection of articles is
+ one of the advantages of subscribing to MySQL Enterprise. For
+ more information see
+ <ulink url="&base-url-enterprise;advisors.html"/>.
+ </para>
+
+ </formalpara>
+
+ </refsection>
+
+ </refentry>
+
+ <refentry id="mysqlimport">
+
+ <indexterm>
+ <primary>mysqlimport</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>importing</primary>
+ <secondary>data</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>data</primary>
+ <secondary>importing</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>files</primary>
+ <secondary>text</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>text files</primary>
+ <secondary>importing</secondary>
+ </indexterm>
+
+ <refmeta>
+ <refentrytitle><command>mysqlimport</command></refentrytitle>
+
+ <manvolnum>1</manvolnum>
+ <refmiscinfo class="manual">MySQL Database System</refmiscinfo>
+ <refmiscinfo class="source">MySQL</refmiscinfo>
+ <refmiscinfo class="version">¤t-series;</refmiscinfo>
+ <refmiscinfo class="refman">A Data Import Program</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>mysqlimport</refname>
+
+ <refpurpose>a data import program</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>mysqlimport [<replaceable>options</replaceable>] <replaceable>db_name</replaceable> <replaceable>textfile1</replaceable> ...</command>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsection id="mysqlimport-description">
+
+ <title>Description</title>
+
+ <para>
+ The <command>mysqlimport</command> client provides a
+ command-line interface to the <literal>LOAD DATA
+ INFILE</literal> SQL statement. Most options to
+ <command>mysqlimport</command> correspond directly to clauses of
+ <literal>LOAD DATA INFILE</literal> syntax. See
+ <xref linkend="load-data"/>.
+ </para>
+
+ <para>
+ Invoke <command>mysqlimport</command> like this:
+ </para>
+
+<programlisting>
+shell> <userinput>mysqlimport [<replaceable>options</replaceable>] <replaceable>db_name</replaceable> <replaceable>textfile1</replaceable> [<replaceable>textfile2</replaceable> ...]</userinput>
+</programlisting>
+
+ <para>
+ For each text file named on the command line,
+ <command>mysqlimport</command> strips any extension from the
+ filename and uses the result to determine the name of the table
+ into which to import the file's contents. For example, files
+ named <filename>patient.txt</filename>,
+ <filename>patient.text</filename>, and
+ <filename>patient</filename> all would be imported into a table
+ named <literal>patient</literal>.
+ </para>
+
+ <para>
+ <command>mysqlimport</command> supports the following options:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para id="option_mysqlimport_help">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>help option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>help option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--help</option>, <option>-?</option>
+ </para>
+
+ <para>
+ Display a help message and exit.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_character-sets-dir ">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>character-sets-dir option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>character-sets-dir option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--character-sets-dir=<replaceable>path</replaceable></option>
+ </para>
+
+ <para>
+ The directory where character sets are installed. See
+ <xref linkend="charset-configuration"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_columns">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>columns option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>columns option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--columns=<replaceable>column_list</replaceable></option>,
+ <option>-c <replaceable>column_list</replaceable></option>
+ </para>
+
+ <para>
+ This option takes a comma-separated list of column names as
+ its value. The order of the column names indicates how to
+ match data file columns with table columns.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_compress">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>compress option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>compress option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--compress</option>, <option>-C</option>
+ </para>
+
+ <para>
+ Compress all information sent between the client and the
+ server if both support compression.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_debug">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>debug option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--debug[=<replaceable>debug_options</replaceable>]</option>,
+ <option>-#
+ [<replaceable>debug_options</replaceable>]</option>
+ </para>
+
+ <para>
+ Write a debugging log. The
+ <replaceable>debug_options</replaceable> string often is
+ <literal>'d:t:o,<replaceable>file_name</replaceable>'</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_debug-check">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>debug-check option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug-check option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--debug-check</option>
+ </para>
+
+ <para>
+ Print some debugging information when the program exits.
+ This option was added in MySQL 5.1.21.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_debug-info">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>debug-info option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>debug-info option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--debug-info</option>
+ </para>
+
+ <para>
+ Print debugging information and memory and CPU usage
+ statistics when the program exits. This option was added in
+ MySQL 5.1.21.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_default-character-set">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>default-character-set option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>default-character-set option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--default-character-set=<replaceable>charset_name</replaceable></option>
+ </para>
+
+ <para>
+ Use <replaceable>charset_name</replaceable> as the default
+ character set. See <xref linkend="charset-configuration"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_delete">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>delete option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>delete option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--delete</option>, <option>-D</option>
+ </para>
+
+ <para>
+ Empty the table before importing the text file.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_fields">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>fields-terminated-by option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>fields-terminated-by option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--fields-terminated-by=...</option>,
+
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>fields-enclosed-by option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>fields-enclosed-by option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--fields-enclosed-by=...</option>,
+
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>fields-optionally-enclosed-by option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>fields-optionally-enclosed-by option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--fields-optionally-enclosed-by=...</option>,
+
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>fields-escaped-by option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>fields-escaped-by option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--fields-escaped-by=...</option>
+ </para>
+
+ <para>
+ These options have the same meaning as the corresponding
+ clauses for <literal>LOAD DATA INFILE</literal>. See
+ <xref linkend="load-data"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_force">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>force option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>force option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--force</option>, <option>-f</option>
+ </para>
+
+ <para>
+ Ignore errors. For example, if a table for a text file does
+ not exist, continue processing any remaining files. Without
+ <option>--force</option>, <command>mysqlimport</command>
+ exits if a table does not exist.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_host">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>host option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>host option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--host=<replaceable>host_name</replaceable></option>,
+ <option>-h <replaceable>host_name</replaceable></option>
+ </para>
+
+ <para>
+ Import data to the MySQL server on the given host. The
+ default host is <literal>localhost</literal>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_ignore">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>ignore option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>ignore option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--ignore</option>, <option>-i</option>
+ </para>
+
+ <para>
+ See the description for the <option>--replace</option>
+ option.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_ignore-lines">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>ignore-lines option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>ignore-lines option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--ignore-lines=<replaceable>N</replaceable></option>
+ </para>
+
+ <para>
+ Ignore the first <replaceable>N</replaceable> lines of the
+ data file.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_lines-terminated-by">
+ <indexterm>
+ <primary>mysqldump</primary>
+ <secondary>lines-terminated-by option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>lines-terminated-by option</primary>
+ <secondary>mysqldump</secondary>
+ </indexterm>
+
+ <option>--lines-terminated-by=...</option>
+ </para>
+
+ <para>
+ This option has the same meaning as the corresponding clause
+ for <literal>LOAD DATA INFILE</literal>. For example, to
+ import Windows files that have lines terminated with
+ carriage return/linefeed pairs, use
+ <option>--lines-terminated-by="\r\n"</option>. (You might
+ have to double the backslashes, depending on the escaping
+ conventions of your command interpreter.) See
+ <xref linkend="load-data"/>.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_local">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>local option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>local option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--local</option>, <option>-L</option>
+ </para>
+
+ <para>
+ Read input files locally from the client host.
+ </para>
+
+ <formalpara role="mnmas">
+
+ <title>MySQL Enterprise</title>
+
+ <para>
+ For expert advice on the security implications of enabling
+ <literal>LOCAL</literal>, subscribe to the MySQL
+ Enterprise Monitor. For more information see
+ <ulink url="&base-url-enterprise;advisors.html"/>.
+ </para>
+
+ </formalpara>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_lock-tables">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>lock-tables option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>lock-tables option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--lock-tables</option>, <option>-l</option>
+ </para>
+
+ <para>
+ Lock <emphasis>all</emphasis> tables for writing before
+ processing any text files. This ensures that all tables are
+ synchronized on the server.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para id="option_mysqlimport_low-priority">
+ <indexterm>
+ <primary>mysqlimport</primary>
+ <secondary>low-priority option</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>low-priority option</primary>
+ <secondary>mysqlimport</secondary>
+ </indexterm>
+
+ <option>--low-priority</option>
+ </para>
+
+ <para>
<