简体   繁体   中英

Is there a way of restoring a MySQL database on a time schedule

I've been creating scheduled MySQL backups and then sending them via FTP to another test server using PHP. I need to know if there is a program that I can run to restore the files on my other server but using a scheduled restore?

Thanks

You can create a CRON job which launches a shell code.

For instance if you want to inject a backup database:

mysql -u user -ppassword database < yourbackupfile.sql

Now if you want to create a dump:

mysqldump -u user -ppassword database > yourbackupfile.sql

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