Score:1

How to get a local mysql dump of a specific AWS RDS Snapshot

kp flag

Hello I have a linux bastion host in AWS that I am able to SSH into. In the Bastion I am able to run a mysqldump command which makes a copy of an RDS instance. What I want to accomplish is being able to make a copy of a specific RDS snapshot. When I run the mysqldump command the copy is properly made but it returns the latest RDS data.

The original command I ran (which works) is something like:

mysqldump -u johnDoe -p -h my-rds-endpoint.rds.amazonaws.com --single-transaction <my-db-name> > /tmp/testData.sql

Is there a way to use this same command to return specific snapshot data. Sort of like:

mysqldump -u johnDoe -p -h <rds-snap-shot-arn-here> --single-transaction <my-db-name> > /tmp/testData.sql

Is this possibly using either the arn or the DB snapshot name?

Thank you.

Score:3
bm flag

Is there a way to use this same command to return specific snapshot data.

Answer: No, if you want to use mysqldump on the snapshot, you should create it as an instance first.

You can also restore it as an instance from CLI/API and wait until completed, after you get the db host, you could use mysqldump to that snapshot. Here is the reference : https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromSnapshot.html

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.