usage:mysqldump [OPTIONS] database [tables]
OR mysqldump [options]–databases [OPTIONS] DB1 [DB2 DB3 ...]
OR mysqldump [options]–all-databases [OPTIONS]
Use Mysqldump–help to view all command Help
The most commonly used parameter description: 1. --all-databases ,-a: Export all databases, including MySQL, Informance_schema, Performance_schema database example: mysqldump -u root -ppassword -P3306 -S /tmp/mysql.sock --all-databases > all.sql or: mysqldump -u root - Ppassword -p3306 -s /tmp/mysql.sock -a > all.sql2.--no-data, -d: Export the table structure of all databases, excluding data examples:mysqldump -u root -ppassword -p3306 -s /tmp/mysql.sock --no-data --all-databases > 1.sql or: mysqldump -u root -ppassword -p3306 -s /tmp/mysql.sock -d -a > 1.sql3.--databases , -b Export data for a database example: Mysqldump -u root -ppassword -P3306 -S /tmp/mysql.sock --databases testdatabase > 1.sql or:    &Nbsp;mysqldump -u root -ppassword -p3306 -s /tmp/mysql.sock -b Testdatabase > 1.sql4.--add-drop-database: Add drop DATABASE statements before each database creation, use this option with caution, because when you import a database, you overwrite the existing database. This option is turned off by default. 5.--add-drop-table Add a Drop data table statement before each data table creation, the default is open, use--skip-add-drop-table to close the feature example: Cancel Add drop TABLE statement: Mysqldump -u root -ppassword -p3306 -s /tmp/mysql.sock --skip-add-drop-table -- all-databases > all.sql6.--master-data export with Master_log_file and master_log_pos information, Example of initialization slave use: mysqldump -u root -ppassword -p3306 -s /tmp/ mysql.sock --master-data --all-databases > All.sql7.--single-transactioninnodb table when backing up, enable the option--single-transaction to guarantee the consistency of the backup, it works to set the isolation level for this session is repeatable read to ensure that the data that has been submitted by other sessions is not seen when the session is backed up. The time of adding global read lock is very short, can be understood as hot backup, It is strongly recommended to add the--single-transaction parameter when backing up with the mysqldump parameter.
This article is from the "12413959" blog, please be sure to keep this source http://12423959.blog.51cto.com/12413959/1883547
MySQL5.6 backup mysqldump (i)