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-PEnterPassword: Welcometo theMysqlMonitor. Commands End With ; Or\g.Your MysqlConnection IDIs 2819416ServerVersion: 5.5.24-0ubuntu0.12.04.1-Log(Ubuntu)Copyright (C) 2000, 2011, Oracle and/OrIts affiliates. AllRights reserved.Oracle IsA registered trademark ofOracle Corporation and/OrItsaffiliates. OtherNames may trademarks of their respectiveowners.type ' help; ' or ' \h ' for Help.type ' \c ' to clear the current input Statement. Mysql> reset Master;query Ok, 0 rows affected (3 min 37.65 Sec)
In fact, the key command is that reset master;
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:
=7
Indicates that the log is retained for 7 days, so that old logs are automatically cleaned out.
MySQL log file Mysql-bin file Cleanup method, and configuration of mysql-bin related files