Help Center/ Data Replication Service/ Troubleshooting/ Solutions to Failed Check Items/ Database Parameters/ Checking Whether the expire_logs_days Value in the Source Database Is Correct
Updated on 2024-05-09 GMT+08:00

Checking Whether the expire_logs_days Value in the Source Database Is Correct

During MySQL migration, you can set expire_logs_days to change the binlog retention period. Set expire_logs_day to a proper value to ensure that the binlog does not expire before data transfer resumes. This ensures that services can be recovered after interruption.

Failure Cause

The expire_logs_days parameter of the source database is set to 0.

Handling Suggestion

  • If the source database is an RDS for MySQL DB instance, set expire_logs_days to a proper value by following the instructions provided in Setting a Local Retention Period for RDS for MySQL Binlogs.
  • If the source database is an on-premises MySQL database, perform the following steps:
    1. Log in to the server where the MySQL source database is located.
    2. Run the following command to check the configured binlog retention period:
      show variables like 'expire_logs_days';

      Or

      show variables like 'binlog_expire_logs_seconds';
    3. Manually modify the my.cnf configuration file and set the binlog retention period. The following uses three days as an example.
      expire_logs_days=3

      Or

      binlog_expire_logs_seconds=259200;
    4. After the modification, restart the source database during a non-service period.