Mysql Master/Slave Log File mysql-binfile clearing method, mysqlmysql-bin

Source: Internet
Author: User

Mysql Master/Slave Log File mysql-binfile clearing method, mysqlmysql-bin

By default, mysql keeps mysql-binfiles, so that the disk may be fully occupied by a certain period of time. Can these files be deleted at this time? Can they be safely deleted, we do not recommend that you use the rm command to delete it. This may be insecure. The correct method is to delete it using the mysql command.

Mysql>Reset master;

Mysql> reset slave;

In fact, the key command is reset master; this command will clear the mysql-binfile.

In addition, if your mysql server does not require master-slave replication, we recommend that you modify the my. cnf file to prevent these files from being generated. You only need to delete the following line in my. cnf.

Log-bin = mysql-bin

If you need to copy the log files, you 'd better control the retention days of these log files. You can use the following configuration to set the retention days of these log files:

Expire_logs_days = 3

Indicates that logs are retained for three days, so that old logs are automatically cleared.

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.