Backup operation for MYSQL

Source: Internet
Author: User

  • Backup types and Features

    Cold (cold Backup): Need to shut down the MySQL service, read and write requests are not allowed in the state;
    Win Bei (warm backup): Service online, but only support read requests, do not allow write requests;
    Hot backup: The business is not affected at the same time as the backup.

  • Depending on the scope of the data collection to be backed up
    Full backups: Full backup, back up all character sets.
    Incremental Backup: Incremental backup data that has changed since the last full or incremental backup, cannot be used alone, and with full backups, the frequency of backups depends on how often the data is updated.
    Differential backup: Differential backup data that has changed since the last full backup.
    Recommended recovery strategy:
    Full + increment + binary log
    Full + diff + binary log

  • Database to make a full backup:

    Mysqldump-uroot-p--single-transaction--master-data=2--databases zy >d:\mysql\priv\20171206-1.sql

    --single-transaction: Based on this option, the hot standby InnoDB table can be implemented; Therefore,--lock-all-tables is not required at the same time;
    --master-data=2 record the location of the binary log at the time of the backup, and comment out that 1 is not annotated
    --databases Hellodb Specify the database to be backed up

    To view binary information from a backup:

  • 4. Operation of database change information, re-view the data guest log information

    Show Master Status

    5. Test incremental Backups

    6. View operational records for a log point


    7. Hot spare the binary log needs to be turned off when importing data

    Set sql_log_bin=0

    Flush logs--Refresh Log

    8. Import a previously backed up binary file

    Backup operation for MYSQL

    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.