All Products
Search
Document Center

Cloud Backup:Register an on-premises MySQL database

更新時間:Feb 19, 2024

Before you use Cloud Backup to back up a MySQL database deployed on an on-premises server, you must register the MySQL database in the Cloud Backup console.

Prerequisites

  • The preparations for database backup are completed. For more information, see Prepare for data backup.

  • The on-premises database server is connected to virtual private clouds (VPCs) by using virtual private networks (VPNs) or Express Connect circuits. One of the following CIDR blocks can be used for communication between the on-premises database server and Alibaba Cloud: 100.64.0.0/10, 100.64.0.0/11, and 100.96.0.0/11.

Procedure

  1. Log on to the Cloud Backup console.

  2. In the left-side navigation pane, choose Back Up > Database Backup.

  3. In the top navigation bar, select a region.

  4. On the Database Backup page, click the MySQL tab.

  5. On the Local Database Instance tab, click Register Database Instance.

  6. In the Add Client panel, install a Cloud Backup client as prompted.

    1. Download and decompress the Cloud Backup client for Linux.

      You can right-click the package to obtain the download link and use a command similar to wget to download the Cloud Backup client for Linux to the on-premises server.

      wget https://a-hbr-resource-shanghai.oss-cn-shanghai.aliyuncs.com/unibackup/hbr-uni-install-linux.tar.gz

      Run the tar command to decompress the Cloud Backup client for Linux.

      tar -zxvf hbr-uni-install-linux.tar.gz
    2. Log on to the on-premises server and run the command to activate the Cloud Backup client for Linux.

      You can obtain the following sample command from the Cloud Backup console:

      sudo ./client init local-uni --uniUserInfoToken "eyJ1cmwiOiJodHRwczovL2EtaGJyLXJlc291cmNlLWhhbmd6aG91Lm9zcy1jbi1oYW5nemhvdS1pbnRlcm5hbC5hbGl5dW5jcy5jb20vY2xpZW50L2luc3RhbGwvZGJhY2t1cF9hZ2VudC9saW51eDY0LzguMC4yOTI5Mi0xLjAyODU3NzYuZGJnLyIsImhvc3QiOiIxMDAuMTAzLjguMTE2IiwicG9ydCI6NjAzMDUsIm15c3FsQWdlbnQiOiJZZXMiLCJtc3NxbEFnZW50IjoiTm8iLCJvcmFjbGVBZ2VudCI6Ik5vIiwidmVyc2lvbiI6IjguMC4yOTI5Mi0xLjAyODU3NzYuZGJnIiwiYWNjZXNzS2V5IjoiMzI1OGE3NDJmNzU4ZmFjNmVhMGRhMjEwZDRiZjA5NjAiLCJ1c2VTc2wiOiJZZXMiLCJhZ2VudCI6Im15c3FsIiwidXNlclRva2VuIjoiMDVUR0IwNUUiLCJyZWdpb25JZCI6ImNuLWhhbmd6aG91Iiwic291cmNlVHlwZSI6Ik1ZU1FMIn0="

    After you register the MySQL database, Cloud Backup installs a backup client on each node of the MySQL database. On the Local Database Instance tab, you can view the installation status of the Cloud Backup client on each node of the MySQL database. You can also upgrade a Cloud Backup client based on your business requirements.

  7. Grant permissions to the backup account and reactivate the backup client.

    1. Return to the console. Find the database that you want to reactivate and choose More > Reactivate in the Actions column.

    2. In the Activate Instance dialog box, configure the parameters and click OK. The following table describes the parameters.

      Parameter

      Description

      Database Account

      The username of the database instance.

      The minimum permission set of the user is RELOAD, LOCK TABLES, REPLICATION, and PROCESS.

      Password

      The user password.

More operations

To delete a registered database, perform the following steps:

  1. Log on to the on-premises server and run the following command to uninstall the Cloud Backup client for Linux:

    • CentOS

      sudo rpm --erase "dbackup3-agent-mysql"
      sudo rpm --erase "dbackup3-agent"
      sudo rpm --erase "dbackup3-common"
    • Ubuntu

      sudo dpkg -r "dbackup3-agent-mysql" "dbackup3-agent" "dbackup3-common"
  2. On the Local Database Instance tab, find the MySQL database that you want to delete and choose More > Unregister Instance in the Actions column.

  3. In the dialog box that appears, click OK.

What to do next

Back up a MySQL database