Scenarios
TencentDB for MySQL does not modify any user data. Data corruption caused by user actions can be rolled back for restoration. The rollback feature enables restoration of databases or tables within the Tencent Cloud platform. Rollback utilizes data backups + log backups (binlog), allowing real-time data restoration.
TencentDB for MySQL rollback restores databases or tables to a specified point in time by leveraging periodic snapshots and real-time log reconstruction. This ensures a consistent point-in-time state for all data while maintaining uninterrupted access to the original databases or tables during the process. The rollback operation creates new databases or tables within the original instance. Upon completion, users can view both the original databases/tables and the newly created ones.
Feature Principles
Rollback is based on the most recent cold backup + corresponding binlog to restore to a specified point in time.
1. The cold backup system exports data from the MySQL secondary server to the cold backup system daily.
2. During rollback, first request a rollback instance from the rollback system. Then, export cold backup data from the cold backup system and import it into a temporary instance (different data is imported depending on the rollback method).
3. The rollback instance establishes a primary/secondary relationship with the MySQL primary instance, and specifies the point in time and database tables required for rollback.
4. The rolled-back database tables are copied over to the MySQL primary instance.
Feature Limits
Single-node cloud disk instances do not support rollback.
Rollback is only supported for primary instances and not available for read-only instances or disaster recovery instances.
Currently, only rollback of specified databases/tables is supported. The rolled-back databases/tables are written back to the source instance (and require renaming). Rollback of entire instances is not supported.
Rollback is supported for MySQL versions 5.6, 5.7, and 8.0, but not for version 5.5. It is recommended to upgrade MySQL 5.5 to a later version as soon as possible. For upgrade instructions, see Upgrading Database Engine Version. For database-level rollbacks, the following object types are not imported: foreign key constraints, check constraints, triggers, stored procedures, user views, and events.
Precautions
The current rollback time can be set with second-level precision. For millisecond-level rules: If the rollback time is set to 2025-08-05 23:59:59, the point in time 2025-08-05 23:59:59.000 and any later milliseconds are not included in the recovery scope.
The rollback feature is associated with the backup cycle time and retention period in automatic backup settings, providing rollback based on data backups + log backups (binlog) within the retention period and backup cycle time. For backup cycle settings, see Automatic Backup of MySQL Data. To ensure data security, set the backup cycle in automatic backup settings to back up MySQL at least twice a week. For yearly/monthly subscription instances that have not expired but whose account is in arrears, backup-related services will be degraded, and database rollback is prohibited. To perform rollback operations, please top up to maintain a positive account balance.
If the database/table to be rolled back does not exist or has been accidentally deleted, you must log in to the database to create the database/table before performing rollback using the console.
If the cold backup prior to the rollback does not contain that table, the disaster recovery process will fail.
The recoverable time for backups is calculated from the oldest valid physical backup or full logical backup relative to the current time. We recommend that you configure an appropriate backup retention period based on your actual business needs.
Operation Steps
1. Log in to the MySQL console. On the instance list, select one or more instances to be rolled back, choose More > Roll Back. Note:
If you only need to roll back a single instance, you can also go to the instance management page and click More > Roll Back in the upper-right corner.
A maximum of 5 rollback tasks can be initiated simultaneously under the same APPID.
2. On the rollback page, select the database/table to be rolled back, then click Next step: Set the rollback time and database table name.
Rollback method:
Fast mode: Import the full backup of the instance, and then roll back the selected databases/tables. This rollback mode has no limitation, but the rollback speed is slower.
Faster mode: Full backup + database-level binlog. If cross-database operations exist and the associated databases are not selected simultaneously, the rollback will fail.
Ultrafast mode: Full backup + table-level binlog. If cross-table operations exist and the associated tables are not selected simultaneously, the rollback will fail.
Note:
Currently, rollback is supported only for database and table names that consist of Chinese characters, digits, English letters, and special characters -.+=::@_/[ ]( )( ), or any combination of these, with a length between 1 and 60 characters. Rollback is not supported for database or table names that contain any other special characters.
In the specified database/table rollback mode, a maximum of 500 databases or tables can be rolled back simultaneously within the same instance.
If the rollback involves composite operations on other databases/tables during binlog execution, the SQL statements may fail.
If the table involves constraints such as foreign keys during binlog execution for rollback, the SQL statements may fail.
3. Set the database/table names after rollback and the rollback time, then click Roll Back.
Note:
Each instance can only set one rollback time.
Set the batch rollback time. All databases/tables will be based on this batch rollback time.
Set the individual table rollback time. Databases/tables will be rolled back based on their respectively set rollback times.
Database/table names after rollback only support English letters, digits, decimal points (.), hyphens (-), underscores (_), and $, with a maximum length of 64 characters.
4. After successful submission, return to the Operation Log > Rollback Log page to view the rollback progress. Click View Details to monitor rollback logs in real time.
5. After the rollback is completed, navigate to Database Management > Database List page to view the new databases/tables created by the rollback within the original instance.