Mysqldump and mysqlbinlog, mysqldump

Source: Internet
Author: User

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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.