简体   繁体   中英

How to clean the MySQL database on a daily basis

So, I have some kind of records in my database that should be deleted after 24 hours. How do I make my MySQL database to update itself? Is this even possible? Thanks

0 0 * * * mysql -u USER -pPASSWORD -h HOST DATABASE < path/to/sql/script

看着man crontab

You can write cron jobs for that.

In linux you can use crontab for that documentation

On Windows you can set cron jobs like this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM