MySQL数据库的远程备份 [英] Remote backup of MySQL database

查看:114
本文介绍了MySQL数据库的远程备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的Java服务器应用程序将数据记录到SQL数据库,该数据库可能位于同一台计算机上,也可能不在同一台计算机上.当前,我们使用MS SQL Server,现在正在移植到MySQL.用户在我们的应用服务器上配置数据库备份参数,例如一天中运行备份的时间,应用服务器通过适当的时间在适当的时间执行SQL Server的BACKUP DATABASE命令.它每天进行增量备份,每周进行完整备份.

Our Java server application logs data to a SQL database, which may or may not be on the same machine. Currently we use MS SQL Server, and we're now porting to MySQL. A user configures database backup parameters on our app server, e.g. time of day to run a backup, and the app server executes SQL Server's BACKUP DATABASE command at the appropriate time, via a sproc. It does incremental backups daily and full backups weekly.

MySQL缺乏等效功能,无法通过客户端连接告诉数据库备份自身.我们正在考虑的选项是:

MySQL lacks an equivalent feature to tell the database from a client connection to back itself up. Options we're considering are:

  • 创建一个UDF以封装到mysqldump(或复制数据库文件)中,可以通过sproc从我们的应用服务器中调用它.本质上,我们将为MySQL实现一个版本的BACKUP DATABASE.
  • 创建一个在MySQL框上运行的服务,该服务可以从应用服务器获取备份设置,并在本地运行mysqldump(或文件副本).
  • 创建一个备份程序来模拟mysqldump,例如显示每个表的创建表并选择到输出文件中.

不建议您设置cron作业,Perl脚本,第三方应用程序或其他在数据中心运行良好的技巧;这是一个收缩包装程序,需要非常强大并且可以放手.

Setting up a cron job, Perl script, third-party app or other tricks that'd work great in a data center aren't preferred; this is a shrink-wrap package that needs to be pretty robust and hands off.

数据库大小范围大约为10MB到10GB.

Database sizes can range from roughly 10MB to 10GB.

我知道增量块的二进制日志.我认为,如果我们决定使用它们,则一般的解决方案也可能适用于它们.

I'm aware of the binary logs for the incremental piece. I figure the general solution will probably apply to them as well, if we decide to use them.

这一切都在Windows 2003 32位或2008R2 64位MySQL 5.1上实现.

This is all on Windows 2003 32-bit or 2008R2 64-bit, MySQL 5.1.

对我来说,UDF选项似乎是最好的.UDF存储库( http://www.mysqludf.org/)具有mysqludf_sys,这可能就是我们需求,但是我想征求意见,因为经过广泛的谷歌搜索,似乎其他人并没有得出相同的结论,或者也许我们的需求与众不同.我们的应用程序是MySQL中唯一的东西,因此我不担心其他用户可以访问我们的UDF.

The UDF option seems the best to me. The UDF Repository (http://www.mysqludf.org/) has mysqludf_sys, which may be all we need, but I thought I'd ask for opinions since after extensive googling it doesn't seem like others have reached the same conclusion, or maybe our needs are just out of the ordinary. Our app is the only thing in MySQL, so I'm not worried about other users having access to our UDF.

我忽略的任何解决方案吗?以这种方式使用UDF有任何经验吗?

Any solutions I'm overlooking? Any experience with using UDFs in such a way?

谢谢,埃里克

推荐答案

由于另一个原因,我们决定将我们的应用程序与数据库并置,因此这个问题就变得没有意义了.

For this an other reasons we decided to collocate our application with the database, so this problem became moot.

这篇关于MySQL数据库的远程备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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