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