如何将数据库从Amazon RDS MySQL实例导出到本地实例? [英] How to export database from Amazon RDS MySQL instance to local instance?

查看:115
本文介绍了如何将数据库从Amazon RDS MySQL实例导出到本地实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AWS文档具有此页面,其中涉及导入和导出来自MySQL服务器的数据,但主要与导入有关.我在他们的文档中唯一看到的是使用复制导出5.6数据的方法,该方法记录在

AWS documentation has this page that talks about importing and exporting data from MySQL server, but it's mostly about import. The only thing I see in their documentation is a way to export 5.6 data using replication, which is documented here. I was wondering if there is a simpler way to export data using mysqldump and load in local database. The database that I want to export is not huge, may be 1GB, so size is not a issue.

推荐答案

可以.

从远程RDS服务器中获取转储:

Take the dump from the remote RDS Server:

mysqldump -h rds.host.name -u remote_user_name -p remote_db > dump.sql

在提示您输入密码时,请提供user = remote_user_name(远程服务器)的密码

When prompted for password, provide the password for user=remote_user_name (remote server)

将其上传到本地mySql实例:

Upload it to your local mySql instance:

mysql -u local_user_name -p local_db < dump.sql

此外,如果您在同一地区拥有一台 ec2 服务器,我建议在那里进行转储.压缩文件,然后 scp 到您的本地计算机.通常,文件的压缩版本会小得多,您可以更快地进行传输.

Also, if you own an ec2 server in the same region, I'd suggest take a dump there. zip the file and then scp it to your local machine. Typically, the compressed version of the file would be much smaller and you'd be able to transfer it quicker.

这篇关于如何将数据库从Amazon RDS MySQL实例导出到本地实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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