MySQL database backup and recovery. mysql binlog Detailed

First of all, I would like to understand about the next logical backup and physical backup.

Logical backup and physical backup advantages and disadvantages, in general, physical backup faster recovery, a relatively large space, the backup logic slower, relatively small space. High cost recovery logical backup.

Logical backup is a backup sql statement, perform a backup at the time of recovery of the database sql statement to achieve reproducible data.

mysqldump

mysqldump is the use of SQL-level backup mechanism, he will lead into the data table SQL script file, is the most common logical backup method.

Physical backup

Physical backup is to back up data files, compare the image point is the next cp data files, but the real time nature is not backed up the cp so simple.

 

Well, after the previous very detailed introduction, I later learn is the main logical backup.

1, the logical data backup mysqldump

mysqldump -uroot -p --all-databases > all.sql

Back up all content databases

mysqldump -uroot -p --databases new3 hz1901> all.sql
backup new3 hz1901 two databases

 mysqldump -uroot -p new3 > all.sql

Backing up a single database new3

mysqldump -uroot -p new3 info >all.sql

Backup library new3 table below info

2, data recovery

mysql  -uroot -p < all.sql

 

mysql binlog Detailed : https: //www.cnblogs.com/Presley-lpc/p/9619571.html

https://www.cnblogs.com/kevingrace/p/5907254.html

Wait for the follow-up have time to learn.

 

Guess you like

Origin www.cnblogs.com/sidianok/p/11768519.html