Mysql Incremental Backup

Source: Internet
Author: User

Note that if you accidentally delete the table and want to restore it, you must have the log for creating the table in the recovery log. Otherwise, you cannot recover the table because it has been recorded since you created the table. when the log is recovered, it is calculated based on the location. mysql 5.0 does not support Incremental backup. Incremental backup is defined. The mysql database automatically records user operations on the mysql database in binary format to the file. if you want to recover data, you can use the backup file for Incremental Backup record (dml statements do not record select statements) the recorded (a operation statement itself B operation time c operation location position) instance configuration my. INI file or my. conf enable binary backup log-bin = e:/mysqldb/logbin. log First sets the mysql log storage location, and then starts it. Then, two more logbin files will be added to the backup directory. index is the Incremental Backup logbin.000001 of the index file to store the user's database operation files. If you want to see what is in this file, you can use a tool in the bin directory of mysql to check that it is mysqlbinlog.exe. first, use cmd to enter the mysql bin directory and then execute mysqlbinlog e: /mysqldb/logbin.000001 mysql records the time of each operation and assigns you a position (pos) in other words, we can recover data by time point or by location. For example, if we drop a table, we only need to restore the table to the drop point. flowchart logbin.000001 insert ...... 3 17:57:00 update ..... 4 17:59:00 insert ...... 100 19:57:00 drop... 101 at 20:57:00, you can write mysqlbinlog -- stop-datatime = "20:50:00" e: /mysqldb/logbin.000001 the above statement indicates that the mysqlbinlog -- start-datatime = "20:50:00" e: /mysqldb/logbin.000001 the above statement indicates that mysqlbinlog -- stop-position = "100" e is restored from 20:50:00: /mysqldb/logbin.000001 | the preceding statement indicates that the authenticity is restored to the location 100. The location-based restoration mysqlbinlog -- stop-position = 4590 e: /mysqldb/logbin.000001 | mysql-uroot-p restore mysqlbinlog by time -- stop-datetime = "18:17:19" e: /mysqldb/logbin.000001 | mysql-uroot-p can control the starting time and ending mysqlbinlog -- start-position = 4 -- stop-position = 106 yueliangdao_binglog.000001> c: \ test1.txt during work, you can perform a full backup every Monday, that is, mysqldump, and enable our Incremental backup to set the expiration time to greater than or equal to 7 days. If the database crashes, you can use the time and location restore
How to disable mysql Automatic logging to find log-bin = mysql-bin, add # above. In some versions, you need to disable binlog_format = add # Before mixed. Otherwise, mysql cannot be started.

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.