MySQL DBA - Tips and Techniques Magazine

13 Nov 2014

Example of daily deletion of a table via crontab

00 08 * * * mysql -uroot -p*** -se 'delete from tacacs.accounting where date < date_sub(now(), interval 90 day);'  > /tmp/delete_accounting.log 2>&1

1 comment:

  1. This could also be done with the MySQL event scheduler
    http://dev.mysql.com/doc/refman/5.6/en/events.html

    ReplyDelete