Mysql deletes binlog logs and restores data.

Source: Internet
Author: User
The binlog function is enabled for mysql in the home decoration. The advantage of enabling this function is that it facilitates data recovery in the future, but the disadvantage is that log files are growing rapidly and will soon occupy the disk space. So we need to regularly or manually

The binlog function is enabled for mysql in the home decoration. The advantage of enabling this function is that it facilitates data recovery in the future, but the disadvantage is that log files are growing rapidly and will soon occupy the disk space. So we need to regularly or manually

The binlog function is enabled for mysql in the home decoration. The advantage of enabling this function is that the Hong Kong Space facilitates data recovery in the future and Hong Kong servers, but the disadvantage is that log files are growing fast, the disk space will soon be occupied.

Therefore, we need to regularly or manually delete large log files.

The methods for deleting log files are as follows:

1. Set the Log retention period expire_logs_days to automatically delete

Ii. manually delete BINLOG (purge binary logs)

Others:

  • The purpose of using binlog logs is to facilitate data recovery, so we should not only delete the logs, but also use logs to restore data.

    Use binlog to restore data:

    Use the mysqlbinlog command to restore logs

    This article is from the blog "the path to growth of Cui". Please keep this source

    , Hong Kong server

    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.