The recent disk growth was very fast and found that the Binlog log occupies a large disk resource. We use manual cleanup and set up automatic cleanup later.
View the specified delete log
MySQL >show binary logs; See how much binlog logs, how much space is occupied.
Mysql> PURGE MASTER LOGS to ' mysql-bin.002467 '; Delete mysql-bin.002467 all previous binlog so that the *.index information is synchronized with the Binlog file.
Manual cleanup
Mysql>purge MASTER LOGS before Date_sub (current_date, INTERVAL 5 day); Manually delete the Binlog log 5 days ago
Automatic Setup Cleanup
mysql> Set Global expire_logs_days = 5; Set the expiration time of Binlog to 5 days;
mysql> flush logs; Swipe log to make the above settings effective, otherwise it will not take effect.
To ensure that it is still valid after MySQL restart, this parameter setting is also added in MY.CNF
Expire_logs_days = 5
This article is from the "Fly Hung 膤" blog, please be sure to keep this source http://jxzhfei.blog.51cto.com/1382161/1538466