如何使用phpmyadmin自动执行数据库备份 [英] How to automate database backup using phpmyadmin

查看:1121
本文介绍了如何使用phpmyadmin自动执行数据库备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用phpmyadmin export作为sql dump手动进行数据库备份,结果文件名为spbkYYMMDD(Y; year m:month D:day).是否有任何方法可以自动执行db备份以获取sql定期进行转储,文件名应自动相应地生成.您能向我解释一下逻辑吗?

I am currently taking database backup manually using phpmyadmin export as a sql dump,the resulted file name will be spbkYYMMDD(Y;year m:month D:day).Is there any way to automate db backup so that i get sql dump for regular intervals and the file name should automatically generated correspondingly .can you explain me the logic.

推荐答案

在UNIX shell中运行crontab并创建规则以启动创建数据库备份的过程

Run crontab in unix shell and create the rule to launch process for creating database backup

 0 0 * * * /usr/local/bin/mysqldump -uLOGIN -PPORT -hHOST -pPASS DBNAME | gzip -c > `date "+\%Y-\%m-\%d"`.gz

还要检查

编辑

您只需要编写Web界面,不要以为可以找到现成的代码.但是您需要使用cron作业,以使功能自动运行以在UNIX机器中定期运行.您可以在此处找到有关如何编写cron作业的更多信息.所以现在,您只需要编写一个Web界面即可从用户那里获取数据并根据输入更改规则(我想您可以自己做到)

The web interface you only have to write, dont think you can find a readymade code for that. But You need to use cron job, to automate a function to run at regular intervals in a unix machine. You can find more info on how to write a cron-job here. So you now, just need to write a web interface, which gets data from user and changes the rule according to the input(Which I think you can do it yourselves)

这篇关于如何使用phpmyadmin自动执行数据库备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆