MYSQL17---Incremental backup

Source: Internet
Author: User
Tags crc32

MySQL Incremental backup: Full backup is: (incremental backup must look at the time and location of the log node) MySQL database will be in binary form, the user's operation of the MySQL database to the file, do not use the timer. When the user wants to recover, they can use the backup file for recovery. A statement that records a DML statement that creates a table. The SELECT statement is not logged (has no effect on the database itself). Will record 1. The operation statement itself. 2. The time of the operation.3. The location of the operation. How to use an incremental backup file for recovery. Steps:1. Configure My.ini or my.conf files to turn on incremental backups. (2 MySQL can be installed on the same machine, as long as the version number is not the same) #指定增量备份文件路径server-Id=1Log-Bin=D:\MYSQL\mysql-5.7. --Winx64\binlog\mylog2. Restart MySQL to get the file: (my is generated in MySQL root, and not in the MyLog directory generated) Mylog.index is the index file, which records the backup files. MYLOG.000001 is a backup file that really holds files on database operations. You can use Mysqlbinlog to view the contents of a backup file: Mysqlbinlog file path $ mysqlbinlog/D/Mysql/Mysql-5.7. (MySQL records the time and location of each operation, which can be recovered depending on the location of the time) (the modification time of each additional record file will change)/*# at 794 #180109 16:13:17 server ID 1 end_log_pos 825 CRC32 0x4c8f791e Xid = 21commit/*!*/;SET @ @SESSION. Gtid_next= 'AUTOMATIC' /*added by Mysqlbinlog*/ /*!*/;D Elimiter;*/3. Now delete the table AAA. Recover the file AAA according to the log. If it can be restored before the drop. # at3176        //Location #180109  -: A: ,Server ID1End_log_pos3292CRC320x6f838f66Query thread_id=5Exec_time=0Error_code=0SET TIMESTAMP=1515486128/*!*/;//Point in TimeDROP TABLE' AAA '/*generated by Server*//*!*/;SET @ @SESSION. Gtid_next= 'AUTOMATIC' /*added by Mysqlbinlog*/ /*!*/;D elimiter; Mysqlbinlog--stop-datetime= "2018-01-09 16:49:56" D:\MYSQL\mysql-5.7 | mysql-uroot-p//Until this timeMysqlbinlog--start-datetime= "" d:/binlog/mylog.00001 | mysql-uroot-p//Starting from this timeMysqlbinlog--stop-position= "3176" d:/binlog/mylog.00001 | mysql-uroot-p//As of this position, it can be restored. Mysqlbinlog--stop-position= "6500" D:\MYSQL\mysql-5.7 | mysql-uroot-pbackup files are also backed up. One full backup (mysqldump) a week. Then this incremental backup has an expiration time greater than or equal to 7 days. 

MYSQL17---Incremental backup

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.