如何使用RDS复制数据库

发布于 2024-09-25 17:28:28 字数 85 浏览 1 评论 0 原文

我在 RDS 上有一个数据库实例,上面有 2 个数据库。有没有一种好方法使用 RDS 命令行工具将一个数据库复制到另一个数据库?如果没有,推荐的做法是什么?

I have a database instance on RDS with 2 databases on it. Is there a good way using the RDS command line tools to copy the one database to the other? If not, what is the recommended way of doing it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

北方。的韩爷 2024-10-02 17:28:28

这不是 OP 的精确解决方案,但如果您只需要克隆现有数据库以实现新目的,那么有一种更简单的方法。您可以从原始 RDS 实例拍摄快照,然后将其恢复新实例。您甚至可以使用 Web 控制台。

This is not an exact solution to the OP, but if all you need is to clone an existing database for a new purpose, there's an easier way. You can take a snapshot from the original RDS instance, then restore it to a new instance. You can even use the web console.

ヅ她的身影、若隐若现 2024-10-02 17:28:28

我将使用 mysqldump 获取表,然后使用 mysql 导入它们。


更新 2014/07/08:根据您计划在此处执行的操作,今天的另一个解决方案是设置复制,然后将从属服务器提升为主服务器。例如,如果您想更新数据库的发行/版本:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide /USER_ReadRepl.html

如果您希望进行外部备份,还可以使用复制:
http://docs.aws.amazon.com /AmazonRDS/latest/UserGuide/MySQL.Procedural.Exporting.NonRDSRepl.html

RDS 已经取得了长足的进步。

I'd use mysqldump to get the tables and then mysql to import them.


Update 2014/07/08: Depending on what you're planning to do here, another solution today is to setup replication and then to promote the slave to be the master. That is for example if you want to update your database's release/version:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html

If you're looking to backup externally, there's also replication:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Exporting.NonRDSRepl.html

RDS has come a long way.

沉默的熊 2024-10-02 17:28:28

这取决于您在那里托管哪个数据库 - 对于 SQL Server,我使用了 SQL Azure 迁移向导(免费 下载来自 CodePlex)。

要获得完整的 RDBMS 功能,技巧是在向导中使用 SQL Server 实例的 DNS 名称,但选择“SQL Server v2008”(或在 AWS RDS 提供 2012 版本的实例后最终选择 v2012),并且不要选择 --> ;'SQL Azure'。我在我的 博客也是如此。

it depends on which database you are hosting there - for SQL Server I have used the SQL Azure Migration wizard (free download from CodePlex).

To get full RDBMS functionality the trick is to use the DNS name of your SQL Server instance in the wizard, but select 'SQL Server v2008' (or eventually v2012 after AWS RDS makes instances with 2012 available) and do NOT select to-->'SQL Azure'. I did a short screencast on this on my blog as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文