All Products
Search
Document Center

Cloud Backup:Back up a MySQL database

Last Updated:Sep 21, 2023

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

Prerequisites

A MySQL instance is registered. For more information, see Register an ECS-hosted MySQL database or Register an on-premises MySQL database.

Create a backup plan

After you register a MySQL instance, you must create a backup plan in the Cloud Backup console to back up the instance. To create a backup plan, perform the following steps:

  1. Log on to the Cloud Backup console.

  2. In the left-side navigation pane, choose Backup > Database Backup.
  3. In the top navigation bar, select a region.
  4. On the Database Backup page, click the MySQL tab.
  5. Click the ECS Database Instance or Local Database Instance tab.

  6. Find the MySQL instance for which you want to create a backup plan, and click Back Up in the Actions column.

  7. In the Create Backup Plan panel, perform the following steps:

    1. Set the backup parameters and click Next.

      1. Specify Plan Name.

      2. Select the MySQL instance that you want to back up.

    2. Configure the backup plan and click Next.

      Parameter

      Description

      Recommended Plan

      The recommended backup plan. Default value: Typical Plan.

      • Typical Plan: enables the Full Backup and Incremental Backup features.

      • Critical Application: enables the Full Backup, Incremental Backup, and Log Backup features.

      • Customize: enables a custom backup policy.

      Full Backup

      If you select Full Backup, all the database files in the operating system are backed up. However, you can restore the files to only the point in time at which the files are backed up.

      You can back up files immediately or at a specified point in time. You can also schedule periodic backups by hour, day, week, or month.

      Incremental Backup

      If you select Incremental Backup, all incremental database files in the operating system are backed up. However, you can restore the files to only the point in time at which the files are backed up.

      You can back up files immediately or at a specified point in time. You can also schedule periodic backups by hour, day, week, or month.

      Important
      • If your MySQL database (earlier than MySQL 5.5) uses the MyISAM engine, you cannot perform incremental backup for the database. In this case, Cloud Backup still performs full backups even if you select Cumulative Incremental Backup for this parameter.

      • To restore an incremental backup file, Cloud Backup must obtain the most recent full backup file. Therefore, the full backup file is not recycled until the incremental backup file expires. We recommend that you configure a reasonable backup cycle and expiration time. For more information, see How does Cloud Backup clear expired database backup files?

      Log Backup

      You can back up database logs at a regular interval.

      You can back up files immediately or at a specified point in time. You can also schedule periodic backups by hour, day, week, or month.

      Important

      To restore a log backup file, Cloud Backup must obtain the most recent full backup file. Therefore, the full backup file is not recycled until the log backup file expires. We recommend that you configure a reasonable backup cycle and expiration time. For more information, see How does Cloud Backup clear expired database backup files?

      Realtime Backup

      If you select Realtime Backup, database logs are backed up in real time.

      Before you enable real-time backup, you must complete a full backup. After real-time backup is enabled, database logs are continuously backed up. Therefore, the recovery point objective (RPO) of data backups can be reduced to seconds. During the free trial period, you can perform real-time backups free of charge. When the free trial period expires, you are charged for the storage usage of real-time backups. For more information, see Cloud Backup Pricing.

      Important

      You can create only one backup plan for a single MySQL instance if you enable real-time backup for the backup plan.

    3. Configure the backup settings and click Next.

      Parameter

      Description

      Concurrent Threads

      The number of concurrent threads that are used to back up files.

      Retry Time

      The time interval between two consecutive reconnection attempts if the database is disconnected during backup. Unit: minutes.

      Speed Limit

      The maximum size of data that is backed up per second. Unit: MB/s.

      Note

      The value 0 indicates that the backup speed is not limited.

    4. Configure a backup vault. Click OK.

      Important

      You can back up an instance to only one backup vault.

      Parameter

      Description

      Backup Vault

      The backup vault to which you want to store the backup data. Valid values:

      • Create Vault: If you select this option, specify a name for the backup vault in the Vault Name field. If you do not configure this parameter, a random name is specified.

      • Select Vault: If you select this option, select a backup vault from the Vault Name drop-down list.

      Important

      After a backup vault is created, you are charged for the backup vault regardless of whether backup data is generated. For more information, see Billing methods and billable items.

      To maximize the redundancy of your backup data, Cloud Backup uses ZRS-enabled backup vaults by default in regions that support ZRS-enabled backup vaults. If only LRS-enabled backup vaults are available in the region where the backup vaults are located, Cloud Backup uses LRS-enabled backup vaults. You do not need to manually select a backup vault type.

      Vault Name

      The name of the backup vault.

      Backup Retention Period

      The retention period of the backup data. Unit: days, weeks, months, or years.

      You can change the backup retention period on the Storage Vaults page. This change takes effect on all newly generated backup data in the backup vault.

      Important

      To restore an incremental backup file or log backup file, Cloud Backup must obtain the most recent full backup file. Therefore, the full backup file is not recycled until the incremental backup file or log backup file expires. We recommend that you configure a reasonable backup cycle and expiration time. For more information, see How does Cloud Backup clear expired database backup files?

Related operations

On the Backup Plan tab, find the backup plan. In the Actions column, you can click buttons to perform the following operations:

  • Modify a backup plan

    If a backup plan does not meet your requirements, you can click Edit to modify the backup plan.

  • Configure alerts

    You can choose More > Alert Settings in the Actions column and then select a backup alert policy. The following table describes the alert policies.

    Alert policy

    Description

    Disabled

    The backup client does not send alert notifications.

    Same as Backup Vault

    The backup client sends alert notifications based on the alert settings that are specified for the backup vault.

    Default

    The backup client sends alert notifications to the owner of the Alibaba Cloud account by using emails.

    Custom

    If you select this option, you must select one or more contacts or contact groups. Then, the backup client sends alert notifications to the selected contacts or contact groups.

  • Delete a backup plan

    If you delete a backup plan, all backup and restoration jobs that are being performed based on the backup plan are interrupted.

    To delete a backup plan, find the backup plan and choose More > Delete Backup in the Actions column.

What to do next

Restore a MySQL database