Mysqldump and mysqlbinlog, mysqldump
1. mysqldump
1. Back up the test database
#mysqldump -uroot -p'123' test >test.sql
2. Backup-B Parameters
# Mysqldump-uroot-p '000000'-B test> test_ B. SQL -- B has the create DATABASE, and use
# Mysqldump-uroot-p '000000'-B test test1> test_ B. SQL -- B has the create DATABASE AND use databases, and both the test and test1 databases are backed up at the same time.
3. Backup-compact removes unnecessary characters
# Mysqldump-uroot-p '000000'-B -- compact test> test_ B _C. SQL --- compact remove unnecessary characters
4. mysql recovery
# Mysql-uroot-p '000000' <test_ B. SQL -- if-B is not added during backup, create a database and use the database before restoration.
5. Compressed gzip of mysqldump
#mysqldump -uroot -p'123' -B test|gzip>test_B_bak.sql.gz
6. mysqldump compression recovery gunzip
gunzip <test_B_bak.sql.gz|mysql -uroot -p'123'
7. mysqldump only backs up the table structure-d
#mysqldump -uroot -p'123' -d test >test_d.sql
8. mysqldump only backs up table data (without structure)-t
#mysqldump -uroot -p'123' -t test >test_t.sql
9. Refresh binlog-F during Backup
#mysqldump -uroot -p'123' -F test >test_F.sql
10. Record the binary log location during backup -- master-data = 1
#mysqldump -uroot -p'123' --master-data=1 test>tset_md.sql
Summary: several backup methods, backup file size