Time to flush and reset binary logs with MySQL

Jul 4, 2012 00:00 · 69 words · 1 minute read MySQL

I logged into my MySQL server and found that MySQL was using almost 70% of the allocated space. So time to clean, flush and reset the binary logs (I don’t use expire_logs_days).

$> mysql -u root -p
mysql> FLUSH LOGS;
mysql> RESET MASTER;

That’s it. After that, the usage was reduced to 5% of the allocated space.

Another option is to use the expire_logs_days option in the my.cnf file.