All Products
Search
Document Center

Database Backup:Back up MySQL databases

Last Updated:Jan 24, 2024

Database Backup (DBS) allows you to physically back up MySQL databases in full backup, incremental backup, and binary log backup modes. This topic describes how to configure a backup schedule for MySQL databases to perform full backups and incremental backups for disaster recovery and data migration.

Prerequisites

  • The database to be backed up is a self-managed MySQL database that runs on a Linux operating system, and the database uses one of the following versions of MySQL engines: 8.0, 5.7, 5.6, and 5.5.

    Note
    • A self-managed MySQL database that uses MySQL 5.7, 5.6, or 5.5 supports the following Linux operating systems: Red Hat Enterprise Linux, CentOS, and Oracle Linux 6, 7, and 8.

    • A self-managed MySQL database that uses MySQL 8.0 supports the following Linux operating systems: Red Hat Enterprise Linux, CentOS, and Oracle Linux 7.

    • The minor version of a self-managed MySQL database that uses MySQL 8.0 can be Linux 8.0.34 or earlier.

  • A backup gateway is installed on the server on which the database to be backed up is deployed. For more information, see Install a backup gateway.

Create a backup schedule

For more information, see Create a backup schedule.

Note

When you purchase a backup schedule, set the Data Source Type parameter to MySQL and the Backup Method parameter to Physical Backup.

Configure the backup schedule

  1. Log on to the Database Backup (DBS) console.

  2. In the left-side navigation pane, click Backup Schedules. In the top navigation bar, select a region.

  3. On the Backup Schedules page, find the backup schedule that you want to configure and click Configure Backup Schedule in the Actions column.

  4. In the Configure Backup Source and Destination step, configure the backup source and destination, and click Next in the lower-right corner of the page.

    Section

    Parameter

    Description

    N/A

    Schedule Name

    The name of the backup schedule. DBS automatically generates a backup schedule name. We recommend that you enter a descriptive name that is easy to identify. Backup schedule names do not need to be unique.

    Backup Source Information

    Backup Mode

    The method that is used to back up data. By default, the backup method that you select when you purchase the backup schedule is used. In this example, Physical Backup is selected.

    Backup Type

    The type of the backup. Default value: Native physical backup.

    Instance Region

    The region in which the database that you want to back up resides. The Backup Gateways and database instance must reside in the same region.

    Backup Gateway

    The backup gateway that is installed to back up data. For more information, see Install a backup gateway.

    Database Type

    The type of the database that you want to back up. Default value: MySQL.

    Address

    The IP address of the server on which the database that you want to back up is deployed. Default value: 127.0.0.1.

    Port Number

    The number of the port that is used to connect to the database that you want to back up. Default value: 3306.

    Database Account

    The username of the account that is used to connect to the database that you want to back up. The account must have permissions to back up the database. For more information, see Account permissions.

    Password

    The password of the account that is used to connect to the database that you want to back up.

    Compliance warranty regarding cross-border data transfers

    Read and agree to the compliance commitment by selecting the check box.

    Backup Destination Information

    Backup Storage Type

    The type of storage that is used to store the backup data. Valid values:

    • DBS Storage (recommended): Backup data is stored in DBS without the need to create an Object Storage Service (OSS) bucket. You are charged based on the volume of your data that is stored in DBS. For more information about the billing method, see Storage fees.

    • OSS For User: You must create a bucket in the OSS console in advance. For more information, see Create buckets.

    Note
    • In this example, DBS Storage (recommended) is selected. If you select OSS For User, you must configure the OSS Bucket Name parameter. Only the Standard storage class is supported.

    • If the volume of data to be backed up is large, we recommend that you purchase subscription storage plans to offset fees. For more information, see Use storage plans. Storage plans are more cost-efficient than the pay-as-you-go billing method.

    OSS Bucket Name

    The name of the OSS bucket that you want to use to store data.

    Note

    This parameter is displayed only if you set the Backup Storage Type parameter to OSS For User.

    Storage Encryption

    Specifies whether to encrypt the backup data. Valid values:

    • Encrypted: recommended. DBS uses AES-256 to encrypt data.

      The server-side encryption feature is used in OSS. When you upload an object to OSS, OSS encrypts and stores the object. When you download the encrypted object from OSS, OSS decrypts the object and returns the decrypted object to you. For more information, see Server-side encryption.

    • Non-encrypted: The backup data is not encrypted.

  5. In the Edit Backup Objects step, Back Up Entire Instance is selected by default. Click Next.

    Note

    To perform a physical backup, you must back up the Back Up Entire Instance. In this case, the permissions and stored procedures are also backed up.

  6. In the Configure Backup Time step, configure the parameters that are described in the following table and click Next in the lower-right corner of the page.

    Parameter

    Description

    Full-scale Backup Frequency

    The frequency of the backup schedule. Valid values: Periodic Backup and Single Backup.

    Note

    If you select Periodic Backup, you must configure the Full Data Backup Recurrence, Start At, and Real-Time Transaction Log Backup parameters.

    Full Data Backup Recurrence

    The days of the week on which DBS runs the backup schedule. You can select one or more days of a week. Select at least one day of the week.

    Start At

    The start time of the backup. We recommend that you specify a point in time during off-peak hours. Example: 01:00.

    Note

    If a previous full data backup is not finished at the start time of the next backup, DBS skips the next backup.

    Incremental Backup

    Specifies whether to enable incremental backup.

    Note
    • This parameter is displayed only if you set the Full-scale Backup Frequency parameter to Periodic Backup.

    • If you enable incremental backup, make sure that the binary logging feature is enabled for the database that you want to back up.

    Maximum Concurrent Threads for Full Data Backup

    The maximum number of concurrent threads that are available for a full backup. You can configure this parameter to adjust the backup speed. For example, you can reduce the number of backup threads to minimize impacts on the database.

    Note

    The maximum number of actual concurrent threads varies based on backup schedule specifications. For more information, see How do I change the maximum backup speed?

    Read speed limit

    The limit on the disk I/O. You can specify the limit based on your business requirements. Default value: 0, which indicates that the disk I/O is not limited.

    Backup network speed limit

    The limit on the network bandwidth. You can specify the limit based on your business requirements. Default value: 0, which indicates that the network bandwidth is not limited.

    Incremental Backup Interval

    The interval at which incremental backup is performed. DBS performs incremental backup based on your configurations. If you set the interval to 10 minutes, DBS performs an incremental backup every 10 minutes.

    Note

    This parameter is displayed only if you set the Incremental backup parameter to Enable.

    Enable compression

    Specifies whether to enable compression during backup. Valid values:

    • Enable: recommended. Data is compressed during backup to reduce storage space.

    • Disable: Data is not compressed during backup.

    Compression algorithm

    The algorithm that is used to compress data. Valid values:

    • GZIP (default)

    • LZ4

    Note

    This parameter is displayed only if you set the Enable compression parameter to Enable.

  7. In the Edit Lifecycle step, configure the lifecycle for full backup data in the Configure Full Data Backup Lifecycle section.

    If you set the Incremental Backup parameter to Enable in Step 6, you must configure the lifecycle for incremental backup data. For more information about the lifecycle rules of backup data, see How do I manage the lifecycle rules of backup sets?

  8. After the preceding configurations are complete, click Precheck in the lower-right corner of the page.

  9. If the Precheck Passed message appears, click Start Task.

    MySQL物理备份预检查

    Note
    • If the state of the backup schedule changes to Running, the backup schedule takes effect.

    • If an exception or error occurs when you start the backup schedule, troubleshoot the exception or error at the earliest opportunity. For more information, see How do I fix errors for an abnormal backup schedule in DBS? If your issue persists after you use the solution that is provided in the preceding topic, contact technical support in the DBS DingTalk group (ID: 35585947).

References

  • In addition to full backup and incremental backup described in this topic, DBS supports binary log backup. You can use full backups, incremental backups, and binary log backups to restore a database to any point in time and achieve a recovery point objective (RPO) in seconds. For more information about how to enable the binary log backup feature, see Back up binary logs of a MySQL database.

  • After a database is backed up, you can view the backup schedule or restore the database. For more information, see View a backup schedule and Restore a MySQL database from a physical backup.

  • You can also call API operations to create a backup schedule, or to create, configure, and then start a backup schedule. For more information, see CreateBackupPlan or CreateAndStartBackupPlan.

  • You can modify the backup source and backup objects of a backup schedule. You can also modify the backup strategies of a backup schedule such as the backup time and backup retention policy. For more information, see Manage a backup plan.

  • You can check the fees that may be charged for a backup schedule. For more information, see Billing FAQ.

  • You can pause a backup schedule that you do not need to reduce costs. For more information, see Pause or start a backup schedule.