ArticleDirectory
- 2.1 Back up a single database
- 2.2 recovery of a single database
- 3.1 back up multiple databases
- 3. 2. Restore multiple databases
References
Reference 1: http://blog.csdn.net/feng_sundy/article/details/3496744
Reference 2: http://www.cnblogs.com/lxJack/archive/2011/05/22/2053270.html
Reference 3: http://blog.csdn.net/xw13106209/article/details/6608706
1. Preface
I have previously written about the backup and recovery of Oracle databases. For details, refer to Section 3. If MySQL is used today, I will also understand the backup and recovery of MySQL.
MySQL uses the mysqldump command for database backup and MySQL Command for restoration.
2. Back up a single database
Del F: \ database_backup \ mysql_backup \ bugdb. SQL mysqldump-Uroot-Proot bugdb>F: \ database_backup \ mysql_backup \ bugdb. SQL
The preceding commands are divided into two steps. The first step is to delete the original script of bugdb data, and the second is to back up the data of bugdb to the SQL script bugdb. SQL.
2.2 recovery of a single database
MySQL-Uroot-Proot bugdb<F: \ database_backup \ mysql_backup \ bugdb. SQL
3. The instance 23.1 backs up multiple databases.
Del F: \ database_backup \ ngx_backup \ ngx_db7.sqlren F: \ database_backup \ ngx_backup \ ngx_db6. SQL ngx_db7. SQL ren f: \ database_backup \ ngx_backup \ mongodeff: \ database_backup \ ngx_backup \ mongof: \ database_backup \ ngx_backup \ ngx_db3. SQL ngx_db4.sqlren F: \ database_backup \ ngx_backup \ ngx_db2. SQL ngx_db3.sqlren F: \ database_backup \ ngx_backup \ ngx_db. SQL ngx_db2.sqlmysqld-Uroot-Proot--Database ngx_ad ngx_authority ngx_jbpm ngx_mes ngx_model> F: \ database_backup \ ngx_backup \ ngx_db. SQL
The -- database option is used in the mysqldump command, followed by multiple database names. For details, refer to section 1.
3. 2. Restore multiple databases
MySQL-Uroot-Proot<F: \ database_backup \ ngx_backup \ ngx_db. SQL
Because multiple databases are restored, no specific database is specified here. It is different from instance 1.