MySQL Backup tool--mysqldump Backup and recovery

Source: Internet
Author: User
Tags local time mysql backup

Https://help.aliyun.com/knowledge_detail/41738.html

MySQL full: Record pos location

Mysqldump-h10.10.10.1-uadmin-p--master-data=2--single-transaction-r--events-q--all-databases > 2.sql

Cat 2.sql |head-22

22 Rows in the exported backup see the POS location point and the specific Binlog file name

Change MASTER to master_log_file= ' mysql-bin.000955 ', master_log_pos=65546478

then restore with the following command 1

or we can find the specific time information at the POS point and then restore it, the command is as follows 2

To restore the binary log to a readable state:

Mysqlbinlog--no-defaults-v--base64-output=decode-rows mysql-bin.000955 > Binlog111.sql

restore Binlog to the database

Command 1

Mysqlbinlog mysql-bin.000688 mysql-bin.000689--start-position=531167--stop-datetime= "16-05-16 18:05:03" | Mysql-uroot-p-p3306-h *.*.*.*

Command 2

Mysqlbinlog mysql-bin.000688 mysql-bin.000689--start-datetime= "17-06-06 10:05:03"--stop-datetime= "17-06-06 18:05:03 "| Mysql-uroot-p-p3306-h *.*.*.*

# Mysqlbinlog Other parameters that can be used

#--database db_name Specifies only incremental recovery of data db_name the specified database

#--start-position Specifies the Binlog point at which to start the recovery, which should exist in the specified first Binlog file.

#--stop-position Specifies the Binlog site to revert to, which should exist in the last Binlog file specified.

#--START-DATETIME Specifies the point in time at which to start the recovery (starting from the first Binlog event equal to or greater than that point in time).

# in the local time zone, the format is the time format that MySQL can accept, such as "2016-05-16 08:01:05" or "16-05-16 08:01:05".

#--STOP-DATETIME Specifies a point in time at which to stop the recovery (at the first Binlog event that is equal to or greater than that point in time).

# in the local time zone, the format is the time format that MySQL can accept, such as "2016-05-16 08:01:05" or "16-05-16 08:01:05".

MySQL Backup tool--mysqldump Backup and recovery

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.