{
    "content": [
        {
            "type": "text",
            "text": "# MYSQLDUMP(1) (man)\n\n**Summary:** mysqldump - a database backup program\n\n**Synopsis:** mysqldump [options] [dbname [tblname ...]]\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (2010 lines)\n- **COPYRIGHT** (15 lines)\n- **NOTES** (12 lines)\n- **SEE ALSO** (3 lines)\n- **AUTHOR** (5 lines)\n\n## Full Content\n\n### NAME\n\nmysqldump - a database backup program\n\n### SYNOPSIS\n\nmysqldump [options] [dbname [tblname ...]]\n\n### DESCRIPTION\n\nThe mysqldump client utility performs logical backups, producing a set of SQL statements that\ncan be executed to reproduce the original database object definitions and table data. It\ndumps one or more MySQL databases for backup or transfer to another SQL server. The mysqldump\ncommand can also generate output in CSV, other delimited text, or XML format.\n\nTip\nConsider using the MySQL Shell dump utilities[1], which provide parallel dumping with\nmultiple threads, file compression, and progress information display, as well as cloud\nfeatures such as Oracle Cloud Infrastructure Object Storage streaming, and MySQL HeatWave\nService compatibility checks and modifications. Dumps can be easily imported into a MySQL\nServer instance or a MySQL HeatWave Service DB System using the MySQL Shell load dump\nutilities[2]. Installation instructions for MySQL Shell can be found here[3].\n\n•   Performance and Scalability Considerations\n\n•   Invocation Syntax\n\n•   Option Syntax - Alphabetical Summary\n\n•   Connection Options\n\n•   Option-File Options\n\n•   DDL Options\n\n•   Debug Options\n\n•   Help Options\n\n•   Internationalization Options\n\n•   Replication Options\n\n•   Format Options\n\n•   Filtering Options\n\n•   Performance Options\n\n•   Transactional Options\n\n•   Option Groups\n\n•   Examples\n\n•   Restrictions\n\nmysqldump requires at least the SELECT privilege for dumped tables, SHOW VIEW for dumped\nviews, TRIGGER for dumped triggers, LOCK TABLES if the --single-transaction option is not\nused, PROCESS (as of MySQL 8.0.21) if the --no-tablespaces option is not used, and (as of\nMySQL 8.0.32) the RELOAD or FLUSHTABLES privilege with --single-transaction if both\ngtidmode=ON and gtidpurged=ON|AUTO. Certain options might require other privileges as noted\nin the option descriptions.\n\nTo reload a dump file, you must have the privileges required to execute the statements that\nit contains, such as the appropriate CREATE privileges for objects created by those\nstatements.\n\nmysqldump output can include ALTER DATABASE statements that change the database collation.\nThese may be used when dumping stored programs to preserve their character encodings. To\nreload a dump file containing such statements, the ALTER privilege for the affected database\nis required.\n\nNote\nA dump made using PowerShell on Windows with output redirection creates a file that has\nUTF-16 encoding:\n\nmysqldump [options] > dump.sql\n\nHowever, UTF-16 is not permitted as a connection character set (see the section called\n“Impermissible Client Character Sets”), so the dump file cannot be loaded correctly. To\nwork around this issue, use the --result-file option, which creates the output in ASCII\nformat:\n\nmysqldump [options] --result-file=dump.sql\n\nIt is not recommended to load a dump file when GTIDs are enabled on the server\n(gtidmode=ON), if your dump file includes system tables.  mysqldump issues DML instructions\nfor the system tables which use the non-transactional MyISAM storage engine, and this\ncombination is not permitted when GTIDs are enabled.  Performance and Scalability\nConsiderations\n\nmysqldump advantages include the convenience and flexibility of viewing or even editing the\noutput before restoring. You can clone databases for development and DBA work, or produce\nslight variations of an existing database for testing. It is not intended as a fast or\nscalable solution for backing up substantial amounts of data. With large data sizes, even if\nthe backup step takes a reasonable time, restoring the data can be very slow because\nreplaying the SQL statements involves disk I/O for insertion, index creation, and so on.\n\nFor large-scale backup and restore, a physical backup is more appropriate, to copy the data\nfiles in their original format so that they can be restored quickly.\n\nIf your tables are primarily InnoDB tables, or if you have a mix of InnoDB and MyISAM tables,\nconsider using mysqlbackup, which is available as part of MySQL Enterprise. This tool\nprovides high performance for InnoDB backups with minimal disruption; it can also back up\ntables from MyISAM and other storage engines; it also provides a number of convenient options\nto accommodate different backup scenarios. See Section 32.1, “MySQL Enterprise Backup\nOverview”.\n\nmysqldump can retrieve and dump table contents row by row, or it can retrieve the entire\ncontent from a table and buffer it in memory before dumping it. Buffering in memory can be a\nproblem if you are dumping large tables. To dump tables row by row, use the --quick option\n(or --opt, which enables --quick). The --opt option (and hence --quick) is enabled by\ndefault, so to enable memory buffering, use --skip-quick.\n\nIf you are using a recent version of mysqldump to generate a dump to be reloaded into a very\nold MySQL server, use the --skip-opt option instead of the --opt or --extended-insert option.\n\nFor additional information about mysqldump, see Section 9.4, “Using mysqldump for Backups”.\nInvocation Syntax\n\nThere are in general three ways to use mysqldump—in order to dump a set of one or more\ntables, a set of one or more complete databases, or an entire MySQL server—as shown here:\n\nmysqldump [options] dbname [tblname ...]\nmysqldump [options] --databases dbname ...\nmysqldump [options] --all-databases\n\nTo dump entire databases, do not name any tables following dbname, or use the --databases or\n--all-databases option.\n\nTo see a list of the options your version of mysqldump supports, issue the command mysqldump\n--help.  Option Syntax - Alphabetical Summary\n\nmysqldump supports the following options, which can be specified on the command line or in\nthe [mysqldump] and [client] groups of an option file. For information about option files\nused by MySQL programs, see Section 6.2.2.2, “Using Option Files”.  Connection Options\n\nThe mysqldump command logs into a MySQL server to extract information. The following options\nspecify how to connect to the MySQL server, either on the same machine or a remote system.\n\n•   --bind-address=ipaddress\n\n┌────────────────────┬───────────────────────────┐\n│Command-Line Format │ --bind-address=ipaddress │\n└────────────────────┴───────────────────────────┘\nOn a computer having multiple network interfaces, use this option to select which\ninterface to use for connecting to the MySQL server.\n\n•   --compress, -C\n\n┌────────────────────┬───────────────────────┐\n│Command-Line Format │ --compress[={OFF|ON}] │\n├────────────────────┼───────────────────────┤\n│Deprecated          │ 8.0.18                │\n├────────────────────┼───────────────────────┤\n│Type                │ Boolean               │\n├────────────────────┼───────────────────────┤\n│Default Value       │ OFF                   │\n└────────────────────┴───────────────────────┘\nCompress all information sent between the client and the server if possible. See\nSection 6.2.8, “Connection Compression Control”.\n\nAs of MySQL 8.0.18, this option is deprecated. Expect it to be removed in a future\nversion of MySQL. See the section called “Configuring Legacy Connection Compression”.\n\n•   --compression-algorithms=value\n\n┌────────────────────┬────────────────────────────────┐\n│Command-Line Format │ --compression-algorithms=value │\n├────────────────────┼────────────────────────────────┤\n│Introduced          │ 8.0.18                         │\n├────────────────────┼────────────────────────────────┤\n│Type                │ Set                            │\n├────────────────────┼────────────────────────────────┤\n│Default Value       │ uncompressed                   │\n├────────────────────┼────────────────────────────────┤\n│Valid Values        │                                │\n│                    │            zlib                │\n│                    │                                │\n│                    │            zstd                │\n│                    │                                │\n│                    │            uncompressed        │\n└────────────────────┴────────────────────────────────┘\nThe permitted compression algorithms for connections to the server. The available\nalgorithms are the same as for the protocolcompressionalgorithms system variable. The\ndefault value is uncompressed.\n\nFor more information, see Section 6.2.8, “Connection Compression Control”.\n\nThis option was added in MySQL 8.0.18.\n\n•   --default-auth=plugin\n\n┌────────────────────┬───────────────────────┐\n│Command-Line Format │ --default-auth=plugin │\n├────────────────────┼───────────────────────┤\n│Type                │ String                │\n└────────────────────┴───────────────────────┘\nA hint about which client-side authentication plugin to use. See Section 8.2.17,\n“Pluggable Authentication”.\n\n•   --enable-cleartext-plugin\n\n┌────────────────────┬───────────────────────────┐\n│Command-Line Format │ --enable-cleartext-plugin │\n├────────────────────┼───────────────────────────┤\n│Type                │ Boolean                   │\n├────────────────────┼───────────────────────────┤\n│Default Value       │ FALSE                     │\n└────────────────────┴───────────────────────────┘\nEnable the mysqlclearpassword cleartext authentication plugin. (See Section 8.4.1.4,\n“Client-Side Cleartext Pluggable Authentication”.)\n\n•   --get-server-public-key\n\n┌────────────────────┬─────────────────────────┐\n│Command-Line Format │ --get-server-public-key │\n├────────────────────┼─────────────────────────┤\n│Type                │ Boolean                 │\n└────────────────────┴─────────────────────────┘\nRequest from the server the public key required for RSA key pair-based password exchange.\nThis option applies to clients that authenticate with the cachingsha2password\nauthentication plugin. For that plugin, the server does not send the public key unless\nrequested. This option is ignored for accounts that do not authenticate with that plugin.\nIt is also ignored if RSA-based password exchange is not used, as is the case when the\nclient connects to the server using a secure connection.\n\nIf --server-public-key-path=filename is given and specifies a valid public key file, it\ntakes precedence over --get-server-public-key.\n\nFor information about the cachingsha2password plugin, see Section 8.4.1.2, “Caching\nSHA-2 Pluggable Authentication”.\n\n•   --host=hostname, -h hostname\n\n┌────────────────────┬────────┐\n│Command-Line Format │ --host │\n└────────────────────┴────────┘\nDump data from the MySQL server on the given host. The default host is localhost.\n\n•   --login-path=name\n\n┌────────────────────┬───────────────────┐\n│Command-Line Format │ --login-path=name │\n├────────────────────┼───────────────────┤\n│Type                │ String            │\n└────────────────────┴───────────────────┘\nRead options from the named login path in the .mylogin.cnf login path file. A “login\npath” is an option group containing options that specify which MySQL server to connect to\nand which account to authenticate as. To create or modify a login path file, use the\nmysqlconfigeditor utility. See mysqlconfigeditor(1).\n\nFor additional information about this and other option-file options, see Section 6.2.2.3,\n“Command-Line Options that Affect Option-File Handling”.\n\n•   --password[=password], -p[password]\n\n┌────────────────────┬───────────────────────┐\n│Command-Line Format │ --password[=password] │\n├────────────────────┼───────────────────────┤\n│Type                │ String                │\n└────────────────────┴───────────────────────┘\nThe password of the MySQL account used for connecting to the server. The password value\nis optional. If not given, mysqldump prompts for one. If given, there must be no space\nbetween --password= or -p and the password following it. If no password option is\nspecified, the default is to send no password.\n\nSpecifying a password on the command line should be considered insecure. To avoid giving\nthe password on the command line, use an option file. See Section 8.1.2.1, “End-User\nGuidelines for Password Security”.\n\nTo explicitly specify that there is no password and that mysqldump should not prompt for\none, use the --skip-password option.\n\n•   --password1[=passval] The password for multifactor authentication factor 1 of the MySQL\naccount used for connecting to the server. The password value is optional. If not given,\nmysqldump prompts for one. If given, there must be no space between --password1= and the\npassword following it. If no password option is specified, the default is to send no\npassword.\n\nSpecifying a password on the command line should be considered insecure. To avoid giving\nthe password on the command line, use an option file. See Section 8.1.2.1, “End-User\nGuidelines for Password Security”.\n\nTo explicitly specify that there is no password and that mysqldump should not prompt for\none, use the --skip-password1 option.\n\n--password1 and --password are synonymous, as are --skip-password1 and --skip-password.\n\n•   --password2[=passval] The password for multifactor authentication factor 2 of the MySQL\naccount used for connecting to the server. The semantics of this option are similar to\nthe semantics for --password1; see the description of that option for details.\n\n•   --password3[=passval] The password for multifactor authentication factor 3 of the MySQL\naccount used for connecting to the server. The semantics of this option are similar to\nthe semantics for --password1; see the description of that option for details.\n\n•   --pipe, -W\n\n┌────────────────────┬────────┐\n│Command-Line Format │ --pipe │\n├────────────────────┼────────┤\n│Type                │ String │\n└────────────────────┴────────┘\nOn Windows, connect to the server using a named pipe. This option applies only if the\nserver was started with the namedpipe system variable enabled to support named-pipe\nconnections. In addition, the user making the connection must be a member of the Windows\ngroup specified by the namedpipefullaccessgroup system variable.\n\n•   --plugin-authentication-kerberos-client-mode=value\n\n┌────────────────────┬───────────────────────────────────┐\n│Command-Line Format │ --plugin-authentication-kerberos- │\n│                    │ client-mode                       │\n├────────────────────┼───────────────────────────────────┤\n│Introduced          │ 8.0.32                            │\n├────────────────────┼───────────────────────────────────┤\n│Type                │ String                            │\n├────────────────────┼───────────────────────────────────┤\n│Default Value       │ SSPI                              │\n├────────────────────┼───────────────────────────────────┤\n│Valid Values        │ GSSAPI                            │\n└────────────────────┴───────────────────────────────────┘\nOn Windows, the authenticationkerberosclient authentication plugin supports this plugin\noption. It provides two possible values that the client user can set at runtime: SSPI and\nGSSAPI.\n\nThe default value for the client-side plugin option uses Security Support Provider\nInterface (SSPI), which is capable of acquiring credentials from the Windows in-memory\ncache. Alternatively, the client user can select a mode that supports Generic Security\nService Application Program Interface (GSSAPI) through the MIT Kerberos library on\nWindows. GSSAPI is capable of acquiring cached credentials previously generated by using\nthe kinit command.\n\nFor more information, see Commands for Windows Clients in GSSAPI Mode.\n\n•   --plugin-dir=dirname\n\n┌────────────────────┬───────────────────────┐\n│Command-Line Format │ --plugin-dir=dirname │\n├────────────────────┼───────────────────────┤\n│Type                │ Directory name        │\n└────────────────────┴───────────────────────┘\nThe directory in which to look for plugins. Specify this option if the --default-auth\noption is used to specify an authentication plugin but mysqldump does not find it. See\nSection 8.2.17, “Pluggable Authentication”.\n\n•   --port=portnum, -P portnum\n\n┌────────────────────┬─────────────────┐\n│Command-Line Format │ --port=portnum │\n├────────────────────┼─────────────────┤\n│Type                │ Numeric         │\n├────────────────────┼─────────────────┤\n│Default Value       │ 3306            │\n└────────────────────┴─────────────────┘\nFor TCP/IP connections, the port number to use.\n\n•   --protocol={TCP|SOCKET|PIPE|MEMORY}\n\n┌────────────────────┬───────────────────┐\n│Command-Line Format │ --protocol=type   │\n├────────────────────┼───────────────────┤\n│Type                │ String            │\n├────────────────────┼───────────────────┤\n│Default Value       │ [see text]        │\n├────────────────────┼───────────────────┤\n│Valid Values        │                   │\n│                    │            TCP    │\n│                    │                   │\n│                    │            SOCKET │\n│                    │                   │\n│                    │            PIPE   │\n│                    │                   │\n│                    │            MEMORY │\n└────────────────────┴───────────────────┘\nThe transport protocol to use for connecting to the server. It is useful when the other\nconnection parameters normally result in use of a protocol other than the one you want.\nFor details on the permissible values, see Section 6.2.7, “Connection Transport\nProtocols”.\n\n•   --server-public-key-path=filename\n\n┌────────────────────┬──────────────────────┐\n│Command-Line Format │ --server-public-key- │\n│                    │ path=filename       │\n├────────────────────┼──────────────────────┤\n│Type                │ File name            │\n└────────────────────┴──────────────────────┘\nThe path name to a file in PEM format containing a client-side copy of the public key\nrequired by the server for RSA key pair-based password exchange. This option applies to\nclients that authenticate with the sha256password or cachingsha2password\nauthentication plugin. This option is ignored for accounts that do not authenticate with\none of those plugins. It is also ignored if RSA-based password exchange is not used, as\nis the case when the client connects to the server using a secure connection.\n\nIf --server-public-key-path=filename is given and specifies a valid public key file, it\ntakes precedence over --get-server-public-key.\n\nFor sha256password, this option applies only if MySQL was built using OpenSSL.\n\nFor information about the sha256password and cachingsha2password plugins, see\nSection 8.4.1.3, “SHA-256 Pluggable Authentication”, and Section 8.4.1.2, “Caching SHA-2\nPluggable Authentication”.\n\n•   --socket=path, -S path\n\n┌────────────────────┬────────────────────────────────┐\n│Command-Line Format │ --socket={filename|pipename} │\n├────────────────────┼────────────────────────────────┤\n│Type                │ String                         │\n└────────────────────┴────────────────────────────────┘\nFor connections to localhost, the Unix socket file to use, or, on Windows, the name of\nthe named pipe to use.\n\nOn Windows, this option applies only if the server was started with the namedpipe system\nvariable enabled to support named-pipe connections. In addition, the user making the\nconnection must be a member of the Windows group specified by the\nnamedpipefullaccessgroup system variable.\n\n•   --ssl* Options that begin with --ssl specify whether to connect to the server using\nencryption and indicate where to find SSL keys and certificates. See the section called\n“Command Options for Encrypted Connections”.\n\n•   --ssl-fips-mode={OFF|ON|STRICT}\n\n┌────────────────────┬─────────────────────────────────┐\n│Command-Line Format │ --ssl-fips-mode={OFF|ON|STRICT} │\n├────────────────────┼─────────────────────────────────┤\n│Deprecated          │ 8.0.34                          │\n├────────────────────┼─────────────────────────────────┤\n│Type                │ Enumeration                     │\n├────────────────────┼─────────────────────────────────┤\n│Default Value       │ OFF                             │\n├────────────────────┼─────────────────────────────────┤\n│Valid Values        │                                 │\n│                    │            OFF                  │\n│                    │                                 │\n│                    │            ON                   │\n│                    │                                 │\n│                    │            STRICT               │\n└────────────────────┴─────────────────────────────────┘\nControls whether to enable FIPS mode on the client side. The --ssl-fips-mode option\ndiffers from other --ssl-xxx options in that it is not used to establish encrypted\nconnections, but rather to affect which cryptographic operations to permit. See\nSection 8.8, “FIPS Support”.\n\nThese --ssl-fips-mode values are permitted:\n\n•   OFF: Disable FIPS mode.\n\n•   ON: Enable FIPS mode.\n\n•   STRICT: Enable “strict” FIPS mode.\n\n\nNote\nIf the OpenSSL FIPS Object Module is not available, the only permitted value for\n--ssl-fips-mode is OFF. In this case, setting --ssl-fips-mode to ON or STRICT causes\nthe client to produce a warning at startup and to operate in non-FIPS mode.\nAs of MySQL 8.0.34, this option is deprecated. Expect it to be removed in a future\nversion of MySQL.\n\n•   --tls-ciphersuites=ciphersuitelist\n\n┌────────────────────┬───────────────────────────────┐\n│Command-Line Format │ --tls-                        │\n│                    │ ciphersuites=ciphersuitelist │\n├────────────────────┼───────────────────────────────┤\n│Introduced          │ 8.0.16                        │\n├────────────────────┼───────────────────────────────┤\n│Type                │ String                        │\n└────────────────────┴───────────────────────────────┘\nThe permissible ciphersuites for encrypted connections that use TLSv1.3. The value is a\nlist of one or more colon-separated ciphersuite names. The ciphersuites that can be named\nfor this option depend on the SSL library used to compile MySQL. For details, see\nSection 8.3.2, “Encrypted Connection TLS Protocols and Ciphers”.\n\nThis option was added in MySQL 8.0.16.\n\n•   --tls-version=protocollist\n\n┌─────────────────────────┬──────────────────────────────────────────┐\n│Command-Line Format      │ --tls-version=protocollist              │\n├─────────────────────────┼──────────────────────────────────────────┤\n│Type                     │ String                                   │\n├─────────────────────────┼──────────────────────────────────────────┤\n│Default Value (≥≥ 8.0.16) │                                          │\n│                         │            TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 │\n│                         │            (OpenSSL 1.1.1 or             │\n│                         │            higher)                       │\n│                         │                                          │\n│                         │            TLSv1,TLSv1.1,TLSv1.2         │\n│                         │            (otherwise)                   │\n├─────────────────────────┼──────────────────────────────────────────┤\n│Default Value (≤≤ 8.0.15) │ TLSv1,TLSv1.1,TLSv1.2                    │\n└─────────────────────────┴──────────────────────────────────────────┘\nThe permissible TLS protocols for encrypted connections. The value is a list of one or\nmore comma-separated protocol names. The protocols that can be named for this option\ndepend on the SSL library used to compile MySQL. For details, see Section 8.3.2,\n“Encrypted Connection TLS Protocols and Ciphers”.\n\n•   --user=username, -u username\n\n┌────────────────────┬──────────────────┐\n│Command-Line Format │ --user=username │\n├────────────────────┼──────────────────┤\n│Type                │ String           │\n└────────────────────┴──────────────────┘\nThe user name of the MySQL account to use for connecting to the server.\n\nIf you are using the Rewriter plugin with MySQL 8.0.31 or later, you should grant this\nuser the SKIPQUERYREWRITE privilege.\n\n•   --zstd-compression-level=level\n\n┌────────────────────┬────────────────────────────┐\n│Command-Line Format │ --zstd-compression-level=# │\n├────────────────────┼────────────────────────────┤\n│Introduced          │ 8.0.18                     │\n├────────────────────┼────────────────────────────┤\n│Type                │ Integer                    │\n└────────────────────┴────────────────────────────┘\nThe compression level to use for connections to the server that use the zstd compression\nalgorithm. The permitted levels are from 1 to 22, with larger values indicating\nincreasing levels of compression. The default zstd compression level is 3. The\ncompression level setting has no effect on connections that do not use zstd compression.\n\nFor more information, see Section 6.2.8, “Connection Compression Control”.\n\nThis option was added in MySQL 8.0.18.\nOption-File Options\n\nThese options are used to control which option files to read.\n\n•   --defaults-extra-file=filename\n\n┌────────────────────┬─────────────────────────────────┐\n│Command-Line Format │ --defaults-extra-file=filename │\n├────────────────────┼─────────────────────────────────┤\n│Type                │ File name                       │\n└────────────────────┴─────────────────────────────────┘\nRead this option file after the global option file but (on Unix) before the user option\nfile. If the file does not exist or is otherwise inaccessible, an error occurs. If\nfilename is not an absolute path name, it is interpreted relative to the current\ndirectory.\n\nFor additional information about this and other option-file options, see Section 6.2.2.3,\n“Command-Line Options that Affect Option-File Handling”.\n\n•   --defaults-file=filename\n\n┌────────────────────┬───────────────────────────┐\n│Command-Line Format │ --defaults-file=filename │\n├────────────────────┼───────────────────────────┤\n│Type                │ File name                 │\n└────────────────────┴───────────────────────────┘\nUse only the given option file. If the file does not exist or is otherwise inaccessible,\nan error occurs. If filename is not an absolute path name, it is interpreted relative to\nthe current directory.\n\nException: Even with --defaults-file, client programs read .mylogin.cnf.\n\nFor additional information about this and other option-file options, see Section 6.2.2.3,\n“Command-Line Options that Affect Option-File Handling”.\n\n•   --defaults-group-suffix=str\n\n┌────────────────────┬─────────────────────────────┐\n│Command-Line Format │ --defaults-group-suffix=str │\n├────────────────────┼─────────────────────────────┤\n│Type                │ String                      │\n└────────────────────┴─────────────────────────────┘\nRead not only the usual option groups, but also groups with the usual names and a suffix\nof str. For example, mysqldump normally reads the [client] and [mysqldump] groups. If\nthis option is given as --defaults-group-suffix=other, mysqldump also reads the\n[clientother] and [mysqldumpother] groups.\n\nFor additional information about this and other option-file options, see Section 6.2.2.3,\n“Command-Line Options that Affect Option-File Handling”.\n\n•   --no-defaults\n\n┌────────────────────┬───────────────┐\n│Command-Line Format │ --no-defaults │\n└────────────────────┴───────────────┘\nDo not read any option files. If program startup fails due to reading unknown options\nfrom an option file, --no-defaults can be used to prevent them from being read.\n\nThe exception is that the .mylogin.cnf file is read in all cases, if it exists. This\npermits passwords to be specified in a safer way than on the command line even when\n--no-defaults is used. To create .mylogin.cnf, use the mysqlconfigeditor utility. See\nmysqlconfigeditor(1).\n\nFor additional information about this and other option-file options, see Section 6.2.2.3,\n“Command-Line Options that Affect Option-File Handling”.\n\n•   --print-defaults\n\n┌────────────────────┬──────────────────┐\n│Command-Line Format │ --print-defaults │\n└────────────────────┴──────────────────┘\nPrint the program name and all options that it gets from option files.\n\nFor additional information about this and other option-file options, see Section 6.2.2.3,\n“Command-Line Options that Affect Option-File Handling”.\nDDL Options\n\nUsage scenarios for mysqldump include setting up an entire new MySQL instance (including\ndatabase tables), and replacing data inside an existing instance with existing databases and\ntables. The following options let you specify which things to tear down and set up when\nrestoring a dump, by encoding various DDL statements within the dump file.\n\n•   --add-drop-database\n\n┌────────────────────┬─────────────────────┐\n│Command-Line Format │ --add-drop-database │\n└────────────────────┴─────────────────────┘\nWrite a DROP DATABASE statement before each CREATE DATABASE statement. This option is\ntypically used in conjunction with the --all-databases or --databases option because no\nCREATE DATABASE statements are written unless one of those options is specified.\n\nNote\nIn MySQL 8.0, the mysql schema is considered a system schema that cannot be dropped\nby end users. If --add-drop-database is used with --all-databases or with --databases\nwhere the list of schemas to be dumped includes mysql, the dump file contains a DROP\nDATABASE `mysql` statement that causes an error when the dump file is reloaded.\n\nInstead, to use --add-drop-database, use --databases with a list of schemas to be\ndumped, where the list does not include mysql.\n\n•   --add-drop-table\n\n┌────────────────────┬──────────────────┐\n│Command-Line Format │ --add-drop-table │\n└────────────────────┴──────────────────┘\nWrite a DROP TABLE statement before each CREATE TABLE statement.\n\n•   --add-drop-trigger\n\n┌────────────────────┬────────────────────┐\n│Command-Line Format │ --add-drop-trigger │\n└────────────────────┴────────────────────┘\nWrite a DROP TRIGGER statement before each CREATE TRIGGER statement.\n\n•   --all-tablespaces, -Y\n\n┌────────────────────┬───────────────────┐\n│Command-Line Format │ --all-tablespaces │\n└────────────────────┴───────────────────┘\nAdds to a table dump all SQL statements needed to create any tablespaces used by an NDB\ntable. This information is not otherwise included in the output from mysqldump. This\noption is currently relevant only to NDB Cluster tables.\n\n•   --no-create-db, -n\n\n┌────────────────────┬────────────────┐\n│Command-Line Format │ --no-create-db │\n└────────────────────┴────────────────┘\nSuppress the CREATE DATABASE statements that are otherwise included in the output if the\n--databases or --all-databases option is given.\n\n•   --no-create-info, -t\n\n┌────────────────────┬──────────────────┐\n│Command-Line Format │ --no-create-info │\n└────────────────────┴──────────────────┘\nDo not write CREATE TABLE statements that create each dumped table.\n\nNote\nThis option does not exclude statements creating log file groups or tablespaces from\nmysqldump output; however, you can use the --no-tablespaces option for this purpose.\n\n•   --no-tablespaces, -y\n\n┌────────────────────┬──────────────────┐\n│Command-Line Format │ --no-tablespaces │\n└────────────────────┴──────────────────┘\nThis option suppresses all CREATE LOGFILE GROUP and CREATE TABLESPACE statements in the\noutput of mysqldump.\n\n•   --replace\n\n┌────────────────────┬───────────┐\n│Command-Line Format │ --replace │\n└────────────────────┴───────────┘\nWrite REPLACE statements rather than INSERT statements.\nDebug Options\n\nThe following options print debugging information, encode debugging information in the dump\nfile, or let the dump operation proceed regardless of potential problems.\n\n•   --allow-keywords\n\n┌────────────────────┬──────────────────┐\n│Command-Line Format │ --allow-keywords │\n└────────────────────┴──────────────────┘\nPermit creation of column names that are keywords. This works by prefixing each column\nname with the table name.\n\n•   --comments, -i\n\n┌────────────────────┬────────────┐\n│Command-Line Format │ --comments │\n└────────────────────┴────────────┘\nWrite additional information in the dump file such as program version, server version,\nand host. This option is enabled by default. To suppress this additional information, use\n--skip-comments.\n\n•   --debug[=debugoptions], -# [debugoptions]\n\n┌────────────────────┬────────────────────────────┐\n│Command-Line Format │ --debug[=debugoptions]    │\n├────────────────────┼────────────────────────────┤\n│Type                │ String                     │\n├────────────────────┼────────────────────────────┤\n│Default Value       │ d:t:o,/tmp/mysqldump.trace │\n└────────────────────┴────────────────────────────┘\nWrite a debugging log. A typical debugoptions string is d:t:o,filename. The default\nvalue is d:t:o,/tmp/mysqldump.trace.\n\nThis option is available only if MySQL was built using WITHDEBUG. MySQL release binaries\nprovided by Oracle are not built using this option.\n\n•   --debug-check\n\n┌────────────────────┬───────────────┐\n│Command-Line Format │ --debug-check │\n├────────────────────┼───────────────┤\n│Type                │ Boolean       │\n├────────────────────┼───────────────┤\n│Default Value       │ FALSE         │\n└────────────────────┴───────────────┘\nPrint some debugging information when the program exits.\n\nThis option is available only if MySQL was built using WITHDEBUG. MySQL release binaries\nprovided by Oracle are not built using this option.\n\n•   --debug-info\n\n┌────────────────────┬──────────────┐\n│Command-Line Format │ --debug-info │\n├────────────────────┼──────────────┤\n│Type                │ Boolean      │\n├────────────────────┼──────────────┤\n│Default Value       │ FALSE        │\n└────────────────────┴──────────────┘\nPrint debugging information and memory and CPU usage statistics when the program exits.\n\nThis option is available only if MySQL was built using WITHDEBUG. MySQL release binaries\nprovided by Oracle are not built using this option.\n\n•   --dump-date\n\n┌────────────────────┬─────────────┐\n│Command-Line Format │ --dump-date │\n├────────────────────┼─────────────┤\n│Type                │ Boolean     │\n├────────────────────┼─────────────┤\n│Default Value       │ TRUE        │\n└────────────────────┴─────────────┘\nIf the --comments option is given, mysqldump produces a comment at the end of the dump of\nthe following form:\n\n-- Dump completed on DATE\n\nHowever, the date causes dump files taken at different times to appear to be different,\neven if the data are otherwise identical.  --dump-date and --skip-dump-date control\nwhether the date is added to the comment. The default is --dump-date (include the date in\nthe comment).  --skip-dump-date suppresses date printing.\n\n•   --force, -f\n\n┌────────────────────┬─────────┐\n│Command-Line Format │ --force │\n└────────────────────┴─────────┘\nIgnore all errors; continue even if an SQL error occurs during a table dump.\n\nOne use for this option is to cause mysqldump to continue executing even when it\nencounters a view that has become invalid because the definition refers to a table that\nhas been dropped. Without --force, mysqldump exits with an error message. With --force,\nmysqldump prints the error message, but it also writes an SQL comment containing the view\ndefinition to the dump output and continues executing.\n\nIf the --ignore-error option is also given to ignore specific errors, --force takes\nprecedence.\n\n•   --log-error=filename\n\n┌────────────────────┬───────────────────────┐\n│Command-Line Format │ --log-error=filename │\n├────────────────────┼───────────────────────┤\n│Type                │ File name             │\n└────────────────────┴───────────────────────┘\nLog warnings and errors by appending them to the named file. The default is to do no\nlogging.\n\n•   --skip-comments\n\n┌────────────────────┬─────────────────┐\n│Command-Line Format │ --skip-comments │\n└────────────────────┴─────────────────┘\nSee the description for the --comments option.\n\n•   --verbose, -v\n\n┌────────────────────┬───────────┐\n│Command-Line Format │ --verbose │\n└────────────────────┴───────────┘\nVerbose mode. Print more information about what the program does.\nHelp Options\n\nThe following options display information about the mysqldump command itself.\n\n•   --help, -?\n\n┌────────────────────┬────────┐\n│Command-Line Format │ --help │\n└────────────────────┴────────┘\nDisplay a help message and exit.\n\n•   --version, -V\n\n┌────────────────────┬───────────┐\n│Command-Line Format │ --version │\n└────────────────────┴───────────┘\nDisplay version information and exit.\nInternationalization Options\n\nThe following options change how the mysqldump command represents character data with\nnational language settings.\n\n•   --character-sets-dir=dirname\n\n┌────────────────────┬───────────────────────────────┐\n│Command-Line Format │ --character-sets-dir=dirname │\n├────────────────────┼───────────────────────────────┤\n│Type                │ Directory name                │\n└────────────────────┴───────────────────────────────┘\nThe directory where character sets are installed. See Section 12.15, “Character Set\nConfiguration”.\n\n•   --default-character-set=charsetname\n\n┌────────────────────┬──────────────────────┐\n│Command-Line Format │ --default-character- │\n│                    │ set=charsetname     │\n├────────────────────┼──────────────────────┤\n│Type                │ String               │\n├────────────────────┼──────────────────────┤\n│Default Value       │ utf8                 │\n└────────────────────┴──────────────────────┘\nUse charsetname as the default character set. See Section 12.15, “Character Set\nConfiguration”. If no character set is specified, mysqldump uses utf8mb4.\n\n•   --no-set-names, -N\n\n┌────────────────────┬────────────────┐\n│Command-Line Format │ --no-set-names │\n├────────────────────┼────────────────┤\n│Deprecated          │ Yes            │\n└────────────────────┴────────────────┘\nTurns off the --set-charset setting, the same as specifying --skip-set-charset.\n\n•   --set-charset\n\n┌────────────────────┬──────────────────┐\n│Command-Line Format │ --set-charset    │\n├────────────────────┼──────────────────┤\n│Disabled by         │ skip-set-charset │\n└────────────────────┴──────────────────┘\nWrite SET NAMES defaultcharacterset to the output. This option is enabled by default.\nTo suppress the SET NAMES statement, use --skip-set-charset.\nReplication Options\n\nThe mysqldump command is frequently used to create an empty instance, or an instance\nincluding data, on a replica server in a replication configuration. The following options\napply to dumping and restoring data on replication source servers and replicas.\n\n•   --apply-replica-statements\n\n┌────────────────────┬────────────────────────────┐\n│Command-Line Format │ --apply-replica-statements │\n├────────────────────┼────────────────────────────┤\n│Introduced          │ 8.0.26                     │\n├────────────────────┼────────────────────────────┤\n│Type                │ Boolean                    │\n├────────────────────┼────────────────────────────┤\n│Default Value       │ FALSE                      │\n└────────────────────┴────────────────────────────┘\nFrom MySQL 8.0.26, use --apply-replica-statements, and before MySQL 8.0.26, use\n--apply-slave-statements. Both options have the same effect. For a replica dump produced\nwith the --dump-replica or --dump-slave option, the options add a STOP REPLICA (or before\nMySQL 8.0.22, STOP SLAVE) statement before the statement with the binary log coordinates,\nand a START REPLICA statement at the end of the output.\n\n•   --apply-slave-statements\n\n┌────────────────────┬──────────────────────────┐\n│Command-Line Format │ --apply-slave-statements │\n├────────────────────┼──────────────────────────┤\n│Deprecated          │ 8.0.26                   │\n├────────────────────┼──────────────────────────┤\n│Type                │ Boolean                  │\n├────────────────────┼──────────────────────────┤\n│Default Value       │ FALSE                    │\n└────────────────────┴──────────────────────────┘\nUse this option before MySQL 8.0.26 rather than --apply-replica-statements. Both options\nhave the same effect.\n\n•   --delete-source-logs\n\n┌────────────────────┬──────────────────────┐\n│Command-Line Format │ --delete-source-logs │\n├────────────────────┼──────────────────────┤\n│Introduced          │ 8.0.26               │\n└────────────────────┴──────────────────────┘\nFrom MySQL 8.0.26, use --delete-source-logs, and before MySQL 8.0.26, use\n--delete-master-logs. Both options have the same effect. On a replication source server,\nthe options delete the binary logs by sending a PURGE BINARY LOGS statement to the server\nafter performing the dump operation. The options require the RELOAD privilege as well as\nprivileges sufficient to execute that statement. The options automatically enable\n--source-data or --master-data.\n\n•   --delete-master-logs\n\n┌────────────────────┬──────────────────────┐\n│Command-Line Format │ --delete-master-logs │\n├────────────────────┼──────────────────────┤\n│Deprecated          │ 8.0.26               │\n└────────────────────┴──────────────────────┘\nUse this option before MySQL 8.0.26 rather than --delete-source-logs. Both options have\nthe same effect.\n\n•   --dump-replica[=value]\n\n┌────────────────────┬────────────────────────┐\n│Command-Line Format │ --dump-replica[=value] │\n├────────────────────┼────────────────────────┤\n│Introduced          │ 8.0.26                 │\n├────────────────────┼────────────────────────┤\n│Type                │ Numeric                │\n├────────────────────┼────────────────────────┤\n│Default Value       │ 1                      │\n├────────────────────┼────────────────────────┤\n│Valid Values        │                        │\n│                    │            1           │\n│                    │                        │\n│                    │            2           │\n└────────────────────┴────────────────────────┘\nFrom MySQL 8.0.26, use --dump-replica, and before MySQL 8.0.26, use --dump-slave. Both\noptions have the same effect. The options are similar to --source-data, except that they\nare used to dump a replica server to produce a dump file that can be used to set up\nanother server as a replica that has the same source as the dumped server. The options\ncause the dump output to include a CHANGE REPLICATION SOURCE TO statement (from MySQL\n8.0.23) or CHANGE MASTER TO statement (before MySQL 8.0.23) that indicates the binary log\ncoordinates (file name and position) of the dumped replica's source. The CHANGE\nREPLICATION SOURCE TO statement reads the values of RelayMasterLogFile and\nExecMasterLogPos from the SHOW REPLICA STATUS output and uses them for SOURCELOGFILE\nand SOURCELOGPOS respectively. These are the replication source server coordinates from\nwhich the replica starts replicating.\n\nNote\nInconsistencies in the sequence of transactions from the relay log which have been\nexecuted can cause the wrong position to be used. See Section 19.5.1.34, “Replication\nand Transaction Inconsistencies” for more information.\n--dump-replica or --dump-slave causes the coordinates from the source to be used rather\nthan those of the dumped server, as is done by the --source-data or --master-data option.\nIn addition, specifying this option causes the --source-data or --master-data option to\nbe overridden, if used, and effectively ignored.\n\nWarning\n--dump-replica or --dump-slave should not be used if the server where the dump is\ngoing to be applied uses gtidmode=ON and SOURCEAUTOPOSITION=1 or\nMASTERAUTOPOSITION=1.\nThe option value is handled the same way as for --source-data. Setting no value or 1\ncauses a CHANGE REPLICATION SOURCE TO statement (from MySQL 8.0.23) or CHANGE MASTER TO\nstatement (before MySQL 8.0.23) to be written to the dump. Setting 2 causes the statement\nto be written but encased in SQL comments. It has the same effect as --source-data in\nterms of enabling or disabling other options and in how locking is handled.\n\n--dump-replica or --dump-slave causes mysqldump to stop the replication SQL thread before\nthe dump and restart it again after.\n\n--dump-replica or --dump-slave sends a SHOW REPLICA STATUS statement to the server to\nobtain information, so they require privileges sufficient to execute that statement.\n\n--apply-replica-statements and --include-source-host-port options can be used in\nconjunction with --dump-replica or --dump-slave.\n\n•   --dump-slave[=value]\n\n┌────────────────────┬──────────────────────┐\n│Command-Line Format │ --dump-slave[=value] │\n├────────────────────┼──────────────────────┤\n│Deprecated          │ 8.0.26               │\n├────────────────────┼──────────────────────┤\n│Type                │ Numeric              │\n├────────────────────┼──────────────────────┤\n│Default Value       │ 1                    │\n├────────────────────┼──────────────────────┤\n│Valid Values        │                      │\n│                    │            1         │\n│                    │                      │\n│                    │            2         │\n└────────────────────┴──────────────────────┘\nUse this option before MySQL 8.0.26 rather than --dump-replica. Both options have the\nsame effect.\n\n•   --include-source-host-port\n\n┌────────────────────┬────────────────────────────┐\n│Command-Line Format │ --include-source-host-port │\n├────────────────────┼────────────────────────────┤\n│Introduced          │ 8.0.26                     │\n├────────────────────┼────────────────────────────┤\n│Type                │ Boolean                    │\n├────────────────────┼────────────────────────────┤\n│Default Value       │ FALSE                      │\n└────────────────────┴────────────────────────────┘\nFrom MySQL 8.0.26, use --include-source-host-port, and before MySQL 8.0.26, use\n--include-master-host-port. Both options have the same effect. The options add the\nSOURCEHOST | MASTERHOST and SOURCEPORT | MASTERPORT options for the host name and\nTCP/IP port number of the replica's source, to the CHANGE REPLICATION SOURCE TO statement\n(from MySQL 8.0.23) or CHANGE MASTER TO statement (before MySQL 8.0.23) in a replica dump\nproduced with the --dump-replica or --dump-slave option.\n\n•   --include-master-host-port\n\n┌────────────────────┬────────────────────────────┐\n│Command-Line Format │ --include-master-host-port │\n├────────────────────┼────────────────────────────┤\n│Deprecated          │ 8.0.26                     │\n├────────────────────┼────────────────────────────┤\n│Type                │ Boolean                    │\n├────────────────────┼────────────────────────────┤\n│Default Value       │ FALSE                      │\n└────────────────────┴────────────────────────────┘\nUse this option before MySQL 8.0.26 rather than --include-source-host-port. Both options\nhave the same effect.\n\n•   --source-data[=value]\n\n┌────────────────────┬───────────────────────┐\n│Command-Line Format │ --source-data[=value] │\n├────────────────────┼───────────────────────┤\n│Introduced          │ 8.0.26                │\n├────────────────────┼───────────────────────┤\n│Type                │ Numeric               │\n├────────────────────┼───────────────────────┤\n│Default Value       │ 1                     │\n├────────────────────┼───────────────────────┤\n│Valid Values        │                       │\n│                    │            1          │\n│                    │                       │\n│                    │            2          │\n└────────────────────┴───────────────────────┘\nFrom MySQL 8.0.26, use --source-data, and before MySQL 8.0.26, use --master-data. Both\noptions have the same effect. The options are used to dump a replication source server to\nproduce a dump file that can be used to set up another server as a replica of the source.\nThe options cause the dump output to include a CHANGE REPLICATION SOURCE TO statement\n(from MySQL 8.0.23) or CHANGE MASTER TO statement (before MySQL 8.0.23) that indicates\nthe binary log coordinates (file name and position) of the dumped server. These are the\nreplication source server coordinates from which the replica should start replicating\nafter you load the dump file into the replica.\n\nIf the option value is 2, the CHANGE REPLICATION SOURCE TO | CHANGE MASTER TO statement\nis written as an SQL comment, and thus is informative only; it has no effect when the\ndump file is reloaded. If the option value is 1, the statement is not written as a\ncomment and takes effect when the dump file is reloaded. If no option value is specified,\nthe default value is 1.\n\n--source-data and --master-data send a SHOW MASTER STATUS statement to the server to\nobtain information, so they require privileges sufficient to execute that statement. This\noption also requires the RELOAD privilege and the binary log must be enabled.\n\n--source-data and --master-data automatically turn off --lock-tables. They also turn on\n--lock-all-tables, unless --single-transaction also is specified, in which case, a global\nread lock is acquired only for a short time at the beginning of the dump (see the\ndescription for --single-transaction). In all cases, any action on logs happens at the\nexact moment of the dump.\n\nIt is also possible to set up a replica by dumping an existing replica of the source,\nusing the --dump-replica or --dump-slave option, which overrides --source-data and\n--master-data and causes them to be ignored.\n\n•   --master-data[=value]\n\n┌────────────────────┬───────────────────────┐\n│Command-Line Format │ --master-data[=value] │\n├────────────────────┼───────────────────────┤\n│Deprecated          │ 8.0.26                │\n├────────────────────┼───────────────────────┤\n│Type                │ Numeric               │\n├────────────────────┼───────────────────────┤\n│Default Value       │ 1                     │\n├────────────────────┼───────────────────────┤\n│Valid Values        │                       │\n│                    │            1          │\n│                    │                       │\n│                    │            2          │\n└────────────────────┴───────────────────────┘\nUse this option before MySQL 8.0.26 rather than --source-data. Both options have the same\neffect.\n\n•   --set-gtid-purged=value\n\n┌────────────────────┬─────────────────────────┐\n│Command-Line Format │ --set-gtid-purged=value │\n├────────────────────┼─────────────────────────┤\n│Type                │ Enumeration             │\n├────────────────────┼─────────────────────────┤\n│Default Value       │ AUTO                    │\n├────────────────────┼─────────────────────────┤\n│Valid Values        │                         │\n│                    │            OFF          │\n│                    │                         │\n│                    │            ON           │\n│                    │                         │\n│                    │            AUTO         │\n└────────────────────┴─────────────────────────┘\nThis option is for servers that use GTID-based replication (gtidmode=ON). It controls\nthe inclusion of a SET @@GLOBAL.gtidpurged statement in the dump output, which updates\nthe value of gtidpurged on a server where the dump file is reloaded, to add the GTID set\nfrom the source server's gtidexecuted system variable.  gtidpurged holds the GTIDs of\nall transactions that have been applied on the server, but do not exist on any binary log\nfile on the server.  mysqldump therefore adds the GTIDs for the transactions that were\nexecuted on the source server, so that the target server records these transactions as\napplied, although it does not have them in its binary logs.  --set-gtid-purged also\ncontrols the inclusion of a SET @@SESSION.sqllogbin=0 statement, which disables binary\nlogging while the dump file is being reloaded. This statement prevents new GTIDs from\nbeing generated and assigned to the transactions in the dump file as they are executed,\nso that the original GTIDs for the transactions are used.\n\nIf you do not set the --set-gtid-purged option, the default is that a SET\n@@GLOBAL.gtidpurged statement is included in the dump output if GTIDs are enabled on the\nserver you are backing up, and the set of GTIDs in the global value of the gtidexecuted\nsystem variable is not empty. A SET @@SESSION.sqllogbin=0 statement is also included if\nGTIDs are enabled on the server.\n\nYou can either replace the value of gtidpurged with a specified GTID set, or add a plus\nsign (+) to the statement to append a specified GTID set to the GTID set that is already\nheld by gtidpurged. The SET @@GLOBAL.gtidpurged statement recorded by mysqldump\nincludes a plus sign (+) in a version-specific comment, such that MySQL adds the GTID set\nfrom the dump file to the existing gtidpurged value.\n\nIt is important to note that the value that is included by mysqldump for the SET\n@@GLOBAL.gtidpurged statement includes the GTIDs of all transactions in the\ngtidexecuted set on the server, even those that changed suppressed parts of the\ndatabase, or other databases on the server that were not included in a partial dump. This\ncan mean that after the gtidpurged value has been updated on the server where the dump\nfile is replayed, GTIDs are present that do not relate to any data on the target server.\nIf you do not replay any further dump files on the target server, the extraneous GTIDs do\nnot cause any problems with the future operation of the server, but they make it harder\nto compare or reconcile GTID sets on different servers in the replication topology. If\nyou do replay a further dump file on the target server that contains the same GTIDs (for\nexample, another partial dump from the same origin server), any SET @@GLOBAL.gtidpurged\nstatement in the second dump file fails. In this case, either remove the statement\nmanually before replaying the dump file, or output the dump file without the statement.\n\nBefore MySQL 8.0.32: Using this option with the --single-transaction option could lead to\ninconsistencies in the output. If --set-gtid-purged=ON is required, it can be used with\n--lock-all-tables, but this can prevent parallel queries while mysqldump is being run.\n\nIf the SET @@GLOBAL.gtidpurged statement would not have the desired result on your\ntarget server, you can exclude the statement from the output, or (from MySQL 8.0.17)\ninclude it but comment it out so that it is not actioned automatically. You can also\ninclude the statement but manually edit it in the dump file to achieve the desired\nresult.\n\nThe possible values for the --set-gtid-purged option are as follows:\n\nAUTO\nThe default value. If GTIDs are enabled on the server you are backing up and\ngtidexecuted is not empty, SET @@GLOBAL.gtidpurged is added to the output,\ncontaining the GTID set from gtidexecuted. If GTIDs are enabled, SET\n@@SESSION.sqllogbin=0 is added to the output. If GTIDs are not enabled on the\nserver, the statements are not added to the output.\n\nOFF\nSET @@GLOBAL.gtidpurged is not added to the output, and SET @@SESSION.sqllogbin=0\nis not added to the output. For a server where GTIDs are not in use, use this option\nor AUTO. Only use this option for a server where GTIDs are in use if you are sure\nthat the required GTID set is already present in gtidpurged on the target server and\nshould not be changed, or if you plan to identify and add any missing GTIDs manually.\n\nON\nIf GTIDs are enabled on the server you are backing up, SET @@GLOBAL.gtidpurged is\nadded to the output (unless gtidexecuted is empty), and SET @@SESSION.sqllogbin=0\nis added to the output. An error occurs if you set this option but GTIDs are not\nenabled on the server. For a server where GTIDs are in use, use this option or AUTO,\nunless you are sure that the GTIDs in gtidexecuted are not needed on the target\nserver.\n\nCOMMENTED\nAvailable from MySQL 8.0.17. If GTIDs are enabled on the server you are backing up,\nSET @@GLOBAL.gtidpurged is added to the output (unless gtidexecuted is empty), but\nit is commented out. This means that the value of gtidexecuted is available in the\noutput, but no action is taken automatically when the dump file is reloaded.  SET\n@@SESSION.sqllogbin=0 is added to the output, and it is not commented out. With\nCOMMENTED, you can control the use of the gtidexecuted set manually or through\nautomation. For example, you might prefer to do this if you are migrating data to\nanother server that already has different active databases.\nFormat Options\n\nThe following options specify how to represent the entire dump file or certain kinds of data\nin the dump file. They also control whether certain optional information is written to the\ndump file.\n\n•   --compact\n\n┌────────────────────┬───────────┐\n│Command-Line Format │ --compact │\n└────────────────────┴───────────┘\nProduce more compact output. This option enables the --skip-add-drop-table,\n--skip-add-locks, --skip-comments, --skip-disable-keys, and --skip-set-charset options.\n\n•   --compatible=name\n\n┌────────────────────┬──────────────────────────────┐\n│Command-Line Format │ --compatible=name[,name,...] │\n├────────────────────┼──────────────────────────────┤\n│Type                │ String                       │\n├────────────────────┼──────────────────────────────┤\n│Default Value       │                              │\n├────────────────────┼──────────────────────────────┤\n│Valid Values        │                              │\n│                    │            ansi              │\n│                    │                              │\n│                    │            mysql323          │\n│                    │                              │\n│                    │            mysql40           │\n│                    │                              │\n│                    │            postgresql        │\n│                    │                              │\n│                    │            oracle            │\n│                    │                              │\n│                    │            mssql             │\n│                    │                              │\n│                    │            db2               │\n│                    │                              │\n│                    │            maxdb             │\n│                    │                              │\n│                    │            nokeyoptions    │\n│                    │                              │\n│                    │            notableoptions  │\n│                    │                              │\n│                    │            nokeyoptions    │\n└────────────────────┴──────────────────────────────┘\nProduce output that is more compatible with other database systems or with older MySQL\nservers. The only permitted value for this option is ansi, which has the same meaning as\nthe corresponding option for setting the server SQL mode. See Section 7.1.11, “Server SQL\nModes”.\n\n•   --complete-insert, -c\n\n┌────────────────────┬───────────────────┐\n│Command-Line Format │ --complete-insert │\n└────────────────────┴───────────────────┘\nUse complete INSERT statements that include column names.\n\n•   --create-options\n\n┌────────────────────┬──────────────────┐\n│Command-Line Format │ --create-options │\n└────────────────────┴──────────────────┘\nInclude all MySQL-specific table options in the CREATE TABLE statements.\n\n•   --fields-terminated-by=..., --fields-enclosed-by=...,\n--fields-optionally-enclosed-by=..., --fields-escaped-by=...\n\n┌────────────────────┬───────────────────────────────┐\n│Command-Line Format │ --fields-terminated-by=string │\n├────────────────────┼───────────────────────────────┤\n│Type                │ String                        │\n└────────────────────┴───────────────────────────────┘\n\n┌────────────────────┬─────────────────────────────┐\n│Command-Line Format │ --fields-enclosed-by=string │\n├────────────────────┼─────────────────────────────┤\n│Type                │ String                      │\n└────────────────────┴─────────────────────────────┘\n\n┌────────────────────┬───────────────────────────────┐\n│Command-Line Format │ --fields-optionally-enclosed- │\n│                    │ by=string                     │\n├────────────────────┼───────────────────────────────┤\n│Type                │ String                        │\n└────────────────────┴───────────────────────────────┘\n\n┌────────────────────┬─────────────────────┐\n│Command-Line Format │ --fields-escaped-by │\n├────────────────────┼─────────────────────┤\n│Type                │ String              │\n└────────────────────┴─────────────────────┘\nThese options are used with the --tab option and have the same meaning as the\ncorresponding FIELDS clauses for LOAD DATA. See Section 15.2.9, “LOAD DATA Statement”.\n\n•   --hex-blob\n\n┌────────────────────┬────────────┐\n│Command-Line Format │ --hex-blob │\n└────────────────────┴────────────┘\nDump binary columns using hexadecimal notation (for example, 'abc' becomes 0x616263). The\naffected data types are BINARY, VARBINARY, BLOB types, BIT, all spatial data types, and\nother non-binary data types when used with the binary character set.\n\nThe --hex-blob option is ignored when the --tab is used.\n\n•   --lines-terminated-by=...\n\n┌────────────────────┬──────────────────────────────┐\n│Command-Line Format │ --lines-terminated-by=string │\n├────────────────────┼──────────────────────────────┤\n│Type                │ String                       │\n└────────────────────┴──────────────────────────────┘\nThis option is used with the --tab option and has the same meaning as the corresponding\nLINES clause for LOAD DATA. See Section 15.2.9, “LOAD DATA Statement”.\n\n•   --quote-names, -Q\n\n┌────────────────────┬──────────────────┐\n│Command-Line Format │ --quote-names    │\n├────────────────────┼──────────────────┤\n│Disabled by         │ skip-quote-names │\n└────────────────────┴──────────────────┘\nQuote identifiers (such as database, table, and column names) within ` characters. If the\nANSIQUOTES SQL mode is enabled, identifiers are quoted within \" characters. This option\nis enabled by default. It can be disabled with --skip-quote-names, but this option should\nbe given after any option such as --compatible that may enable --quote-names.\n\n•   --result-file=filename, -r filename\n\n┌────────────────────┬─────────────────────────┐\n│Command-Line Format │ --result-file=filename │\n├────────────────────┼─────────────────────────┤\n│Type                │ File name               │\n└────────────────────┴─────────────────────────┘\nDirect output to the named file. The result file is created and its previous contents\noverwritten, even if an error occurs while generating the dump.\n\nThis option should be used on Windows to prevent newline \\n characters from being\nconverted to \\r\\n carriage return/newline sequences.\n\n•   --show-create-skip-secondary-engine=value\n\n┌────────────────────┬───────────────────────────────┐\n│Command-Line Format │ --show-create-skip-secondary- │\n│                    │ engine                        │\n├────────────────────┼───────────────────────────────┤\n│Introduced          │ 8.0.18                        │\n└────────────────────┴───────────────────────────────┘\nExcludes the SECONDARY ENGINE clause from CREATE TABLE statements. It does so by enabling\nthe showcreatetableskipsecondaryengine system variable for the duration of the dump\noperation. Alternatively, you can enable the showcreatetableskipsecondaryengine\nsystem variable prior to using mysqldump.\n\nThis option was added in MySQL 8.0.18. Attempting a mysqldump operation with the\n--show-create-skip-secondary-engine option on a release prior to MySQL 8.0.18 that does\nnot support the showcreatetableskipsecondaryengine variable causes an error.\n\n•   --tab=dirname, -T dirname\n\n┌────────────────────┬────────────────┐\n│Command-Line Format │ --tab=dirname │\n├────────────────────┼────────────────┤\n│Type                │ Directory name │\n└────────────────────┴────────────────┘\nProduce tab-separated text-format data files. For each dumped table, mysqldump creates a\ntblname.sql file that contains the CREATE TABLE statement that creates the table, and\nthe server writes a tblname.txt file that contains its data. The option value is the\ndirectory in which to write the files.\n\nNote\nThis option should be used only when mysqldump is run on the same machine as the\nmysqld server. Because the server creates *.txt files in the directory that you\nspecify, the directory must be writable by the server and the MySQL account that you\nuse must have the FILE privilege. Because mysqldump creates *.sql in the same\ndirectory, it must be writable by your system login account.\nBy default, the .txt data files are formatted using tab characters between column values\nand a newline at the end of each line. The format can be specified explicitly using the\n--fields-xxx and --lines-terminated-by options.\n\nColumn values are converted to the character set specified by the --default-character-set\noption.\n\n•   --tz-utc\n\n┌────────────────────┬─────────────┐\n│Command-Line Format │ --tz-utc    │\n├────────────────────┼─────────────┤\n│Disabled by         │ skip-tz-utc │\n└────────────────────┴─────────────┘\nThis option enables TIMESTAMP columns to be dumped and reloaded between servers in\ndifferent time zones.  mysqldump sets its connection time zone to UTC and adds SET\nTIMEZONE='+00:00' to the dump file. Without this option, TIMESTAMP columns are dumped\nand reloaded in the time zones local to the source and destination servers, which can\ncause the values to change if the servers are in different time zones.  --tz-utc also\nprotects against changes due to daylight saving time.  --tz-utc is enabled by default. To\ndisable it, use --skip-tz-utc.\n\n•   --xml, -X\n\n┌────────────────────┬───────┐\n│Command-Line Format │ --xml │\n└────────────────────┴───────┘\nWrite dump output as well-formed XML.\n\nNULL, 'NULL', and Empty Values: For a column named columnname, the NULL value, an empty\nstring, and the string value 'NULL' are distinguished from one another in the output\ngenerated by this option as follows.\n\n┌─────────────────────┬────────────────────────────────────────────┐\n│Value:               │ XML Representation:                        │\n├─────────────────────┼────────────────────────────────────────────┤\n│NULL (unknown value) │                                            │\n│                     │            <field                          │\n│                     │            name=\"columnname\"              │\n│                     │            xsi:nil=\"true\" />               │\n├─────────────────────┼────────────────────────────────────────────┤\n│                     │                                            │\n│                     │            <field                          │\n│                     │            name=\"columnname\"></field>     │\n├─────────────────────┼────────────────────────────────────────────┤\n│                     │                                            │\n│                     │            <field                          │\n│                     │            name=\"columnname\">NULL</field> │\n└─────────────────────┴────────────────────────────────────────────┘\nThe output from the mysql client when run using the --xml option also follows the\npreceding rules. (See the section called “MYSQL CLIENT OPTIONS”.)\n\nXML output from mysqldump includes the XML namespace, as shown here:\n\n$> mysqldump --xml -u root world City\n<?xml version=\"1.0\"?>\n<mysqldump xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<database name=\"world\">\n<tablestructure name=\"City\">\n<field Field=\"ID\" Type=\"int(11)\" Null=\"NO\" Key=\"PRI\" Extra=\"autoincrement\" />\n<field Field=\"Name\" Type=\"char(35)\" Null=\"NO\" Key=\"\" Default=\"\" Extra=\"\" />\n<field Field=\"CountryCode\" Type=\"char(3)\" Null=\"NO\" Key=\"\" Default=\"\" Extra=\"\" />\n<field Field=\"District\" Type=\"char(20)\" Null=\"NO\" Key=\"\" Default=\"\" Extra=\"\" />\n<field Field=\"Population\" Type=\"int(11)\" Null=\"NO\" Key=\"\" Default=\"0\" Extra=\"\" />\n<key Table=\"City\" Nonunique=\"0\" Keyname=\"PRIMARY\" Seqinindex=\"1\" Columnname=\"ID\"\nCollation=\"A\" Cardinality=\"4079\" Null=\"\" Indextype=\"BTREE\" Comment=\"\" />\n<options Name=\"City\" Engine=\"MyISAM\" Version=\"10\" Rowformat=\"Fixed\" Rows=\"4079\"\nAvgrowlength=\"67\" Datalength=\"273293\" Maxdatalength=\"18858823439613951\"\nIndexlength=\"43008\" Datafree=\"0\" Autoincrement=\"4080\"\nCreatetime=\"2007-03-31 01:47:01\" Updatetime=\"2007-03-31 01:47:02\"\nCollation=\"latin1swedishci\" Createoptions=\"\" Comment=\"\" />\n</tablestructure>\n<tabledata name=\"City\">\n<row>\n<field name=\"ID\">1</field>\n<field name=\"Name\">Kabul</field>\n<field name=\"CountryCode\">AFG</field>\n<field name=\"District\">Kabol</field>\n<field name=\"Population\">1780000</field>\n</row>\n...\n<row>\n<field name=\"ID\">4079</field>\n<field name=\"Name\">Rafah</field>\n<field name=\"CountryCode\">PSE</field>\n<field name=\"District\">Rafah</field>\n<field name=\"Population\">92020</field>\n</row>\n</tabledata>\n</database>\n</mysqldump>\nFiltering Options\n\nThe following options control which kinds of schema objects are written to the dump file: by\ncategory, such as triggers or events; by name, for example, choosing which databases and\ntables to dump; or even filtering rows from the table data using a WHERE clause.\n\n•   --all-databases, -A\n\n┌────────────────────┬─────────────────┐\n│Command-Line Format │ --all-databases │\n└────────────────────┴─────────────────┘\nDump all tables in all databases. This is the same as using the --databases option and\nnaming all the databases on the command line.\n\nNote\nSee the --add-drop-database description for information about an incompatibility of\nthat option with --all-databases.\nPrior to MySQL 8.0, the --routines and --events options for mysqldump and mysqlpump were\nnot required to include stored routines and events when using the --all-databases option:\nThe dump included the mysql system database, and therefore also the mysql.proc and\nmysql.event tables containing stored routine and event definitions. As of MySQL 8.0, the\nmysql.event and mysql.proc tables are not used. Definitions for the corresponding objects\nare stored in data dictionary tables, but those tables are not dumped. To include stored\nroutines and events in a dump made using --all-databases, use the --routines and --events\noptions explicitly.\n\n•   --databases, -B\n\n┌────────────────────┬─────────────┐\n│Command-Line Format │ --databases │\n└────────────────────┴─────────────┘\nDump several databases. Normally, mysqldump treats the first name argument on the command\nline as a database name and following names as table names. With this option, it treats\nall name arguments as database names.  CREATE DATABASE and USE statements are included in\nthe output before each new database.\n\nThis option may be used to dump the performanceschema database, which normally is not\ndumped even with the --all-databases option. (Also use the --skip-lock-tables option.)\n\nNote\nSee the --add-drop-database description for information about an incompatibility of\nthat option with --databases.\n\n•   --events, -E\n\n┌────────────────────┬──────────┐\n│Command-Line Format │ --events │\n└────────────────────┴──────────┘\nInclude Event Scheduler events for the dumped databases in the output. This option\nrequires the EVENT privileges for those databases.\n\nThe output generated by using --events contains CREATE EVENT statements to create the\nevents.\n\n•   --ignore-error=error[,error]...\n\n┌────────────────────┬─────────────────────────────────┐\n│Command-Line Format │ --ignore-error=error[,error]... │\n├────────────────────┼─────────────────────────────────┤\n│Type                │ String                          │\n└────────────────────┴─────────────────────────────────┘\nIgnore the specified errors. The option value is a list of comma-separated error numbers\nspecifying the errors to ignore during mysqldump execution. If the --force option is also\ngiven to ignore all errors, --force takes precedence.\n\n•   --ignore-table=dbname.tblname\n\n┌────────────────────┬─────────────────────────────────┐\n│Command-Line Format │ --ignore-table=dbname.tblname │\n├────────────────────┼─────────────────────────────────┤\n│Type                │ String                          │\n└────────────────────┴─────────────────────────────────┘\nDo not dump the given table, which must be specified using both the database and table\nnames. To ignore multiple tables, use this option multiple times. This option also can be\nused to ignore views.\n\n•   --no-data, -d\n\n┌────────────────────┬───────────┐\n│Command-Line Format │ --no-data │\n└────────────────────┴───────────┘\nDo not write any table row information (that is, do not dump table contents). This is\nuseful if you want to dump only the CREATE TABLE statement for the table (for example, to\ncreate an empty copy of the table by loading the dump file).\n\n•   --routines, -R\n\n┌────────────────────┬────────────┐\n│Command-Line Format │ --routines │\n└────────────────────┴────────────┘\nInclude stored routines (procedures and functions) for the dumped databases in the\noutput. This option requires the global SELECT privilege.\n\nThe output generated by using --routines contains CREATE PROCEDURE and CREATE FUNCTION\nstatements to create the routines.\n\n•   --skip-generated-invisible-primary-key\n\n┌────────────────────┬─────────────────────────────┐\n│Command-Line Format │ --skip-generated-invisible- │\n│                    │ primary-key                 │\n├────────────────────┼─────────────────────────────┤\n│Introduced          │ 8.0.30                      │\n├────────────────────┼─────────────────────────────┤\n│Type                │ Boolean                     │\n├────────────────────┼─────────────────────────────┤\n│Default Value       │ FALSE                       │\n└────────────────────┴─────────────────────────────┘\nThis option is available beginning with MySQL 8.0.30, and causes generated invisible\nprimary keys to be excluded from the output. For more information, see\nSection 15.1.20.11, “Generated Invisible Primary Keys”.\n\n•   --tables\n\n┌────────────────────┬──────────┐\n│Command-Line Format │ --tables │\n└────────────────────┴──────────┘\nOverride the --databases or -B option.  mysqldump regards all name arguments following\nthe option as table names.\n\n•   --triggers\n\n┌────────────────────┬───────────────┐\n│Command-Line Format │ --triggers    │\n├────────────────────┼───────────────┤\n│Disabled by         │ skip-triggers │\n└────────────────────┴───────────────┘\nInclude triggers for each dumped table in the output. This option is enabled by default;\ndisable it with --skip-triggers.\n\nTo be able to dump a table's triggers, you must have the TRIGGER privilege for the table.\n\nMultiple triggers are permitted.  mysqldump dumps triggers in activation order so that\nwhen the dump file is reloaded, triggers are created in the same activation order.\nHowever, if a mysqldump dump file contains multiple triggers for a table that have the\nsame trigger event and action time, an error occurs for attempts to load the dump file\ninto an older server that does not support multiple triggers. (For a workaround, see\nDowngrade Notes[4]; you can convert triggers to be compatible with older servers.)\n\n•   --where='wherecondition', -w 'wherecondition'\n\n┌────────────────────┬───────────────────────────┐\n│Command-Line Format │ --where='wherecondition' │\n└────────────────────┴───────────────────────────┘\nDump only rows selected by the given WHERE condition. Quotes around the condition are\nmandatory if it contains spaces or other characters that are special to your command\ninterpreter.\n\nExamples:\n\n--where=\"user='jimf'\"\n-w\"userid>1\"\n-w\"userid<1\"\nPerformance Options\n\nThe following options are the most relevant for the performance particularly of the restore\noperations. For large data sets, restore operation (processing the INSERT statements in the\ndump file) is the most time-consuming part. When it is urgent to restore data quickly, plan\nand test the performance of this stage in advance. For restore times measured in hours, you\nmight prefer an alternative backup and restore solution, such as MySQL Enterprise Backup for\nInnoDB-only and mixed-use databases.\n\nPerformance is also affected by the transactional options, primarily for the dump operation.\n\n•   --column-statistics\n\n┌────────────────────┬─────────────────────┐\n│Command-Line Format │ --column-statistics │\n├────────────────────┼─────────────────────┤\n│Type                │ Boolean             │\n├────────────────────┼─────────────────────┤\n│Default Value       │ OFF                 │\n└────────────────────┴─────────────────────┘\nAdd ANALYZE TABLE statements to the output to generate histogram statistics for dumped\ntables when the dump file is reloaded. This option is disabled by default because\nhistogram generation for large tables can take a long time.\n\n•   --disable-keys, -K\n\n┌────────────────────┬────────────────┐\n│Command-Line Format │ --disable-keys │\n└────────────────────┴────────────────┘\nFor each table, surround the INSERT statements with /*!40000 ALTER TABLE tblname DISABLE\nKEYS */; and /*!40000 ALTER TABLE tblname ENABLE KEYS */; statements. This makes loading\nthe dump file faster because the indexes are created after all rows are inserted. This\noption is effective only for nonunique indexes of MyISAM tables.\n\n•   --extended-insert, -e\n\n┌────────────────────┬──────────────────────┐\n│Command-Line Format │ --extended-insert    │\n├────────────────────┼──────────────────────┤\n│Disabled by         │ skip-extended-insert │\n└────────────────────┴──────────────────────┘\nWrite INSERT statements using multiple-row syntax that includes several VALUES lists.\nThis results in a smaller dump file and speeds up inserts when the file is reloaded.\n\n•   --insert-ignore\n\n┌────────────────────┬─────────────────┐\n│Command-Line Format │ --insert-ignore │\n└────────────────────┴─────────────────┘\nWrite INSERT IGNORE statements rather than INSERT statements.\n\n•   --max-allowed-packet=value\n\n┌────────────────────┬────────────────────────────┐\n│Command-Line Format │ --max-allowed-packet=value │\n├────────────────────┼────────────────────────────┤\n│Type                │ Numeric                    │\n├────────────────────┼────────────────────────────┤\n│Default Value       │ 25165824                   │\n└────────────────────┴────────────────────────────┘\nThe maximum size of the buffer for client/server communication. The default is 24MB, the\nmaximum is 1GB.\n\nNote\nThe value of this option is specific to mysqldump and should not be confused with the\nMySQL server's maxallowedpacket system variable; the server value cannot be\nexceeded by a single packet from mysqldump, regardless of any setting for the\nmysqldump option, even if the latter is larger.\n\n•   --mysqld-long-query-time=value\n\n┌────────────────────┬────────────────────────────────┐\n│Command-Line Format │ --mysqld-long-query-time=value │\n├────────────────────┼────────────────────────────────┤\n│Introduced          │ 8.0.30                         │\n├────────────────────┼────────────────────────────────┤\n│Type                │ Numeric                        │\n├────────────────────┼────────────────────────────────┤\n│Default Value       │ Server global setting          │\n└────────────────────┴────────────────────────────────┘\nSet the session value of the longquerytime system variable. Use this option, which is\navailable from MySQL 8.0.30, if you want to increase the time allowed for queries from\nmysqldump before they are logged to the slow query log file.  mysqldump performs a full\ntable scan, which means its queries can often exceed a global longquerytime setting\nthat is useful for regular queries. The default global setting is 10 seconds.\n\nYou can use --mysqld-long-query-time to specify a session value from 0 (meaning that\nevery query from mysqldump is logged to the slow query log) to 31536000, which is 365\ndays in seconds. For mysqldump’s option, you can only specify whole seconds. When you do\nnot specify this option, the server’s global setting applies to mysqldump’s queries.\n\n•   --net-buffer-length=value\n\n┌────────────────────┬───────────────────────────┐\n│Command-Line Format │ --net-buffer-length=value │\n├────────────────────┼───────────────────────────┤\n│Type                │ Numeric                   │\n├────────────────────┼───────────────────────────┤\n│Default Value       │ 16384                     │\n└────────────────────┴───────────────────────────┘\nThe initial size of the buffer for client/server communication. When creating\nmultiple-row INSERT statements (as with the --extended-insert or --opt option), mysqldump\ncreates rows up to --net-buffer-length bytes long. If you increase this variable, ensure\nthat the MySQL server netbufferlength system variable has a value at least this large.\n\n•   --network-timeout, -M\n\n┌────────────────────┬───────────────────────────┐\n│Command-Line Format │ --network-timeout[={0|1}] │\n├────────────────────┼───────────────────────────┤\n│Type                │ Boolean                   │\n├────────────────────┼───────────────────────────┤\n│Default Value       │ TRUE                      │\n└────────────────────┴───────────────────────────┘\nEnable large tables to be dumped by setting --max-allowed-packet to its maximum value and\nnetwork read and write timeouts to a large value. This option is enabled by default. To\ndisable it, use --skip-network-timeout.\n\n•   --opt\n\n┌────────────────────┬──────────┐\n│Command-Line Format │ --opt    │\n├────────────────────┼──────────┤\n│Disabled by         │ skip-opt │\n└────────────────────┴──────────┘\nThis option, enabled by default, is shorthand for the combination of --add-drop-table\n--add-locks --create-options --disable-keys --extended-insert --lock-tables --quick\n--set-charset. It gives a fast dump operation and produces a dump file that can be\nreloaded into a MySQL server quickly.\n\nBecause the --opt option is enabled by default, you only specify its converse, the\n--skip-opt to turn off several default settings. See the discussion of mysqldump option\ngroups for information about selectively enabling or disabling a subset of the options\naffected by --opt.\n\n•   --quick, -q\n\n┌────────────────────┬────────────┐\n│Command-Line Format │ --quick    │\n├────────────────────┼────────────┤\n│Disabled by         │ skip-quick │\n└────────────────────┴────────────┘\nThis option is useful for dumping large tables. It forces mysqldump to retrieve rows for\na table from the server a row at a time rather than retrieving the entire row set and\nbuffering it in memory before writing it out.\n\n•   --skip-opt\n\n┌────────────────────┬────────────┐\n│Command-Line Format │ --skip-opt │\n└────────────────────┴────────────┘\nSee the description for the --opt option.\nTransactional Options\n\nThe following options trade off the performance of the dump operation, against the\nreliability and consistency of the exported data.\n\n•   --add-locks\n\n┌────────────────────┬─────────────┐\n│Command-Line Format │ --add-locks │\n└────────────────────┴─────────────┘\nSurround each table dump with LOCK TABLES and UNLOCK TABLES statements. This results in\nfaster inserts when the dump file is reloaded. See Section 10.2.5.1, “Optimizing INSERT\nStatements”.\n\n•   --flush-logs, -F\n\n┌────────────────────┬──────────────┐\n│Command-Line Format │ --flush-logs │\n└────────────────────┴──────────────┘\nFlush the MySQL server log files before starting the dump. This option requires the\nRELOAD privilege. If you use this option in combination with the --all-databases option,\nthe logs are flushed for each database dumped. The exception is when using\n--lock-all-tables, --source-data or --master-data, or --single-transaction. In these\ncases, the logs are flushed only once, corresponding to the moment that all tables are\nlocked by FLUSH TABLES WITH READ LOCK. If you want your dump and the log flush to happen\nat exactly the same moment, you should use --flush-logs together with --lock-all-tables,\n--source-data or --master-data, or --single-transaction.\n\n•   --flush-privileges\n\n┌────────────────────┬────────────────────┐\n│Command-Line Format │ --flush-privileges │\n└────────────────────┴────────────────────┘\nAdd a FLUSH PRIVILEGES statement to the dump output after dumping the mysql database.\nThis option should be used any time the dump contains the mysql database and any other\ndatabase that depends on the data in the mysql database for proper restoration.\n\nBecause the dump file contains a FLUSH PRIVILEGES statement, reloading the file requires\nprivileges sufficient to execute that statement.\n\n\nNote\nFor upgrades to MySQL 5.7 or higher from older versions, do not use\n--flush-privileges. For upgrade instructions in this case, see Section 3.5, “Changes\nin MySQL 8.0”.\n\n•   --lock-all-tables, -x\n\n┌────────────────────┬───────────────────┐\n│Command-Line Format │ --lock-all-tables │\n└────────────────────┴───────────────────┘\nLock all tables across all databases. This is achieved by acquiring a global read lock\nfor the duration of the whole dump. This option automatically turns off\n--single-transaction and --lock-tables.\n\n•   --lock-tables, -l\n\n┌────────────────────┬───────────────┐\n│Command-Line Format │ --lock-tables │\n└────────────────────┴───────────────┘\nFor each dumped database, lock all tables to be dumped before dumping them. The tables\nare locked with READ LOCAL to permit concurrent inserts in the case of MyISAM tables. For\ntransactional tables such as InnoDB, --single-transaction is a much better option than\n--lock-tables because it does not need to lock the tables at all.\n\nBecause --lock-tables locks tables for each database separately, this option does not\nguarantee that the tables in the dump file are logically consistent between databases.\nTables in different databases may be dumped in completely different states.\n\nSome options, such as --opt, automatically enable --lock-tables. If you want to override\nthis, use --skip-lock-tables at the end of the option list.\n\n•   --no-autocommit\n\n┌────────────────────┬─────────────────┐\n│Command-Line Format │ --no-autocommit │\n└────────────────────┴─────────────────┘\nEnclose the INSERT statements for each dumped table within SET autocommit = 0 and COMMIT\nstatements.\n\n•   --order-by-primary\n\n┌────────────────────┬────────────────────┐\n│Command-Line Format │ --order-by-primary │\n└────────────────────┴────────────────────┘\nDump each table's rows sorted by its primary key, or by its first unique index, if such\nan index exists. This is useful when dumping a MyISAM table to be loaded into an InnoDB\ntable, but makes the dump operation take considerably longer.\n\n•   --shared-memory-base-name=name\n\n┌────────────────────┬────────────────────────────────┐\n│Command-Line Format │ --shared-memory-base-name=name │\n├────────────────────┼────────────────────────────────┤\n│Platform Specific   │ Windows                        │\n└────────────────────┴────────────────────────────────┘\nOn Windows, the shared-memory name to use for connections made using shared memory to a\nlocal server. The default value is MYSQL. The shared-memory name is case-sensitive.\n\nThis option applies only if the server was started with the sharedmemory system variable\nenabled to support shared-memory connections.\n\n•   --single-transaction\n\n┌────────────────────┬──────────────────────┐\n│Command-Line Format │ --single-transaction │\n└────────────────────┴──────────────────────┘\nThis option sets the transaction isolation mode to REPEATABLE READ and sends a START\nTRANSACTION SQL statement to the server before dumping data. It is useful only with\ntransactional tables such as InnoDB, because then it dumps the consistent state of the\ndatabase at the time when START TRANSACTION was issued without blocking any applications.\n\nThe RELOAD or FLUSHTABLES privilege is required with --single-transaction if both\ngtidmode=ON and gtidpurged=ON|AUTO. This requirement was added in MySQL 8.0.32.\n\nWhen using this option, you should keep in mind that only InnoDB tables are dumped in a\nconsistent state. For example, any MyISAM or MEMORY tables dumped while using this option\nmay still change state.\n\nWhile a --single-transaction dump is in process, to ensure a valid dump file (correct\ntable contents and binary log coordinates), no other connection should use the following\nstatements: ALTER TABLE, CREATE TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE. A\nconsistent read is not isolated from those statements, so use of them on a table to be\ndumped can cause the SELECT that is performed by mysqldump to retrieve the table contents\nto obtain incorrect contents or fail.\n\nThe --single-transaction option and the --lock-tables option are mutually exclusive\nbecause LOCK TABLES causes any pending transactions to be committed implicitly.\n\nBefore 8.0.32: Using --single-transaction together with the --set-gtid-purged option was\nnot recommended; doing so could lead to inconsistencies in the output of mysqldump.\n\nTo dump large tables, combine the --single-transaction option with the --quick option.\nOption Groups\n\n•   The --opt option turns on several settings that work together to perform a fast dump\noperation. All of these settings are on by default, because --opt is on by default. Thus\nyou rarely if ever specify --opt. Instead, you can turn these settings off as a group by\nspecifying --skip-opt, then optionally re-enable certain settings by specifying the\nassociated options later on the command line.\n\n•   The --compact option turns off several settings that control whether optional statements\nand comments appear in the output. Again, you can follow this option with other options\nthat re-enable certain settings, or turn all the settings on by using the --skip-compact\nform.\n\nWhen you selectively enable or disable the effect of a group option, order is important\nbecause options are processed first to last. For example, --disable-keys --lock-tables\n--skip-opt would not have the intended effect; it is the same as --skip-opt by itself.\nExamples\n\nTo make a backup of an entire database:\n\nmysqldump dbname > backup-file.sql\n\nTo load the dump file back into the server:\n\nmysql dbname < backup-file.sql\n\nAnother way to reload the dump file:\n\nmysql -e \"source /path-to-backup/backup-file.sql\" dbname\n\nmysqldump is also very useful for populating databases by copying data from one MySQL server\nto another:\n\nmysqldump --opt dbname | mysql --host=remotehost -C dbname\n\nYou can dump several databases with one command:\n\nmysqldump --databases dbname1 [dbname2 ...] > mydatabases.sql\n\nTo dump all databases, use the --all-databases option:\n\nmysqldump --all-databases > alldatabases.sql\n\nFor InnoDB tables, mysqldump provides a way of making an online backup:\n\nmysqldump --all-databases --master-data --single-transaction > alldatabases.sql\n\nOr, in MySQL 8.0.26 and later:\n\nmysqldump --all-databases --source-data --single-transaction > alldatabases.sql\n\nThis backup acquires a global read lock on all tables (using FLUSH TABLES WITH READ LOCK) at\nthe beginning of the dump. As soon as this lock has been acquired, the binary log coordinates\nare read and the lock is released. If long updating statements are running when the FLUSH\nstatement is issued, the MySQL server may get stalled until those statements finish. After\nthat, the dump becomes lock free and does not disturb reads and writes on the tables. If the\nupdate statements that the MySQL server receives are short (in terms of execution time), the\ninitial lock period should not be noticeable, even with many updates.\n\nFor point-in-time recovery (also known as “roll-forward,” when you need to restore an old\nbackup and replay the changes that happened since that backup), it is often useful to rotate\nthe binary log (see Section 7.4.4, “The Binary Log”) or at least know the binary log\ncoordinates to which the dump corresponds:\n\nmysqldump --all-databases --master-data=2 > alldatabases.sql\n\nOr, in MySQL 8.0.26 and later:\n\nmysqldump --all-databases --source-data=2 > alldatabases.sql\n\nOr:\n\nmysqldump --all-databases --flush-logs --master-data=2 > alldatabases.sql\n\nOr, in MySQL 8.0.26 and later:\n\nmysqldump --all-databases --flush-logs --source-data=2 > alldatabases.sql\n\nThe --source-data or --master-data option can be used simultaneously with the\n--single-transaction option, which provides a convenient way to make an online backup\nsuitable for use prior to point-in-time recovery if tables are stored using the InnoDB\nstorage engine.\n\nFor more information on making backups, see Section 9.2, “Database Backup Methods”, and\nSection 9.3, “Example Backup and Recovery Strategy”.\n\n•   To select the effect of --opt except for some features, use the --skip option for each\nfeature. To disable extended inserts and memory buffering, use --opt\n--skip-extended-insert --skip-quick. (Actually, --skip-extended-insert --skip-quick is\nsufficient because --opt is on by default.)\n\n•   To reverse --opt for all features except disabling of indexes and table locking, use\n--skip-opt --disable-keys --lock-tables.\nRestrictions\n\nmysqldump does not dump the performanceschema or sys schema by default. To dump any of\nthese, name them explicitly on the command line. You can also name them with the --databases\noption. For performanceschema, also use the --skip-lock-tables option.\n\nmysqldump does not dump the INFORMATIONSCHEMA schema.\n\nmysqldump does not dump InnoDB CREATE TABLESPACE statements.\n\nmysqldump does not dump the NDB Cluster ndbinfo information database.\n\nmysqldump includes statements to recreate the generallog and slowquerylog tables for dumps\nof the mysql database. Log table contents are not dumped.\n\nIf you encounter problems backing up views due to insufficient privileges, see Section 27.9,\n“Restrictions on Views” for a workaround.\n\n### COPYRIGHT\n\nCopyright © 1997, 2024, Oracle and/or its affiliates.\n\nThis documentation is free software; you can redistribute it and/or modify it only under the\nterms of the GNU General Public License as published by the Free Software Foundation; version\n2 of the License.\n\nThis documentation is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\nPURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with the program; if\nnot, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n02110-1301 USA or see http://www.gnu.org/licenses/.\n\n### NOTES\n\n1. MySQL Shell dump utilities\nhttps://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-dump-instance-schema.html\n\n2. MySQL Shell load dump utilities\nhttps://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-load-dump.html\n\n3. here\nhttps://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install.html\n\n4. Downgrade Notes\nhttps://dev.mysql.com/doc/refman/5.7/en/downgrading-to-previous-series.html\n\n### SEE ALSO\n\nFor more information, please refer to the MySQL Reference Manual, which may already be\ninstalled locally and which is also available online at http://dev.mysql.com/doc/.\n\n### AUTHOR\n\nOracle Corporation (http://dev.mysql.com/).\n\n\n\nMySQL 8.0                                    12/13/2024                                 MYSQLDUMP(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "MYSQLDUMP",
        "section": "1",
        "mode": "man",
        "summary": "mysqldump - a database backup program",
        "synopsis": "mysqldump [options] [dbname [tblname ...]]",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2010,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}