Help Center/ GaussDB(for MySQL)/ FAQs/ Log Management/ How Do I Change the Binlog Retention Period?
Updated on 2023-10-19 GMT+08:00

How Do I Change the Binlog Retention Period?

GaussDB(for MySQL) is compatible with the binlog_expire_logs_seconds parameter of community version 8.0. You can change binlog retention period using this parameter.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page, choose Database > GaussDB(for MySQL).
  4. On the Instances page, click the instance name to go to the Basic Information page.
  5. In the navigation pane on the left, choose Parameters. On the Parameters tab, search for the parameter log-bin and change its value to ON (indicating that binlog is enabled).
  6. On the Parameters tab, configure binlog_expire_logs_seconds.

    • When a new binlog file is generated, any existing binlog files that have expired will be deleted.
    • If no new binlog file is generated, historical binlog files will not be deleted even if they have expired. To delete binlog files manually, connect to the database and run flush logs; to forcibly generate a new binlog file.