Database backup-mysqldump

Source: Internet
Author: User

Database backup Type

One, hot backup warm backup cold backup

Hot backup: Data read/write not affected

Warm backup: Can only perform read operations

Cold backup: Offline backup, read and write both terminated

Second, physical backup logical backup

Physical Backup: Copying data files

Logical backup: Export data to a text file

Three, full backup incremental backup differential backup

Full backup: Back up all data

Incremental backup: Backs up only data that has changed from the last full backup or incremental backup

Differential backup: Backs up only data that has changed since the last full backup


mysqldump is a MySQL-backed backup tool that enables warm backups of MyISAM tables and hot backups of InnoDB tables. However, it is very slow to restore, and it is easy to use when backing up small databases. When you use mysqldump warm backup, you should first lock the database so that it can only read operations. The collective steps should be:

1mysql>flush tables with read lock;

2mysqldump Backup new Open a connection for backup, the above lock table is valid only for the current session

3mysql>unlock tables;

These operations, mysqldump command parameters can be completed, mysqldump commonly used command parameters:

#mysqldump-U user-p

--all-databases back up all databases, you don't need to create them before you restore them

--lock-all-tables means locking all tables

--master-data=n

N=0 indicates that the log file location is not logged

N=1 means that the change MASTER to is used to record

N=2 represents a record using change MASTER to, but the default annotation is generally used n=2

--flush-logs performs binary log scrolling for easy backup of binary logs

These are the common parameters,

If the backup table type is InnoDB type, you can use--single-transaction to start the hot spare, and you do not need to--lock-all-tables to lock the table at this time.







This article is from the "Bremen Band" blog, declined reprint!

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.