Backing Up an External MySQL Database for TAS (AWS RDS)
search cancel

Backing Up an External MySQL Database for TAS (AWS RDS)

book

Article ID: 298059

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

When using an external database for TAS, the parameters to perform a mysql dump are slightly different compared to internal databases. If the correct parameters are not included, you will receive permission denied or unable to connect errors when running the mysql dump command.

The mysql dump commands below are specific to Amazon RDS MySQL DB instances.

Environment

Product Version: 2.8

Resolution

1. To connect to the mysql database to explore what database to backup:
mysql --host=$host --user=$user --password=$password
2. Once connected you can list all databases.
show databases;

3. To backup the particular database, run the mysqldump command to write the dump to a file.

For Linux, macOS, or Unix:
mysqldump -h source_MySQL_DB_instance_endpoint -u user -ppassword --port=3306 --single-transaction --routines --triggers --databases database database2 > path/rds-dump.sql

 

For Windows:
mysqldump -h source_MySQL_DB_instance_endpoint ^ -u user ^ -ppassword ^ --port=3306 ^ --single-transaction ^ --routines ^ --triggers ^ --databases database database2 > path\rds-dump.sql