MySQL log file Mysql-bin file Cleanup method, and configuration of mysql-bin related files

Source: Internet
Author: User

By default, MySQL will keep the mysql-bin file, so that at some point, the disk may be full, whether it is possible to delete these files, whether it can be safely deleted, is a problem.

First of all, these files are MySQL log files, if not the master from the copy, it is basically useless, although useless, but not recommended to use the RM command to delete, it may be unsafe, the correct way is to remove the MySQL command.

Mysql -u root -penter password: welcome to the mysql monitor.   commands end with ; or \g.your mysql connection id is  2819416Server version: 5.5.24-0ubuntu0.12.04.1-log  (Ubuntu) copyright  (c)  2000,  2011, oracle and/or its affiliates. all rights reserved. oracle is a registered trademark of oracle corporation and/or  Itsaffiliates. other names may be trademarks of their respectiveowners . type  ' help; '  or  ' \h '  for help. Type  ' \c '  to clear the current input  statement.mysql> Query OK, 0 rows affected  (3 min 37.65  Sec

In fact, the key reset master command is that ; this command will empty the Mysql-bin file.

In addition, if your MySQL server does not need to master from the copy, it is recommended to modify the My.cnf file, to set not to generate these files, as long as the deletion of MY.CNF in the following line is possible.

Log-bin=mysql-bin

If you need to copy, it is a good idea to control the number of days these log files remain, which can be set by the following configuration:

Expire_logs_days = 7

Indicates that the log is retained for 7 days, so that old logs are automatically cleaned out.


This article is from the "XFICC" blog, make sure to keep this source http://xficc.blog.51cto.com/1189288/1586177

MySQL log file Mysql-bin file Cleanup method, and configuration of mysql-bin related files

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.