Full-service Internet Marketing & Web Development
Recent Posts

Sponsors
![]() |
Deleting MySQL Log filesAdrian 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.
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
.
PURGE BINARY LOGS BEFORE CURDATE() - INTERVAL 3 DAY
.
|
|
Subscribe Now to receive new posts via Email as soon as they come out.
Comments
Post your comments


