For additional information about this and other option-file options, see Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling” . 

## DDL Options 

Usage scenarios for mysqldump  include setting up an entire new MySQL instance (including database tables), and replacing data inside an existing instance with existing databases and tables. The following options let you specify which things to tear down and set up when restoring a dump, by encoding various DDL statements within the dump file. 

• --add-drop-database 

Write a DROP DATABASE  statement before each CREATE DATABASE  statement. This option is typically used in conjunction with the --all-databases  or --databases  option because no CREATE DATABASE  statements are written unless one of those options is specified. 

• --add-drop-table 

Write a DROP TABLE  statement before each CREATE TABLE  statement. 

• --add-drop-trigger 

Write a DROP TRIGGER  statement before each CREATE TRIGGER  statement. 

• --all-tablespaces , -Y 

Note 

In MySQL 8.0, the mysql  schema is considered a system schema that cannot be dropped by end users. If --add-drop-database  is used with --all- databases  or with --databases  where the list of schemas to be dumped includes mysql , the dump file contains a DROP DATABASE ‘mysql‘  statement that causes an error when the dump file is reloaded. 

Instead, to use --add-drop-database , use --databases  with a list of schemas to be dumped, where the list does not include mysql . 

Adds to a table dump all SQL statements needed to create any tablespaces used by an NDB  table. This information is not otherwise included in the output from mysqldump . This option is currently relevant only to NDB Cluster tables. 

• --no-create-db , -n 

Suppress the CREATE DATABASE  statements that are otherwise included in the output if the -- databases  or --all-databases  option is given. 

• --no-create-info , -t 

Do not write CREATE TABLE  statements that create each dumped table. 

• --no-tablespaces , -y 

Note 

This option does not  exclude statements creating log file groups or tablespaces from mysqldump  output; however, you can use the --no-tablespaces  option for this purpose. 

