Mysql logical backup bitsCN.com
Mysql logical backup
The syntax of mysqldump is as follows:
Mysqldump [arguments]> file_name
To back up all databases, use the -- all-databases option:
Mysqldump -- all-databases> dump. SQL
If you want to back up the specified database, you can use the -- databases option:
Mysqldump -- databases db1 db2 db3> dump. SQL
To back up the test architecture, use the following statement:
Mysqldump -- single-transaction test> test_backup. SQL
Use the -- single-transaction option to ensure backup consistency.
-- Single-trasaction: run the start transaction command before the backup starts to obtain the backup consistency. Currently, this parameter is only valid for the InnoDB storage engine. When this parameter is enabled and backed up, make sure that no other DDL statements are executed, because consistency cannot isolate DDL statements.
-- Add-drop-database: The drop database parameter must be used with the-all-databases or-databases option before the create database operation. By default, the exported text file does not contain the create database unless you specify this parameter.
BitsCN.com