MARIADB using mysqldump binary database backup operations

Source: Internet
Author: User

Experimental content

Time database. Table contents (ID) Action content

8-point db1.t1 for full backup

9 points db1.t1 4,5 (new additions) Add data

10 point db1.t1 Delete db1 Delete db1


11 o'clock the database contents are found to be incorrect, and the normal data is requested.

8-point Data full backup

Mysqldump-uroot-ppassword--all-databases--single-transaction--master-data=2 >/tmp/mysql.all.sql

Command parameter Description:

--all-databases =-A backs up all the libraries

--single-transaction can achieve consistent data and service availability

--flush-logs a new log is generated after a full backup, and then the operation records for the database are present in the new log file

--master-data=2 the file name of the log and the position number that starts in this log.

9 Point Data Increase

Instert into Db1.t1 (4), (5);

10-point Data deletion

Delete DB1

    1. Stop Service

    2. Clear Environment

    3. Start-up service

    4. Import full backup data

      Mysql-uroot-ppassword </tmp/mysql.all.sql

    5. Import incremental backup data (replay log)

      A. Confirming information about log files and Master_log_pos

      Sed-n ' 22p '/tmp/mysql.all.sql (mariadb5.5 fixed storage position)

      B. Display results:

      [Email protected] ~]# sed-n ' 22p '/tmp/mysql.all.sql

      --Change MASTER to master_log_file= ' servera.000006 ', master_log_pos=245;

      C. Replay Log

      mysqlbinlog/var/lib/mysql-log/servera.000006--start-position=245--stop-position=672 |mysql

    6. Test

This article from the "Small Shack" blog, declined reprint!

MARIADB using mysqldump binary database backup operations

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.