如何在Windows上备份MySQL数据库?
我的笔记本电脑上安装了 WampServer 2.0。
我正在其上运行我编写的应用程序。该应用程序正在使用 MySQL 数据库。
我想定期备份该数据库。
如何做到这一点?
如何在 Windows 上定义 cron ?
I have WampServer 2.0 that is installed on Windows on my laptop.
I'm running on it an application that I wrote. The application is working with MySQL database.
I would like to make backups of this database periodically.
How this can be done ?
How could I define cron on Windows ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 Windows,
crontab -e
的大致等效项是at
命令,如下所示:单独运行
at
命令会列出您已执行的任务使用at
创建。mysqldump 文档位于此处。
The rough equivalent of
crontab -e
for Windows is theat
command, as in:Running the
at
command by itself lists the tasks you've created usingat
.The mysqldump documentation is here.
备份 MySQL 数据库最流行的方法是使用 mysqldump:
打开 Windows 命令行。
指定 mysqldump 实用程序的目录
cd "C:\Program Files\MySQL\MySQL Server 5.7\bin"
创建 MySQL 数据库的转储。
mysqldump.exe --user=YourUserName --password=YourPassword --host=localhost --port=3306 --result-file="Pathdump.sql" --databases "DatabaseName"
另外,还有有很多第三方工具,可以定期自动进行MySQL备份。
The most popular way to backup MySQL database is to use mysqldump:
Open a Windows command line.
Specify the directory to mysqldump utility
cd "C:\Program Files\MySQL\MySQL Server 5.7\bin"
Create a dump of your MySQL database.
mysqldump.exe --user=YourUserName --password=YourPassword --host=localhost --port=3306 --result-file="Pathdump.sql" --databases "DatabaseName"
Also, there are a lot of third-party tools, which can perform MySQL backups automatically on a regular basis.
您可以使用 bash 脚本。
http://paulbradley.tv/38/
You could use a bash script.
http://paulbradley.tv/38/