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.