在AWS RDS MySQL db之间传输数据

时间:2011-12-15 09:19:24

标签: mysql heroku amazon-web-services mysqldump amazon-rds

将数据从一个amazon rds mySQL实例传输到另一个aws帐户的RDS mySQL实例的最佳方法是什么?

这是用于将Heroku上的网站转移给其他所有者。

2 个答案:

答案 0 :(得分:8)

如果它只是那么小,只需使用mysql客户端的mysqldump实用程序。

#note I'm piping it through GZip for compression. It will save you bandwidth
$ mysqldump -u user --password=passowrd -h your_rds_host db_name | gzip -c > db.sql.gz

#unzip the dump
$ gunzip db.sql.gz

#restore on the destination
$ mysql -u user --password=passowrd -h your_destination_rds_host db_name < db.sql

这应该可以解决问题。

答案 1 :(得分:2)

我有时使用MySQL客户端(Navicat),让您将数据从一个数据库迁移到另一个数据库。它支持DB结构,数据或两者的同步。非常方便。