a database backup program

mysqldump [options] [db_name [tbl_name ...]]

Dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server).
original web page

by default contains SQL statements to create the table, populate it, or both.
Can generate files in CSV, other delimited text, or XML format.

  1. mysqldump [options] db_name [tbl_name …]
  2. mysqldump [options] --databases db_name …
  3. mysqldump [options] --all-databases

    mysqldump dauser_moodle MHS_tbl --user=dauser_uname --password --compact > MSH.`date +%y%m%d`.dump

    Omitting table names or with --databases or --all-databases, entire databases are dumped.

    To include INFORMATION_SCHEMA explicitly include it on the command line, and use --skip-lock-tables.
    In MySQL Cluster NDB 7.1.7 and later, the ndbinfo information database is ignored and not dumped by mysqldump.

    Some options are shorthand for groups of others

    -u user_name
    -ppassword, no space before password

    Specifying a password on the command line is insecure.

    Omit password to have MySQLdump prompt for it.

    -h host_name
    Default localhost.
    --verbose, -v  
    --version, -V  
    include info such as program version, server version, and host.
    -- MySQL dump 10.13  Distrib 5.1.56, for unknown-linux-gnu (x86_64)
    -- Host: localhost    Database: dauser_moodle
    -- ------------------------------------------------------
    -- Server version   5.1.56
    --dump-date at the end, if --comments is given
    -- Dump completed on 2012-02-17  7:39:5
    -r file_name
    Output to file_name instead of stdout.
    On Windows prevents (newlines) from being converted to ␍␤ (return/newline) .
    data sent between the client and the server (not result-file).
    --log-error=file_name warnings and errors.
    Default: no logging.
    --opt     --skip-opt
    equivelant to


    equivelant to


    Continue even if an SQL error occurs during a table dump.
    Useful when a view becomes invalid because the definition refers to a table that has been dropped.
    Outputs an error message and writes an SQL comment containing the view definition and continues
    Without --force, exits with an error message.
    Default: db_name specifies a database and is followed by tbl_names. Example:
        > mysqldump production accounts transactions monthly_summary
    all databases and all tables they contain.
    --databases db_name
    CREATE DATABASE and USE are included before each new database.
    --tables tbl_name Override the --databases, all name arguments are tables
    --add-drop-database before each CREATE DATABASE statement.
    with the --all-databases or --databases option.
    --ignore-table=db_name.tbl_name To ignore multiple tables, use this option multiple times.
    Can be used to ignore views.
    create tablespaces used by an NDBCLUSTER table.( only relevant to MySQL Cluster tables.)
    --create-options Include all MySQL-specific table options in CREATE TABLE
    --add-drop-table before CREATE TABLE
    --add-locks Surround each table with LOCK TABLES and UNLOCK TABLES.
    This results in faster inserts when the dump is loaded.
    See Speed of INSERT Statements
    For each table, surround INSERT with
    /*!40000 ALTER TABLE tbl_name DISABLE KEYS */>
    /*!40000 ALTER TABLE tbl_name ENABLE KEYS */ . 
    Speeds loading because the indexes are created after all rows are inserted.
    Only for nonunique indexes of MyISAM tables.
    across all databases. achieved by acquiring a global read lock for the duration of the whole dump.
    Turns off --single-transaction and --lock-tables.
    --no-autocommit Enclose INSERT within SET autocommit = 0 and COMMIT
    INSERT includes column names.
    --delayed-insert use INSERT DELAYED
    --insert-ignore use INSERT IGNORE
    --replace Use REPLACE rather than INSERT
    Use multiple-row INSERT syntax that include several VALUES lists.
    Creates a smaller dump file and speeds up inserts when loaded.
    For dumping large tables, retrieve a row at a time rather than retrieving the entire row set
    Quote identifiers (such as database, table, and column names) within "'" characters.
    If the ANSI_QUOTES SQL mode is enabled, uses "".
    Disabled with --skip-quote-names, but should be given after any option such as --compatible that may enable --quote-names. Default.
    --allow-keywords prefix column names with the table name.
    -w 'where_condition'
    Dump only rows selected by the given WHERE condition.
    Quotes around the condition are mandatory if it contains spaces or other special characters


    --add-drop-trigger before each CREATE TRIGGER statement.
    supported only by mysqldump as supplied with MySQL Cluster NDB 6.3.38, MySQL Cluster NDB 7.0.19, MySQL Cluster NDB 7.1.8, and later MySQL Cluster release. It is not available when using MySQL 5.1.
    ?? The recreation of views requires the creation and removal of temporary tables this suppressed the removal of those temporary tables.
    Otherwise, use --compact with the --add-drop-table option and then manually adjust the dump file.
    --compatible=name[,…] ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, or no_field_options.
    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 Section 5.1.7, "Server SQL Modes".

    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, --compatible=oracle does not map data types to Oracle types or use Oracle comment syntax.

    -# [debug_options]
    Write a debugging log. A typical debug_options string is 'd:t:o,file_name'.
    The default value is 'd:t:o,/tmp/mysqldump.trace'.
    --debug-check output debugging information when the program exits.
    --debug-info and memory and CPU usage statistics
    --default-character-set=charset_name See Section 9.5, "Character Set Configuration".
    If no character set is specified uses utf8, and earlier versions use latin1.
    --set-charset Add SET NAMES default_character_set .
    To suppress SET NAMES, use --skip-set-charset.
    Same as --skip-set-charset.
    Include Event Scheduler events
    --triggers Include triggers for each dumped table in the output. Enabled by default; disable it with --skip-triggers.
    Include stored procedures and functions. Requires the SELECT privilege for mysql.proc.
    CREATE PROCEDURE and CREATE FUNCTION to re-create the routines. do not include attributes such as the routine creation and modification timestamps.

    To preserve times dump and reload the mysql.proc table directly, using an account with appropriate privileges

    --first-slave Deprecated. Use --lock-all-tables instead. --first-slave is removed in MySQL 5.5.
    before starting . Requires the RELOAD privilege.
    With --all-databases the logs are flushed for each database.
    Exception: --lock-all-tables or --master-data: logs are flushed only once, when all tables are locked.
    To dump and the log flush at exactly the same moment, use --flush-logs with either --lock-all-tables or --master-data.
    --flush-privileges Send FLUSH PRIVILEGES to the server after dumping database. should be used any time the dump contains the mysql database and any other database that depends on the data in the mysql database for proper restoration.
    added in MySQL 5.1.12.
    --hex-blob Dump binary columns using hexadecimal notation (for example, 'abc' becomes 0x616263). The affected data types are BINARY, VARBINARY, the BLOB types, and BIT.
    ?? For each dumped database, before dumping them with READ LOCAL permitting concurrent inserts with MyISAM tables.
    For transactional tables such as InnoDB, use --single-transaction

    Locks tables for each database separately, does not guarantee that the tables are logically consistent between databases. Tables in different databases may be dumped in different states.

    --master-data[=value] dump a master replication server. Can be used to set up another server as a slave of the master. Include CHANGE MASTER TO that indicates the binary log coordinates (file name and position) of the dumped server. These are the master server coordinates from which the slave should start replicating after loading the dump into the slave.

    1 the statement is not written as a comment, default.
    2: CHANGE MASTER TO is written as a comment.

    Requires RELOAD privilege and the binary log must be enabled.

    Enables --lock-all-tables, unless --single-transaction also is specified, in which case, a global read lock is acquired only for a short time at the beginning of the dump
    (see --single-transaction).

    any action on logs happens at the exact moment of the dump.

    It is also possible to set up a slave by dumping an existing slave .
    To do this:

    1. Stop the slave's SQL thread and get its current status:
                         mysql> STOP SLAVE SQL_THREAD;
                         mysql> SHOW SLAVE STATUS;
    2. From the output of the SHOW SLAVE STATUS statement, the binary log coordinates of the master server from which the new slave should start replicating are the values of the Relay_Master_Log_File and Exec_Master_Log_Pos fields.
      Denote those as file_name and file_pos.
    3. Dump the slave server: shell> mysqldump --master-data=2 --all-databases > dumpfile
    4. Restart the slave: mysql> START SLAVE;
    5. On the new slave, load the dump file: shell> mysql < dumpfile
    6. On the new slave, set the replication coordinates to those of the master server obtained earlier:

      mysql> CHANGE MASTER TO -> MASTER_LOG_FILE = 'file_name', MASTER_LOG_POS = file_pos;

    The CHANGE MASTER TO statement might also need other parameters, such as MASTER_HOST to point the slave to the correct master server host. Add any such parameters as necessary.

    suppresses CREATE DATABASE
    Do not write CREATE TABLE

    Does not not exclude statements creating log file groups or tablespaces
    MySQL 5.1.14 and later, use --no-tablespaces

    Do not write any table row information (that is, do not dump table contents).
    Use to dump only CREATE TABLE (for example, to create an empty copy of the table by loading the dump file).
    --order-by-primary or by first unique index.
    Useful when dumping a MyISAM table to be loaded into an InnoDB table, takes considerably longer.
    On Windows, connect to the server using a named pipe.
    --bind-address=ip_address On a computer having multiple network interfaces, select which interface is employed when connecting to the MySQL server.

    This option is supported only in the version of mysqldump that is supplied with MySQL Cluster, beginning with MySQL Cluster NDB 6.3.4. It is not available in standard MySQL 5.1 releases.

    -P port_num
    TCP/IP port number to use for the connection.
    --protocol={TCP|SOCKET|PIPE|MEMORY} for connecting to the server. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. For details on the permissible values, see Section 4.2.2, "Connecting to the MySQL Server".
    -S path
    For connections to localhost, the Unix socket file to use, or,
    on Windows, the name of the named pipe to use.
    --single-transaction Sends START TRANSACTION to server before dumping data.
    Only with transactional tables such as InnoDB, because then it dumps the consistent state of the database at the time when BEGIN was issued without blocking any applications.

    While a --single-transaction dump is in process no other connection should use ALTER TABLE, CREATE TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE.
    A consistent read is not isolated from those statements, so use of them on a table to be dumped can cause the SELECT used to obtain incorrect contents or fail.

    The --single-transaction and --lock-tables are mutually exclusive because LOCK TABLES causes any pending transactions to be committed implicitly.

    Not supported for Cluster tables; the results cannot be guaranteed to be consistent due to the fact that the NDBCLUSTER storage engine supports only the READ_COMMITTED transaction isolation level.
    Use NDB backup and restore instead.

    For large tables use --single-transaction --quick.

    --ssl* Options that begin with --ssl specify connection to the server using SSL and indicate where to find SSL keys and certificates. See Section, "SSL Command Options".
    --tz-utc mysqldump sets its connection time zone to UTC and adds SET TIME_ZONE='+00:00' to the dump which can be changed manually ??.

    TIMESTAMP columns can be dumped and reloaded between servers in different time zones.

    Otherwise TIMESTAMP columns can change values if the servers are in different time zones.

    Also protects against changes due to daylight saving time.

    Disable with --skip-tz-utc.

    By default the dump is formatted as a sequence of SQL statments.
    -T path
    Produce tab-separated text-format data files.
    For each table, creates tbl_name.sql that contains the CREATE TABLE statement.
    The server creates tbl_name.txt in path

    Used only when run on the same machine as the mysqld server.
    Requires FILE privilege, and the server must have permission to write files in the directory.
    Default: .txt with a newline at the end of each line.
    The format can be specified explicitly using --fields-xxx and --lines-terminated-by .

    --lines-terminated-by=x With --tab has the same meaning as the corresponding LINES clause for LOAD DATA INFILE.
    See Section 12.2.6, "LOAD DATA INFILE Syntax".
    with --tab same meaning as the corresponding FIELDS clauses for LOAD DATA INFILE.
    See Section 12.2.6, "LOAD DATA INFILE Syntax".
    Write output as well-formed XML.

    NULL, 'NULL', and Empty Values: NULL value, an empty string, and the string value 'NULL' are distinguished from one another

      |Value:                | XML Representation:                         |
      |NULL (unknown value)  | <field name="column_name" xsi:nil="true" /> |
      |'' (empty string)     | <field name="column_name"><field>          |
      |'NULL' (string value) | <field name="column_name">NULL<field>      |

    Beginning with MySQL 5.1.18, XML output from mysqldump includes the XML namespace, as shown here:

      shell> mysqldump --xml -u root world City
      <?xml version="1.0"?>
      <mysqldump xmlns:xsi="">
      <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="273293" Max_data_length="18858823439613951"
      Index_length="43008" Data_free="0" Auto_increment="4080"
      Create_time="2007-03-31 01:47:01" Update_time="2007-03-31 01:47:02"
      Collation="latin1_swedish_ci" Create_options="" Comment="" />
      <table_data name="City">
      <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>
      <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>
    --delete-master-logs On a master replication server, delete the binary logs by sending PURGE BINARY LOGS to the server after performing the dump. --master-data.
    --help, -? Display a help message and exit.

    To reverse the effect of a group option, uses its --skip-xxx form (--skip-opt or --skip-compact).
    Or select only part of the effect of a group option by following it with options that enable or disable specific features.

    To select the effect of --opt except for some features, use the --skip option for each feature.
    To disable extended inserts and memory buffering, use --skip-extended-insert --skip-quick.

    To reverse --opt for all features except index disabling and table locking, use --skip-opt --disable-keys --lock-tables.

    Order is important because options are processed first to last.
    For example, --disable-keys --lock-tables --skip-opt
    would not have the intended effect; it is the same as --skip-opt by itself.

    mysqldump 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 with large tables.
    To enable memory buffering, use --skip-quick.

    The initial size of the buffer for client/server communication. When creating multiple-row INSERT statements (as with the --extended-insert or --opt option), mysqldump creates rows up to net_buffer_length length. If you increase this variable, you should also ensure that the net_buffer_length variable in the MySQL server is at least this large.

    set variables using --varname=value syntax:
    --net_buffer_length=nnn --max_allowed_packet=nnnn buffer for client/server communication. maximum is 1GB.


    making a backup of an entire database:
     > mysqldump db_name > backup-file.sql

    Load the dump file into a server :

     > mysql db_name < backup-file.sql


     > mysql -e "source /path-to-backup/backup-file.sql" db_name

    Copy data from one server to another:

    > mysqldump --opt db_name | mysql --host=remote_host -C db_name

    Dump several databases with one command:

    > mysqldump --databases db_name1 [db_name2 ...] > my_databases.sql

    To dump all databases, use the --all-databases option:

    >  mysqldump --all-databases > all_databases.sql

    For InnoDB tables, mysqldump provides a way of making an online backup:

    shell> mysqldump --all-databases --single-transaction > all_databases.sql

    This backup acquires a global read lock on all tables (using FLUSH TABLES WITH READ LOCK) 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 long updating statements are running when the FLUSH statement is issued, the MySQL server may get stalled until those statements finish. After that, the dump becomes lock free and does not disturb reads and writes on the tables. 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.

    For point-in-time recovery (also known as "roll-forward," 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 Section 5.2.4, "The Binary Log") or at least know the binary log coordinates to which the dump corresponds:

    > mysqldump --all-databases --master-data=2 > all_databases.sql


    > mysqldump --all-databases --flush-logs --master-data=2 > all_databases.sql

    The --master-data and --single-transaction options can be used simultaneously, which provides a convenient way to make an online backup suitable for use prior to point-in-time recovery if tables are stored using the InnoDB storage engine.

    For more information on making backups, see Section 6.2, "Database Backup Methods", and Section 6.3, "Example Backup and Recovery Strategy".

    If you encounter problems backing up views, read the section that covers restrictions on views which describes a workaround for backing up views when this fails due to insufficient privileges. See Section E.4, "Restrictions on Views".

    Copyright © 1997, 2011, Oracle and/or its affiliates. All rights reserved.
    This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

    This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see

    NOTES 1. Bug#30123

    SEE ALSO For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online at

    original AUTHOR: Oracle Corporation
    MySQL 5.1 02/11/2011 MYSQLDUMP(1)

     /usr/bin > mysqldump --help
    mysqldump  Ver 10.13 Distrib 5.1.56, for unknown-linux-gnu (x86_64)
    By Igor Romanenko, Monty, Jani & Sinisa.
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license.
    Dumping structure and contents of MySQL databases and tables.
    Usage: mysqldump [OPTIONS] database [tables]
    OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
    OR     mysqldump [OPTIONS] --all-databases [OPTIONS]

    Default options are read from the following files in the given order: /etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf The following groups are read: mysqldump client The following options may be given as the first argument: --print-defaults Print the program argument list and exit. --no-defaults Don't read default options from any option file. --defaults-file=# Only read default options from the given file #. --defaults-extra-file=# Read this file after the global files are read. --all Deprecated. Use --create-options instead. -A, --all-databases Dump all the databases. This will be same as --databases with all databases selected. -Y, --all-tablespaces Dump all the tablespaces. -y, --no-tablespaces Do not dump any tablespace information. --add-drop-database Add a DROP DATABASE before each create. --add-drop-table Add a DROP TABLE before each create. --add-locks Add locks around INSERT statements. --allow-keywords Allow creation of column names that are keywords. --character-sets-dir=name Directory for character set files. -i, --comments Write additional information. --compatible=name Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. ignored with earlier server versions. --compact Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --skip-add-locks --skip-comments --skip-disable-keys --skip-set-charset. -c, --complete-insert Use complete insert statements. -C, --compress Use compression in server/client protocol. -a, --create-options Include all MySQL specific create options. -B, --databases Dump several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names. 'USE db_name;' will be included in the output. -#, --debug[=#] This is a non-debug version. Catch this and exit. --debug-check Check memory and open file usage at exit. --debug-info Print some debug info at exit. --default-character-set=name Set the default character set. --delayed-insert Insert rows with INSERT DELAYED. --delete-master-logs Delete logs on master after backup. This automatically enables --master-data. -K, --disable-keys '/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output. -E, --events Dump events. -e, --extended-insert Use multiple-row INSERT syntax that include several VALUES lists. --fields-terminated-by=name Fields in the output file are terminated by the given string. --fields-enclosed-by=name Fields in the output file are enclosed by the given character. --fields-optionally-enclosed-by=name Fields in the output file are optionally enclosed by the given character. --fields-escaped-by=name Fields in the output file are escaped by the given character. --first-slave Deprecated, renamed to --lock-all-tables. -F, --flush-logs Flush logs file in server before starting dump. Note that if you dump many databases at once (using the option --databases= or --all-databases), the logs will be flushed for each database dumped. The exception is when using --lock-all-tables or --master-data: in this case the logs will be flushed only once, corresponding to the moment all tables are locked. So if you want your dump and the log flush to happen at the same exact moment you should use --lock-all-tables or --master-data with --flush-logs. --flush-privileges Emit a FLUSH PRIVILEGES statement after dumping the mysql database. used any time the dump contains the mysql database and any other database that depends on the data in the mysql database for proper restore. -f, --force Continue even if we get an SQL error. -?, --help Display this help message and exit. --hex-blob Dump binary strings (BINARY, VARBINARY, BLOB) in hexadecimal format. -h, --host=name Connect to host. --ignore-table=name Do not dump the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table. Each table must be specified with both database and table names, e.g., --ignore-table=database.table. --insert-ignore Insert rows with INSERT IGNORE. --lines-terminated-by=name Lines in the output file are terminated by the given string. -x, --lock-all-tables Locks all tables across all databases. This is achieved by taking a global read lock for the duration of the whole dump. Automatically turns --single-transaction and --lock-tables off. -l, --lock-tables Lock all tables for read. --log-error=name Append warnings and errors to given file. --master-data[=#] This causes the binary log position and filename to be appended to the output. If equal to 1, will print it as a CHANGE MASTER command; if equal to 2, that command will be prefixed with a comment symbol. This option will turn --lock-all-tables on, unless --single-transaction is specified too (in which case a global read lock is only taken a short time at the beginning of the dump; don't forget to read about --single-transaction below). In all cases, any action on logs will happen at the exact moment of the dump. Option automatically turns --lock-tables off. --max_allowed_packet=# The maximum packet length to send to or receive from server. --net_buffer_length=# The buffer size for TCP/IP and socket communication. --no-autocommit Wrap tables with autocommit/commit statements. -n, --no-create-db Suppress the CREATE DATABASE ... IF EXISTS statement that normally is output for each dumped database if --all-databases or --databases is given. -t, --no-create-info Don't write table creation info. -d, --no-data No row information. -N, --no-set-names Suppress the SET NAMES statement --opt Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt. --order-by-primary Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer. -p, --password[=name] Password to use when connecting to server. If password is not given it's solicited on the tty. -P, --port=# Port number to use for connection. --protocol=name The protocol to use for connection (tcp, socket, pipe, memory). -q, --quick Don't buffer query, dump directly to stdout. -Q, --quote-names Quote table and column names with backticks (`). --replace Use REPLACE INTO instead of INSERT INTO. -r, --result-file=name Direct output to a given file. Used in MSDOS, because it prevents new line '\n' from being converted to '\r\n' (carriage return + line feed). -R, --routines Dump stored routines (functions and procedures). --set-charset Add 'SET NAMES default_character_set' to the output. Enabled by default; suppress with --skip-set-charset. -O, --set-variable=name Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value. --single-transaction Creates a consistent snapshot by dumping all tables in a single transaction. Works ONLY for tables stored in storage engines which support multiversioning (currently only InnoDB does); the dump is NOT guaranteed to be consistent for other storage engines. While a --single-transaction 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: ALTER TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not isolated from them. Option automatically turns off --lock-tables. --dump-date Put a dump date to the end of the output. --skip-opt Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. -S, --socket=name The socket file to use for connection. --ssl Enable SSL for connection (automatically enabled with other flags).Disable with --skip-ssl. --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl). --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl). --ssl-cert=name X509 cert in PEM format (implies --ssl). --ssl-cipher=name SSL cipher to use (implies --ssl). --ssl-key=name X509 key in PEM format (implies --ssl). --ssl-verify-server-cert Verify server's "Common Name" in its cert against hostname used when connecting. Disabled by default. -T, --tab=name Create tab-separated textfile for each table to given path. (Create .sql and .txt files.) NOTE: This only works if mysqldump is run on the same machine as the mysqld server. --tables Overrides option --databases (-B). --triggers Dump triggers for each dumped table. --tz-utc SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones. -u, --user=name User for login if not current user. -v, --verbose Print info about the various stages. -V, --version Output version information and exit. -w, --where=name Dump only selected records. Quotes are mandatory. -X, --xml Dump a database as well formed XML.

    Variables (--variable-name=value) and boolean options {FALSE|TRUE} Value (after reading options) --------------------------------- -----------------------------

    all TRUE all-databases FALSE all-tablespaces FALSE no-tablespaces FALSE add-drop-database FALSE add-drop-table TRUE add-locks TRUE allow-keywords FALSE character-sets-dir (No default value) comments TRUE compatible (No default value) compact FALSE complete-insert FALSE compress FALSE create-options TRUE databases FALSE debug-check FALSE debug-info FALSE default-character-set utf8 delayed-insert FALSE delete-master-logs FALSE disable-keys TRUE events FALSE extended-insert TRUE fields-terminated-by (No default value) fields-enclosed-by (No default value) fields-optionally-enclosed-by(No default value) fields-escaped-by (No default value) first-slave FALSE flush-logs FALSE flush-privileges FALSE force FALSE hex-blob FALSE host (No default value) insert-ignore FALSE lines-terminated-by (No default value) lock-all-tables FALSE lock-tables TRUE log-error (No default value) master-data 0 max_allowed_packet 25165824 net_buffer_length 1046528 no-autocommit FALSE no-create-db FALSE no-create-info FALSE no-data FALSE order-by-primary FALSE port 0 quick TRUE quote-names TRUE replace FALSE routines FALSE set-charset TRUE single-transaction FALSE dump-date TRUE socket (No default value) ssl FALSE ssl-ca (No default value) ssl-capath (No default value) ssl-cert (No default value) ssl-cipher (No default value) ssl-key (No default value) ssl-verify-server-cert FALSE tab (No default value) triggers TRUE tz-utc TRUE user (No default value) verbose FALSE where (No default value)