编程技术网

关注微信公众号,定时推送前沿、专业、深度的编程技术资料。

 找回密码
 立即注册

QQ登录

只需一步,快速开始

极客时间

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

Sheetala Prasa mysql 2022-5-11 10:58 6人围观

腾讯云服务器
如何将数据库从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实例导出到本地实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程技术网(www.editcode.net)!

腾讯云服务器 阿里云服务器
关注微信
^