Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Deleting MySQL Log files

Adrian Singer, 05-27-2009
When using MySQL databases, especially with replication turned on, you'll notice MySQL log files can build up very quickly.

To delete MySQL log files, without breaking replication, issue this command:


PURGE BINARY LOGS BEFORE concat
(from_days(to_days(now())-3)," 00:00:00"); 

This command will delete all log files that are more than 3 days old.

Never use 'RESET MASTER' or 'RESET SLAVE' as these two break the replication sequence.

Saverio Miroddi, 06-18-2009
This should do the same a little more readably:

PURGE BINARY LOGS BEFORE CURDATE() - INTERVAL 3 DAY

.
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions