All Products
Document Center

A tool to download backup files for apsaradb RDS for MySQL instances

Last Updated: Jul 22, 2020


This topic describes how to use the tool to download the backup file of RDS for MySQL to the local server. The time range can be customized.


Background information

Alibaba Cloud reminds you that:

  • When you perform operations that have risks, such as modifying instance configurations or data, check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • Before you modify the configurations and data of instances including but not limited to ECS and RDS instances, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted security information such as the logon account and password in the Alibaba Cloud Management console, we recommend that you modify such information in a timely manner.
  1. You must install the Python 2.7 environment and Python SDK RDS. For more information, see Python SDK for RDS usage.
  2. Check whether the local server can access the public IP address. If the RDS instance does not have an Internet address, see application for outer network address.
  3. Download the following script file to your local server.
  4. Run the following command to the script.
    python [$RDS_ID] [$Access_Key_ID] [$Access_Key_Secret] [$Backup_Dir]
    • [$RDS_ID]: indicates the ID of the destination RDS instance. You can check the ID on the basic information page of the destination RDS instance. Such as "rm-hp38xxxxxx2i07".
    • Access_Key_ID: specifies the accesskey ID of the RAM user. If you do not have a RAM user, you can create a RAM user.
    • Access_Key_Secret: specifies the accesskey secret of the RAM user.
    • Backup_Dir: specifies the directory used to store backups. Make sure that you have sufficient disk space to avoid download failures.
    • By default, you can download the backup files generated in the previous day. If you want to modify the time range, starttime and endtime the value of the variable.

    The following command output is displayed:


Application scope

  • ApsaraDB RDS for MySQL
    Note: This method is only applicable to Linux, Windows, and other systems that support Python 2.7.