All Products
Search
Document Center

ApsaraDB RDS:Restore an RDS MySQL physical backup to a self-managed database

Last Updated:Aug 26, 2026

Use Percona XtraBackup to restore a physical backup from ApsaraDB RDS for MySQL to a self-managed MySQL database.

Background

ApsaraDB RDS for MySQL supports restoring instance backups to a self-managed database. You can use various data restoration methods, such as restoring from a physical backup or a logical backup. For more information about selecting a data restoration method, see MySQL data restoration methods.

You can view the backup type of an instance in the ApsaraDB RDS console. In the left-side navigation pane, go to Backup and Restoration > Base Backups > Data Backup.

Note

If no physical backups exist, you must first create a manual backup. For instructions, see Manual backup.

Scenarios

You can restore a physical backup from your RDS for MySQL instance to a self-managed database if you no longer need the instance for an extended period, or if it has been released but you still have its physical backup file.

Prerequisites

  • Your RDS MySQL instance must meet the following requirements:

    • Major version: 8.0, 5.7, 5.6, or 5.5

    • Edition: High-availability Edition

    • Storage type: Premium Local SSDs

    Note
    • You can view this information on the Basic Information page of your instance.

    • You can download physical backup files only for instances that meet the preceding requirements. If your instance is a Basic Edition instance, see the FAQ in this topic.

  • The tables in your RDS instance must not be encrypted with TDE.

    Important
    • Encrypted tables can cause restoration errors. Perform a decryption operation first.

    • You can check the TDE status on the Data Security > TDE page of the instance in the RDS console.

  • Your RAM user must have permission to download backup files. For instructions, see Authorize a RAM user with read-only permissions to download backup files.

Limitations

Impacts

  • If you restore an RDS MySQL physical backup to a self-managed database that also runs other services, those services will become unavailable.

  • This restoration method restores data to a new database's data directory, leaving the original data on your self-managed database unaffected.

How it works

Restoring a physical backup involves the following steps:

  1. Perform a full physical backup of the database.

  2. Download the physical backup file to a local device and decompress it with the qpress tool.

  3. Use Percona XtraBackup to restore the decompressed backup files to the data directory of your self-managed database.

  4. Restart the database. You can then view the original RDS MySQL data in your self-managed database.

Notes

  • A backup download URL is valid for one hour. If the URL expires, refresh the page to get a new one.

  • Do not modify or delete the contents of the backup file. Otherwise, the file may become corrupted and unrestorable. If you need to modify the data, first restore the backup to a self-managed database.

Billing

  • If you create manual backups, monitor your backup storage usage. Backup storage exceeding the free quota incurs backup fees.

  • If your self-managed database is on-premises, you will download backup data over the Internet. You will incur Internet traffic fees if your download traffic exceeds the free quota.

    Note

    If your self-managed database is on an ECS instance in the same region and VPC as the RDS instance, downloading backup data via an internal address incurs no traffic fees.

Before you begin

Environment setup

  1. The commands in this topic are for CentOS 7.9 64-bit. Adapt them if you use a different Linux distribution.

  2. Deploy a self-managed MySQL database. Its major engine version must match that of your RDS MySQL instance. For example, both can be MySQL 8.0.

    Run the following command to check the major engine version of your self-managed MySQL database:

    mysql --version
  3. Find the configuration file path of your self-managed MySQL database.

    This topic uses the following example paths:

    • The path is /etc/my.cnf for MySQL 8.0 and 5.7.

    • The path is /usr/my.cnf for MySQL 5.6.

    • For MySQL 5.5, create the file by running the echo "[mysqld]" | sudo tee /etc/my.cnf command.

    Run the following command to find the configuration file path of your self-managed MySQL database.

    sudo find / -name my.cnf
    Note

    If the command returns a different path, use that path in the subsequent commands.

  4. Create a backup decompression directory, such as mysql_bkdata, to store the decompressed backup files.

    Run the following commands to create the backup decompression directory:

    sudo mkdir /var/mysql_bkdata
    sudo chown -R $USER:$USER /var/mysql_bkdata
    Note

    The $USER:$USER parameter uses an environment variable to get the current user and user group. You do not need to change it.

  5. Create a data directory, such as mysql_newdata. This directory stores the restored backup files that the database uses at startup.

    Run the following commands to create the data directory:

    sudo mkdir /var/mysql_newdata
    sudo chown -R $USER:$USER /var/mysql_newdata
    Note

    The $USER:$USER parameter in the preceding command uses an environment variable to get the current user and user group. You do not need to change it.

Tools

  1. Install the Percona XtraBackup backup and restore tool.

    MySQL 8.0

    For a MySQL 8.0 instance, download the correct version of the XtraBackup tool for your host environment, upload it to your server, and then install it. If you need to upload the file to an ECS instance, see Upload or download files.

    Important

    RDS MySQL 8.0 introduces new redo log types, which may cause compatibility issues with the open source version of Percona XtraBackup. Therefore, you must download the RDS-provided XtraBackup tool from the table below.

    Host environment

    Download

    Installation command

    Note

    This example assumes the tool is in the /Xtrabackup8.0 directory. Adjust the command for your actual download location.

    Linux 6 (x86_64)

    RDS XtraBackup 8.0 tool download

    sudo yum localinstall -y /XtraBackup8.0/t-rds-xtrabackup-80-8.0.31-20230817110455.alios6.x86_64

    Linux 7 (x86_64)

    RDS XtraBackup 8.0 tool download

    sudo yum localinstall -y /XtraBackup8.0/t-rds-xtrabackup-80-8.0.31-20230817110455.alios7.x86_64.rpm

    Linux 7 (ARM AArch64)

    RDS XtraBackup 8.0 tool download

    sudo yum localinstall -y /XtraBackup8.0/t-rds-xtrabackup-80-8.0.31-20230817110455.alios7.aarch64.rpm

    Linux 8 (ARM AArch64)

    RDS XtraBackup 8.0 tool download

    sudo yum localinstall -y /XtraBackup8.0/t-rds-xtrabackup-80-8.0.31-20230817110455.al8.aarch64.rpm
    Note

    After installation, the Percona XtraBackup executable file is located in the /u01/xtrabackup80/bin directory. By default, this directory path is not added to the PATH environment variable in Linux.

    To run Percona XtraBackup commands from any directory, you can use one of the following methods:

    • Specify the full path when running a Percona XtraBackup command. This topic uses this method in several commands. For example: /u01/xtrabackup80/bin/xtrabackup --xxxxxx.

    • Manually add the /u01/xtrabackup80/bin directory to the PATH environment variable.

    MySQL 5.7, 5.6, or 5.5

    For MySQL 5.7, 5.6, or 5.5 instances, download and install Percona XtraBackup 2.4.

    This topic uses Percona XtraBackup 2.4.28 as an example. The installation commands are as follows:

    wget https://downloads.percona.com/downloads/Percona-XtraBackup-2.4/Percona-XtraBackup-2.4.28/binary/redhat/7/x86_64/percona-xtrabackup-24-2.4.28-1.el7.x86_64.rpm
    sudo yum localinstall -y percona-xtrabackup-24-2.4.28-1.el7.x86_64.rpm
  2. Install the qpress decompression tool.

    ## Download the qpress tar package.
    wget "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20230406/flxd/qpress-11-linux-x64.tar"
    
    ## Extract the downloaded tar package.
    tar -xvf qpress-11-linux-x64.tar
    
    ## Grant execute permissions to the qpress file.
    sudo chmod 775 qpress
    
    ## Copy the qpress file to /usr/bin to make it globally accessible.
    sudo cp qpress /usr/bin

Step 1: Download the backup file

  1. Navigate to the RDS instance list, select a region, and then click the ID of the target instance.

  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Base Backups > Data backup tab, find the target physical backup and click Download instance backup in the Actions column.

  4. In the Download instance backup dialog box, copy the internal URL or public URL as needed.

    Important
    • If you use an internal URL, you can download the backup file only from a server in the same region and VPC. You cannot download the file from a server in a different region or in the classic network.

    • If you use a public URL to download the backup file, you are charged for internet traffic that exceeds the free quota. For more information, see Billing details.

    • The backup download URL is valid for one hour. If it expires, refresh the page to obtain the latest URL.

    • Do not modify or delete the content of the backup file. Otherwise, the file may become damaged and unrestorable. If you need to make modifications, restore the data to your self-managed database first.

  5. Log on to the Linux server that hosts your self-managed MySQL database and run the following command to download the physical backup.

    wget -c 'https://****.bak.rds.aliyuncs.com/****_xb.qp?****' -O test_xb.qp
    Note
    • Please replace https://****.bak.rds.aliyuncs.com/****_xb.qp?**** in the command above with the actual backup download address. After you download the backup file, save it promptly to prevent data leaks.

    • In this example, test_xb.qp is used as the filename. You can specify a custom filename, but the file extension must match the extension in the download URL.

      Currently, download URLs for RDS for MySQL backups use one of two file extension formats: _xb.qp or _qp.xb. You can check the download link to see which format your backup file uses.

    • The physical backup format of RDS for MySQL 5.5 is tar.gz.

Download FAQ

  • Q: Why does an error occur when I download a data file?

    A: When you use the wget -c 'https://****.bak.rds.aliyuncs.com/****_xb.qp?****' -O test_xb.qp command, enclose the download address in single quotation marks (') to help the program correctly identify the address and prevent errors.

Step 2: Decompress the backup file

Choose a command to decompress the backup package based on its file name extension.

Important

Refer to the Prerequisites section to install Percona XtraBackup and qpress, and then run the following commands.

xbstream package (_xb.qp extension)

When you run the following decompression command, replace test_xb.qp with your backup file name and /var/mysql_bkdata/ with the backup decompression path you created.

### MySQL 8.0
qpress -do  test_xb.qp | /u01/xtrabackup80/bin/xbstream -x -v -C /var/mysql_bkdata/

### MySQL 5.5/5.6/5.7
qpress -do  test_xb.qp | xbstream -x -v -C /var/mysql_bkdata/

xbstream package (_qp.xb extension)

When you execute the following decompression command, replace test_qp.xb with the name of your backup file and /var/mysql_bkdata/ with the decompression path that you created.

## Step 1: Unpack the file
cat test_qp.xb | xbstream -x -v -C /var/mysql_bkdata/

## Step 2: Decompress the file
### MySQL 5.5/5.6/5.7
innobackupex --decompress --remove-original /var/mysql_bkdata/

### MySQL 8.0
/u01/xtrabackup80/bin/xtrabackup --decompress --remove-original --target-dir=/var/mysql_bkdata/

tar package (.tar.gz extension)

When you run the following decompression command, replace test.tar.gz with your backup filename and /var/mysql_bkdata/ with the backup decompression path that you created.

tar -izxvf test.tar.gz -C /var/mysql_bkdata/

xbstream package (.xb.gz extension)

When you run the following decompression command, replace test.xb.gz with the name of your backup file and /var/mysql_bkdata/ with the decompression path that you created.

### MySQL 8.0
gzip -d -c test.xb.gz | /u01/xtrabackup80/bin/xbstream -x -v -C /var/mysql_bkdata/

### MySQL 5.5/5.6/5.7
gzip -d -c test.xb.gz | xbstream -x -v -C /var/mysql_bkdata/

Decompression FAQ

  • Q: What do I do if an error occurs when I decompress a downloaded backup file?

    A: Check the following items to troubleshoot the error:

    Confirm that the downloaded file is a physical backup file.

    Confirm that the saved compressed file has the correct file name suffix (the suffix must be the one from the URL, such as xb.qp, .tar.gz, .xb.gz, or _qp.xb).

    Use the correct decompression command for the file format.

    Common errors:

    • When you run the decompression command, the sh: qpress: command not found error is reported.

      Solution: See Prerequisites to make sure that the qpress tool is installed on your self-managed database server.

    • When decompressing an xbstream package with the _qp.xb extension, the innobackupex not found error occurs.

      Solution: See Prerequisites to make sure that Percona XtraBackup is installed on your self-managed database server.

    • The error can't change to dir to xx( errorcode:no such file or directory) is reported when you use the cat command to unpack an xbstream package file that has a _qp.xb suffix.

      Solution: This error indicates an incorrect file name or path. Verify the file name and path in your command.

Step 3: Restore data

Important

Before restoring the database, stop your self-managed database service.

You can use the ps -ef | grep '[m]ysql' command to check for mysql processes and use the sudo kill -9 <PID> command to terminate the process.

MySQL 8.0

  1. Prepare for restoration.

    /u01/xtrabackup80/bin/xtrabackup --defaults-file=/var/mysql_bkdata/backup-my.cnf  --prepare --target-dir=/var/mysql_bkdata/

    Parameters:

    Parameter

    Description

    --defaults-file

    Sets default MySQL options from a configuration file.

    An RDS MySQL backup file contains a configuration file named backup-my.cnf. This file is located in the backup decompression directory at /var/mysql_bkdata/.

    --prepare

    The prepare command for the XtraBackup tool.

    --target-dir

    Backup decompression directory/var/mysql_bkdata/.

  2. Modify the data directory (datadir) of your self-managed database.

    1. Edit the database configuration file.

      sudo vim /etc/my.cnf

      To find the path of the database configuration file, see Prerequisites.

    2. Press the i key to enter edit mode, and set the datadir parameter to /var/mysql_newdata.

      datadir = /var/mysql_newdata

      mysql_newdata is the new data directory for the self-managed database, which you created in the Prerequisites section.

    3. Grant permissions on the new data directory.

      chown -R mysql:mysql /var/mysql_newdata 
    4. Press the Esc key to exit edit mode, and enter :wq! to save and exit.

  3. Restore the data.

    sudo xtrabackup --defaults-file=/etc/my.cnf --copy-back --target-dir=/var/mysql_bkdata/

    Parameters:

    Parameter

    Description

    --defaults-file

    Obtain the target path for data restoration from the data directory (datadir) setting in the my.cnf file of the self-managed database.

    --copy-back

    The restore command for the XtraBackup tool.

    --target-dir

    The XtraBackup tool restores the data from the backup decompression directory, /var/mysql_bkdata/, to the data directory of the self-managed database.

MySQL 5.7

  1. Prepare for restoration.

    innobackupex --defaults-file=/var/mysql_bkdata/backup-my.cnf --apply-log /var/mysql_bkdata/

    Parameters:

    Parameter

    Description

    --defaults-file

    Sets default MySQL options from a configuration file.

    An RDS MySQL backup file contains a configuration file named backup-my.cnf located in the backup decompression directory: /var/mysql_bkdata/.

    --apply-log

    The prepare command for the XtraBackup tool.

    The command is followed by the directory for storing backup files, that is, the backup decompression directory /var/mysql_bkdata/.

  2. Modify the self-managed database configuration file my.cnf.

    1. Edit the database configuration file.

      sudo vim /etc/my.cnf

      To find the path of the database configuration file, see Prerequisites.

    2. Press the i key to enter edit mode and change the datadir parameter to /var/mysql_newdata.

      datadir = /var/mysql_newdata

      mysql_newdata is the new data directory for the self-managed database, which was created in the Preparations section.

    3. Add the following content to my.cnf.

      innodb_undo_tablespaces=2
      innodb_undo_directory=/var/mysql_newdata
      Important

      The value of the innodb_undo_tablespaces parameter must match the value in /var/mysql_bkdata/backup-my.cnf. You can run the cat /var/mysql_bkdata/backup-my.cnf | grep innodb_undo_tablespaces command to query the value.

    4. Press the Esc key to exit edit mode, and enter :wq! to save and exit.

  3. Restore the data.

    sudo innobackupex --defaults-file=/etc/my.cnf --copy-back /var/mysql_bkdata/

    Parameters:

    Parameter

    Description

    --defaults-file

    From the my.cnf file of the self-managed database, obtain the target path for data restoration, which is the specified data directory (datadir).

    --copy-back

    The restore command for the XtraBackup tool.

    The directory specified after this command is the backup decompression directory, such as /var/mysql_bkdata/, from which the XtraBackup tool restores data to the data directory of the self-managed database.

MySQL 5.6

  1. Prepare for restoration.

    innobackupex --defaults-file=/var/mysql_bkdata/backup-my.cnf --apply-log /var/mysql_bkdata/

    Parameters:

    Parameter

    Description

    --defaults-file

    Sets default MySQL options from a configuration file.

    An RDS MySQL backup file includes a configuration file named backup-my.cnf. This file is located in the backup decompression directory, /var/mysql_bkdata/.

    --apply-log

    The prepare command for the XtraBackup tool.

    After this command, specify the directory to store backup files: the backup decompression directory /var/mysql_bkdata/.

  2. Modify the data directory (datadir) of your self-managed database.

    1. Edit the database configuration file.

      sudo vim /usr/my.cnf

      To find the path of the database configuration file, see Prerequisites.

    2. Press the i key to enter edit mode and add the datadir parameter.

      datadir = /var/mysql_newdata

      mysql_newdata is the new data directory for the self-managed database, which you created in Preparations.

    3. Press the Esc key to exit edit mode, and then enter :wq! to save and exit.

  3. Restore the data.

    sudo innobackupex --defaults-file=/usr/my.cnf --copy-back /var/mysql_bkdata/

    Parameters:

    Parameter

    Description

    --defaults-file

    In the my.cnf file of the self-managed database, obtain the target path for data restoration from the data directory (datadir) parameter.

    --copy-back

    The restore command for the XtraBackup tool.

    This command specifies the directory that contains the backup files, which is the backup decompression directory /var/mysql_bkdata/. The XtraBackup tool restores the data from this directory to the data directory of the self-managed database.

MySQL 5.5

  1. Prepare for restoration.

    innobackupex --defaults-file=/var/mysql_bkdata/backup-my.cnf --apply-log /var/mysql_bkdata/

    Parameters:

    Parameter

    Description

    --defaults-file

    Sets default MySQL options from a configuration file.

    An RDS MySQL backup file contains a configuration file named backup-my.cnf. This file is located in the backup decompression directory, which is /var/mysql_bkdata/.

    --apply-log

    The prepare command for the XtraBackup tool.

    The command is followed by the directory for storing backup files, namely the backup decompression directory/var/mysql_bkdata/.

  2. Modify the self-managed database configuration file my.cnf.

    1. Edit the database configuration file.

      sudo vim /etc/my.cnf

      To find the path of the database configuration file, see Prerequisites.

    2. Press the i key to enter edit mode, and add the datadir parameter.

      datadir = /var/mysql_newdata

      mysql_newdata is the new data directory for the self-managed database, which was created in the Preparations section.

    3. Add the following content to my.cnf.

      innodb_log_file_size=1048576000
      Important

      The value of the innodb_log_file_size parameter must be the same as the value in /var/mysql_bkdata/backup-my.cnf. You can use the cat /var/mysql_bkdata/backup-my.cnf | grep innodb_log_file_size command to query the value.

    4. Press the Esc key to exit edit mode, and enter :wq! to save and exit.

  3. Restore the data.

    sudo innobackupex --defaults-file=/etc/my.cnf --copy-back /var/mysql_bkdata/

    Parameters:

    Parameter

    Description

    --defaults-file

    Obtain the target path for data restoration from the data directory (datadir) setting in the my.cnf file of your self-managed database.

    --copy-back

    The restore command for the XtraBackup tool.

    After this command, specify the backup decompression directory, such as /var/mysql_bkdata/, from which the XtraBackup tool restores data to the data directory of the self-managed database.

Restoration FAQ

  • Q: The system returns the error xtrabackup: Unknown error 3613. How can I resolve this?

    A: Update Percona XtraBackup to the latest version and try again.

  • Q: The system returns the error Original data directory /var/mysql_newdata is not empty!. What should I do?

    A: Use the sudo rm -rf /var/mysql_newdata/* command to clear the files in the folder, and then retry the restore operation.

  • Q: The system returns the error InnodDB: Encryption information in datafile: ./xxx.ibd can't be decrypted, please check if a keyring plugin is loaded and initialized successfully.. What should I do?

    Check whether TDE is enabled for your instance:

    • If TDE is enabled, check for encrypted tables. As described in Prerequisites, decrypt the encrypted tables by following the instructions in Configure Transparent Data Encryption (TDE), and then follow the instructions in this topic to restore the data.

    • If TDE is not enabled, make sure you have the correct version of Percona XtraBackup installed as described in Prerequisites.

  • Q: A downloaded backup file contains TDE-encrypted data, which causes the data restoration to fail. What is the solution?

    A: You cannot restore data from a downloaded encrypted backup file. Encrypted tables in an RDS instance cause restoration errors. As described in Prerequisites, decrypt the tables by following the instructions in Configure Transparent Data Encryption (TDE), create a new backup, and then restore the data again.

  • Q: How do I resolve the innobackupex: File 'undo001' not found (Errcode: 2 - No Such file or directory) error that occurs during a restore?

    A: The undo file is a system file that varies across database versions. Check whether your self-managed database has the same version as the ApsaraDB RDS for MySQL database.

Step 4: Start the database

MySQL 8.0 and 5.7

  1. (Optional) In the RDS for MySQL console, view the instance parameters to check the value of lower_case_table_names. If the value is 1, you need to modify the my.cnf configuration file of the self-managed database.

    1. Edit the database configuration file.

      sudo vim /etc/my.cnf

      To find the path of the database configuration file, see Prerequisites.

    2. Press i to enter edit mode, and add the following content.

      lower_case_table_names=1
    3. Press the Esc key to exit edit mode, and enter :wq! to save and exit.

  2. Grant permissions on the data directory.

    sudo chown -R mysql:mysql /var/mysql_newdata
  3. Run the following command to start the MySQL process.

    sudo mysqld --defaults-file=/etc/my.cnf --user=mysql --datadir=/var/mysql_newdata &

    Parameters:

    Parameter

    Description

    --defaults-file

    The path of the configuration file for the self-managed database. This topic uses /etc/my.cnf as an example. You can refer to Preparations to confirm the configuration file path of the database.

    --user

    The user that starts the database. The value is fixed as mysql.

    --datadir

    The data directory that the database uses is /var/mysql_newdata in this example. You can refer to Prerequisites to determine the data directory of your database.

MySQL 5.6

  1. (Optional) In the ApsaraDB RDS for MySQL console, view the instance parameters to check the value of lower_case_table_names. If the value is 1, you need to modify the my.cnf configuration file of the self-managed database.

    1. Edit the database configuration file.

      sudo vim /usr/my.cnf

      To find the path of the database configuration file, see Prerequisites.

    2. Press i to enter edit mode and add the following content.

      lower_case_table_names=1
    3. Press the Esc key to exit edit mode and enter :wq! to save and exit.

  2. Grant permissions on the data directory.

    sudo chown -R mysql:mysql /var/mysql_newdata
  3. Run the following command to start the MySQL process.

    sudo mysqld --defaults-file=/usr/my.cnf --user=mysql --datadir=/var/mysql_newdata &

    Parameter

    Description

    --defaults-file

    The configuration file path of the self-managed database. This topic uses /usr/my.cnf as an example. See Prerequisites to confirm the path.

    --user

    The user that starts the database. The value is fixed as mysql.

    --datadir

    The data directory used for database startup. This topic uses /var/mysql_newdata as an example. You can refer to Prerequisites to determine the data directory of the database.

MySQL 5.5

  1. Grant permissions on the data directory.

    sudo chown -R mysql:mysql /var/mysql_newdata
  2. Run the following command to start the MySQL process.

    sudo mysqld --defaults-file=/etc/my.cnf --user=mysql --datadir=/var/mysql_newdata &

    Parameter

    Description

    --defaults-file

    The path to the configuration file of the self-managed database. This topic uses /etc/my.cnf as an example. To confirm the path for your database, see Preparations.

    --user

    The user that starts the database. The value is fixed as mysql.

    --datadir

    The data directory is used to start the database. This topic uses /var/mysql_newdata as an example. You can refer to Prerequisites to confirm the data directory of your database.

Startup FAQ

  • Q: What causes the error mysqld: [ERROR] Failed to open required defaults file: /etc/my.cnf on an Ubuntu operating system, and how can I resolve it?

    A: This error is caused by the Ubuntu security program AppArmor. Use the apt install -y apparmor-utils and aa-complain /usr/sbin/mysqld commands to modify the AppArmor settings.

  • Q: After a restore is complete, what should you do if a self-managed database fails to start or you encounter the error 1105 Unknown error during use?

    A: Run the following SQL statements to change the database storage engine:

    USE mysql;
    ALTER TABLE proc engine=myisam;
    ALTER TABLE event engine=myisam;
    ALTER TABLE func engine=myisam;
    Note

    If you receive the error ERROR 1067 (42000): Invalid default value for 'modified', first execute the SET SQL_MODE='ALLOW_INVALID_DATES'; statement.

  • Q: What is the root password after the database is restored?

    A: The method to obtain the root password varies by version:

    • If your instance runs MySQL 5.7 or 8.0, the root password is the same as the root password of your self-managed database.

    • If your instance runs MySQL 5.5 or 5.6, you must reset the root password before you can use the database. For more information, see the official documentation.

  • Q: The error InnodDB: Assertion failure in thread 140xxx in file page0zip.ic xxx occurs during startup. How can I resolve this?

    A: This error may be caused by insufficient disk space. Try to expand the disk of your self-managed database server and then try again.

  • Q: How do I resolve the following errors that occur during startup: [ERROR] Failed to open the relay log xxx, [ERROR] Slave: Failed to initialize the master info xxx, or [ERROR] Failed to create or recover replication info repositories.?

    A: These errors occur because the RDS instance is configured for high availability (HA), but the local self-managed database does not use primary and secondary nodes. You can safely ignore these errors as they do not affect startup.

  • Q: How can I resolve the [ERROR] Data Dictionary initialization failed error that occurs during startup?

    A: This error may be caused by an incompatible operating system. The underlying operating system of ApsaraDB RDS is Linux. We recommend that you use a Linux-based operating system to restore the database, as using a different operating system may cause version compatibility issues.

  • Q: The sudo systemctl start mysqld command fails to start the local MySQL service. What should I do?

    A: This may be caused by SELinux being in Enforcing mode in Linux. You can run the getenforce command to check the current status of SELinux.

    • If this is a development or testing environment, we recommend that you change the SELinux mode to Permissive mode. Then, try to start MySQL by using sudo systemctl start mysqld.

    • For production environments, we recommend that you check the SELinux logs to determine the specific reason for the startup failure and then fix the SELinux policy based on this information.

Step 5: Connect and verify

  1. Run the following command to log on to the MySQL database and verify that the process started successfully.

    mysql -u -p
    Note
    • This logon command is used to verify that the restoration is successful. If you only need to view table data, make sure that the account has query permissions.

    • If you forget your account or password, pass the --skip-grant-tables parameter when you run the command to start the MySQL process. After the process starts, it skips the permission check and allows you to log on to the database without an account or password. After you successfully log on, you can reset your account and password.

  2. Run the following command to check whether the databases from the ApsaraDB RDS for MySQL instance exist.

    SHOW DATABASES;

Connection and verification FAQ

  • Q: After restoration, why are the time values in my data inconsistent with the local time, and how do I fix it?

    A: If the time zone of the self-managed database is different from that of the RDS instance, you must modify the time_zone parameter of the self-managed database to match that of the RDS instance. If the time_zone parameter of the RDS instance is set to system, check the region where the RDS instance is located and set the time_zone parameter of the self-managed database to the time zone of that region.

  • Q: I receive the error Access denied for user 'XXX' when connecting to a self-managed database. How can I resolve this?

    A: Verify that you are using the correct account and password from the original ApsaraDB RDS for MySQL instance.

  • Q: I forgot my password when connecting to the self-managed database. What should I do?

    A: If you forget your account or password, start the MySQL process with the --skip-grant-tables parameter. This action bypasses permission checks upon startup, allowing you to log in to the database without an account or password. Please note, using the --skip-grant-tables parameter is a security risk. You should change your account and password immediately after you log in.

  • Q: After connecting to the self-managed database, I can see only system databases or some of the databases. How do I handle this?

    A: Restart the database, and then connect using the root account or a high-privilege account from the original RDS instance to view the databases.

References

FAQ

Can I restore a downloaded RDS for MySQL backup to another RDS for MySQL instance?

No, this operation is not directly supported. To restore the data to another instance, you can use one of the following methods:

How can I restore data for a specific time range to a self-managed database?

You can download the log backup for the specified time range from the console and restore it to your self-managed database. For more information, see Download backups and Point-in-time recovery.

How do I back up data from an RDS for MySQL instance to a self-managed database?

How do I restore or migrate data from an RDS Basic Edition instance?

RDS Basic Edition instances support only snapshot backups. You can use one of the following methods:

Can I restore physical backups from multiple RDS for MySQL instances to a single self-managed database?

No, this is not supported. You must restore each physical backup to a separate self-managed database. After restoring the data, you can use DTS or mysqldump to consolidate the data. For more information, see Use DTS to migrate a self-managed MySQL database to an RDS for MySQL instance or Migrate MySQL data by using mysqldump.

If I create a privileged account on the source instance, will it retain its privileges after I restore a physical backup to a self-managed database?

Yes. The backup retains account permissions, and the restore operation does not change them.