TAGS :Viewed: 9 - Published at: a few seconds ago

[ How to view the contents of a database in AWS RDS? ]

I have a small mysql RDS database associated with an Elastic Beanstalk python application. I'd like to view the contents of the database and download its contents onto my local machine. How can I do this? Can I also edit the database?

Answer 1

To view the contents, you can access the database via dbshell (More documentation here)

$> python manage.py dbshell #This would be pulled from the settings file

To download the contents, it is not django specific. In the command line, you can do

mysqldump --user=<user> --password=<password> --host=<rds host> database_name > <database_name>.sql

Documentation on mysqldump

and to load to a local database:

mysql -u <user> -p -h localhost <database_name> < <database_name>.sql