All Products
Search
Document Center

Cloud Backup:Before you begin

Last Updated:Nov 28, 2024

You can use Cloud Backup to back up MySQL databases that are deployed on Elastic Compute Service (ECS) instances or on your on-premises servers. You can also restore these databases based on your business requirements. This topic describes the preparations that you must make before you back up a MySQL database.

Step 1: Obtain the username and password

  1. Install Cloud Assistant Agent on the ECS instance that hosts the database. This step is required if the database that you want to back up is deployed on an ECS instance.

    A Cloud Backup client for ECS must be used together with Cloud Assistant.

    • If you purchased the ECS instance before December 1, 2017, you must manually install Cloud Assistant Agent. For more information, see Install Cloud Assistant Agent.

    • If you purchased the ECS instance on or after December 1, 2017, Cloud Assistant Agent is pre-installed.

  2. Obtain the username and password that you use to log on to the MySQL database.

Step 2: Create a backup account and configure permissions

If you do not have a username and password for database backup, we recommend that you contact the administrator to create a backup account. The minimum permission set of the backup account is RELOAD, LOCK TABLES, REPLICATION, and PROCESS. For example, you can perform the following steps to create a backup account named backupadmin and grant permissions to the account.

  1. Log on to your MySQL database.

    mysql -u root -p 'password'
  2. Create a backup account named backupadmin.

    CREATE USER 'backupadmin' IDENTIFIED BY 'password';
  3. Grant permissions to the backup account.

    After you create the backup account, you must grant the access permissions on the database to the account. In the following sample code, *.* indicates all databases and tables. You can specify databases and tables based on your business requirements.

    GRANT RELOAD,LOCK TABLES,REPLICATION,PROCESS ON *.* TO 'backupadmin'@'%' ;
  4. Refresh the permissions.

    After you grant the permissions, you must refresh the permissions for them to take effect immediately.

    FLUSH PRIVILEGES;

What to do next

Register an ECS-hosted MySQL database or Register an on-premises MySQL database.