Binlog Processing Method for MySQL DATA

Source: Internet
Author: User
Tags mysql delete

Binlog Processing Method for MySQL DATA

Recently, the disk has grown very fast and it is found that binlog logs occupy a large amount of disk resources. We use manual cleanup, and set Automatic cleanup later.

View the specified deletion log

Mysql> show binary logs; check the amount of binlog logs and space occupied.

Mysql> purge master logs to 'mysql-bin.002467 '; delete all previous binlogs of the mysql-bin.002467 so that deletion can ensure that *. index information is synchronized with the binlog file.

 

Manual cleanup

Mysql> purge master logs before DATE_SUB (CURRENT_DATE, INTERVAL 5 DAY); manually delete binlog LOGS 5 days ago

 

Automatic Cleaning

Mysql> set global expire_logs_days = 5; set the binlog expiration time to 5 days;
Mysql> flush logs; click log to make the preceding settings take effect; otherwise, the settings do not take effect.

To ensure that MYSQL is still valid after restart, add this parameter in my. cnf.

Expire_logs_days = 5

MySQL Data Recovery-binlog

Clear binlog logs in MySQL

How to safely delete binlog logs under MySQL

MySQL -- binlog log data recovery

How does MySQL Delete binlog and restore Data?

Introduction and Analysis of Three MySQL binlog formats

MySQL uses binlog Incremental backup + restore instance

MySQL deletes binlog logs and restores data.

This article permanently updates the link address:

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.