giip
SES Proposal
Aurora MySQLHighbinlogレプリケーションCDCパラメータAurora

How to Check and Configure binlog Retention in Aurora MySQL

Published 2026-08-13 · Updated 2026-08-13 · Last Verified 2026-08-13

Answer

Check Aurora MySQL's binlog retention time with `CALL mysql.rds_show_configuration;` and set it with `CALL mysql.rds_set_configuration('binlog retention hours', 24);`. The unit is hours; if it is `NULL` or 0, RDS purges binlogs early once it judges them unnecessary. For a setup where a consumer such as DMS CDC reads the binlog, set it long enough for the consumer to catch up even after an outage. Also check whether `binlog_format` is `ROW`.

Applicability of This Document

ProductAurora MySQL (MySQL-compatible edition)
Verified VersionsAurora MySQL 2.x (MySQL 5.7-compatible) / 3.x (MySQL 8.0-compatible). Whether `SHOW MASTER STATUS` is available varies by version — verify
EnvironmentAmazon Aurora (AWS)
Required Permissions`mysql.rds_set_configuration` requires RDS master-user-equivalent privileges. `SHOW BINARY LOGS` requires the `REPLICATION CLIENT` privilege
Execution ImpactNo impact from read-only checks. Changing the retention time is a configuration change; changing `binlog_format` involves a restart; `PURGE BINARY LOGS` deletes logs
RestartNot required to change the retention time. Changing `binlog_format` requires restarting the writer instance
Last Verified2026-08-13

Ready-to-Run Commands

Check the current binlog retention timeRead-only
対象
Aurora MySQL 2.x / 3.x
権限
Privilege to execute stored procedures (typically the master user)
変更作業
None (read-only)
Production実行
Possible
-- 対象: Aurora MySQL 2.x / 3.x
-- 権限: mysql スキーマのストアドプロシージャ実行権限(通常はマスターユーザー)
-- 変更作業: なし(参照のみ)
-- Production 実行: 可能
CALL mysql.rds_show_configuration;

The row where `name` is `binlog retention hours` is the retention time. A `NULL` value means no explicit setting, and RDS purges binlogs early once it judges them unnecessary. The same result set also includes other RDS settings.

Check the current binlog settingsRead-only
対象
Aurora MySQL 2.x / 3.x
権限
Connection privilege (read global variables)
変更作業
None (read-only)
Production実行
Possible
-- 対象: Aurora MySQL 2.x / 3.x
-- 権限: 接続権限(グローバル変数の参照のみ)
-- 変更作業: なし(参照のみ)
-- Production 実行: 可能
SELECT
    @@global.log_bin           AS log_bin_enabled,
    @@global.binlog_format     AS binlog_format,
    @@global.binlog_row_image  AS binlog_row_image,
    @@global.binlog_checksum   AS binlog_checksum;

In Aurora MySQL, setting `binlog_format` to anything other than `OFF` enables the binlog. DMS CDC and typical replication assume `ROW`. If `binlog_row_image` is `MINIMAL`, values for columns other than the changed ones are not recorded, which can leave out information the CDC side needs.

Check the existing binlog files and their positionsRead-only
対象
Aurora MySQL 2.x / 3.x (writer instance)
権限
`REPLICATION CLIENT` privilege
変更作業
None (read-only)
Production実行
Possible
-- 対象: Aurora MySQL 2.x / 3.x(ライターインスタンス)
-- 権限: REPLICATION CLIENT 権限
-- 変更作業: なし(参照のみ)
-- Production 実行: 可能

-- 1) 現存するbinlogファイルとサイズ
SHOW BINARY LOGS;

-- 2) 現在の書き込み位置(Aurora MySQL 3.x の一部バージョンでは
--    SHOW BINARY LOG STATUS に置き換えられているため、エラーになる場合はそちらを使う)
SHOW MASTER STATUS;

The total size in `SHOW BINARY LOGS` grows or shrinks with the retention setting. File names follow the `mysql-bin-changelog.NNNNNN` format on Aurora. `SHOW MASTER STATUS` has been renamed in newer MySQL 8.0-series versions, so check whether it works in your own environment (unverified).

Set the binlog retention timeHigh
対象
Aurora MySQL 2.x / 3.x
権限
RDS master-user-equivalent privileges (cannot be run by a regular application user)
変更作業
Yes (changes the binlog retention policy)
Production実行
Possible, but estimate the storage increase beforehand
-- 対象: Aurora MySQL 2.x / 3.x
-- 権限: RDSのマスターユーザー相当(一般ユーザーではアクセス拒否になる)
-- 変更作業: あり(binlog の保持時間ポリシーを変更する)
-- Production 実行: 可能。ただしストレージ消費が増えるため事前に見積もること

-- 保持時間は「時間」単位で指定する(例: 24時間)
CALL mysql.rds_set_configuration('binlog retention hours', 24);

-- 設定後の値を確認する
CALL mysql.rds_show_configuration;

-- 明示設定を解除して既定の挙動(早期削除)に戻す場合
-- CALL mysql.rds_set_configuration('binlog retention hours', NULL);

The second argument is a number of hours, not days. Setting it to `NULL` clears the explicit setting and returns to RDS deleting binlogs once it judges them unnecessary. Right after shortening the setting, a CDC consumer that hasn't finished reading yet may be unable to catch up, so check the consumer's lag before shortening it.

Change binlog_format to ROW (requires a restart)High
対象
Aurora MySQL (DB cluster parameter group)
権限
IAM: `rds:ModifyDBClusterParameterGroup`, `rds:RebootDBInstance`
変更作業
Yes (cluster parameter change + writer instance restart)
Production実行
Not possible due to the restart involved. Plan execution during a maintenance window
# 対象: Aurora MySQL(DBクラスターパラメータグループ)
# 権限: IAM rds:ModifyDBClusterParameterGroup, rds:RebootDBInstance
# 変更作業: あり(クラスターパラメータ変更 + ライターインスタンス再起動)
# Production 実行: 不可(再起動を伴うためメンテナンス時間帯に計画実行)

# 1) 現在値と反映方法を確認する
aws rds describe-db-cluster-parameters \
  --db-cluster-parameter-group-name example-aurora-mysql-cluster-params \
  --query "Parameters[?ParameterName=='binlog_format' || ParameterName=='binlog_row_image'].{Name:ParameterName,Value:ParameterValue,Apply:ApplyType}" \
  --output table

# 2) binlog_format を ROW に変更する(クラスター単位のパラメータ)
aws rds modify-db-cluster-parameter-group \
  --db-cluster-parameter-group-name example-aurora-mysql-cluster-params \
  --parameters '[
    {"ParameterName":"binlog_format","ParameterValue":"ROW","ApplyMethod":"pending-reboot"}
  ]'

# 3) ライターインスタンスを再起動して反映する(接続断が発生する)
aws rds reboot-db-instance --db-instance-identifier example-aurora-instance

`binlog_format` is a setting on the DB cluster parameter group side; you won't find it by looking in the instance-level DB parameter group. Applying it requires a restart and causes a connection drop. Enabling the binlog adds log-generation load to writes, but the magnitude depends on the workload, so measure it in a test environment beforehand (this article does not give a figure).

Manually delete old binlogs (last resort)High
対象
Aurora MySQL 2.x / 3.x (writer instance)
権限
`BINLOG_ADMIN` on MySQL 8.0-compatible, `SUPER`-equivalent on 5.7-compatible. The master user on RDS
変更作業
Yes (deletes binlog files; irreversible)
Production実行
Not allowed as a rule. Only after checking every consumer's read position
-- 対象: Aurora MySQL 2.x / 3.x(ライターインスタンス)
-- 権限: MySQL 8.0互換は BINLOG_ADMIN、5.7互換は SUPER 相当(RDSではマスターユーザー)
-- 変更作業: あり(binlog ファイルを削除する。削除したログは復元できない)
-- Production 実行: 原則不可。全ての消費側の読み取り位置を確認してからのみ実施する

-- 1) 先に消費側(レプリカ・DMS・CDC)がどこまで読んでいるかを確認する
SHOW BINARY LOGS;

-- 2) 指定ファイルより前のbinlogを削除する
PURGE BINARY LOGS TO 'mysql-bin-changelog.000123';

-- 3) 日時指定で削除する場合
-- PURGE BINARY LOGS BEFORE '2026-08-01 00:00:00';

Deleting a file that a consumer hasn't finished reading makes replication or CDC unrecoverable, requiring a restart from the initial load. On RDS / Aurora, binlog lifetime should in principle be managed via `binlog retention hours`; treat manual deletion only as a last resort when storage is critically short and there is no other option.

How to Read the Results

ColumnMeaningWhat to Check
name (rds_show_configuration)Setting nameLook for the `binlog retention hours` row
value (rds_show_configuration)Setting value (hours)If `NULL`, no explicit setting. Is it longer than the maximum acceptable outage time for CDC consumers?
description (rds_show_configuration)Description of the settingConfirms that the unit is hours
Log_name (SHOW BINARY LOGS)binlog file nameThe `mysql-bin-changelog.NNNNNN` format on Aurora. The oldest file marks the lower bound of retention
File_size (SHOW BINARY LOGS)File size (bytes)The total is the storage consumption. Estimate the total before extending the retention time
binlog_formatbinlog recording format`ROW` is required for DMS CDC and typical replication
binlog_row_imageRange of columns recorded in ROW formatWith `MINIMAL`, the CDC side may lack needed columns

When to Use This

  • A DMS CDC task stopped with an error along the lines of "binlog not found"
  • An external replica was paused and then resumed, but it could not catch up and errored out
  • After enabling the binlog, the cluster's storage usage keeps increasing
  • Running `CALL mysql.rds_set_configuration(...)` resulted in access denied
  • A DMS endpoint test shows a warning related to binlog settings

Possible Causes (Most Likely First)

  1. 01

    The retention time has no explicit setting

    If `binlog retention hours` is `NULL`, RDS purges binlogs early once it judges them unnecessary. If a CDC consumer pauses, the binlog it needs upon resuming may already be gone.

  2. 02

    The retention time is shorter than the consumer's downtime

    If the retention time is shorter than the time a consumer (a DMS task, an external replica) is down for maintenance or due to a failure, it cannot catch up on resume. The setting needs to be derived by working backward from the acceptable downtime.

  3. 03

    `binlog_format` is not set to `ROW`

    With `STATEMENT` or `MIXED`, the row-level change details that CDC needs cannot be obtained. On Aurora, this is configured in the cluster parameter group.

  4. 04

    The executing user lacks RDS master-user-equivalent privileges

    `mysql.rds_set_configuration` is a stored procedure provided by RDS, and running it requires master-user-equivalent privileges. A regular application user will get access denied.

  5. 05

    A manual `PURGE BINARY LOGS` deleted logs that were still needed

    Deleting a file that a consumer hasn't read yet makes recovery impossible. This is sometimes run as a stopgap when storage is tight and the problem only surfaces later.

  6. 06

    A failover switched the write target

    When the writer switches, how the consumer handles continuity of binlog file names and positions becomes an issue. Check the CDC side's resume method.

Diagnostic Steps

  1. 1

    Check the current retention time

    Read-only

    Run `CALL mysql.rds_show_configuration;` and check the value of `binlog retention hours`. This is read-only and safe.

  2. 2

    Check whether the binlog is enabled and in ROW format

    Read-only

    Check `@@global.log_bin` and `@@global.binlog_format`. Also check `binlog_row_image`.

  3. 3

    Check the range and total size of existing binlogs

    Read-only

    Use `SHOW BINARY LOGS` to see the oldest file and the total size. This can also be used to estimate before extending the retention time.

  4. 4

    Check the consumer's read position and lag

    Read-only

    For DMS, check the task's CDC lag metric; for an external replica, check the replica's status to see how far it has read.

  5. 5

    Check the storage usage trend in CloudWatch

    Read-only

    Estimate the increase from extending the retention time based on the actual trend.

  6. 6

    Check the executing user's privileges

    Read-only

    Use `SHOW GRANTS;` to check whether the user can run `mysql.rds_set_configuration`.

Solutions

Low-risk action that can be done immediately

  • Set the retention time as the master user

    High

    If a regular user gets a privilege error, run it as the RDS master user. Changing the executing user is safer than granting broad privileges to a regular user.

  • Decide the needed retention time from the consumer's acceptable downtime

    Read-only

    Add up "how many hours it could be down for maintenance" and "how many hours recovery from a failure could take," and set a value longer than that.

Change requiring advance review

  • Add the binlog's storage consumption to what you monitor

    Read-only

    Extending the retention time makes the binlog consume that much more storage. Periodically check the total size in `SHOW BINARY LOGS` and the cluster's storage usage.

  • Monitor the lag of CDC consumers

    Read-only

    Setting up an alert as lag approaches the retention time lets you notice before the binlog disappears and recovery becomes impossible.

Change involving a restart or service impact

  • Change `binlog_format` to `ROW`

    High

    Change it in the cluster parameter group and restart the writer instance. Since this causes a connection drop, a planned outage is required.

  • Delete old logs with `PURGE BINARY LOGS`

    High

    Deleted logs cannot be restored. Only do this as a last resort, after checking every consumer's read position.

  • Re-establish CDC

    Expert Review Required

    If the binlog is gone and cannot be caught up on, it means starting over from the initial load. Decide the duration and cutover plan first.

!Warnings

  • The unit of `binlog retention hours` is hours. Setting a small value thinking it was days will leave CDC unable to catch up.
  • The longer the retention time, the more storage the binlog consumes. Estimate both the required length and the consumption before setting it.
  • `PURGE BINARY LOGS` cannot restore deleted logs. Do not run it without checking the read position of every consumer.
  • Changing `binlog_format` involves restarting the writer instance. It cannot be applied without downtime.
  • `mysql.rds_set_configuration` requires master-user-equivalent privileges. Avoid granting broad privileges to an application user just to avoid the permission error.
  • Enabling the binlog adds extra processing on the write side. Since the magnitude depends on the workload, this article does not give a figure — measure it in a test environment.

Differences by Version and Environment

Aurora MySQL 2.x (MySQL 5.7-compatible)Running `PURGE BINARY LOGS` requires `SUPER`-equivalent privileges. `SHOW MASTER STATUS` works as-is.
Aurora MySQL 3.x (MySQL 8.0-compatible)Binlog operation privileges are split into dynamic privileges such as `BINLOG_ADMIN`. `SHOW MASTER STATUS` may have been renamed in newer versions, so check whether it works in your own environment (unverified).
Distinguishing cluster parameters from instance parameters`binlog_format` lives in the DB cluster parameter group. You cannot configure it by looking in the instance-level DB parameter group.

If This Doesn't Resolve It

  • Check how the CDC consumer persists its resume position

    Check where DMS or a replica stores its read position and how it resumes after a failover.

  • Check the cluster's storage usage trend

    Isolate the growth factor including not just the binlog but also temporary space and snapshots.

  • Sort out the relationship with the backup retention period

    Binlog retention and backup retention are separate settings. Clarify which one covers which recovery requirement.

  • Check how the master user is managed

    Without a defined procedure for storing and using the master user credentials, you may not be able to change settings when needed.

  • Build a list of consumers that read the binlog

    Identifying what depends on the binlog — DMS, external replicas, change-notification mechanisms, etc. — speeds up decisions about the retention time.

Basis and Limitations of This Document

Explanation based on official product documentation

Based on the Amazon RDS / Aurora administrative stored procedures `mysql.rds_show_configuration` / `mysql.rds_set_configuration`, MySQL's binary-log-related system variables (`log_bin`, `binlog_format`, `binlog_row_image`), the public specifications of `SHOW BINARY LOGS` / `PURGE BINARY LOGS`, and the public specifications of Aurora's DB cluster parameter groups. Recommended retention values and the performance impact of enabling the binlog are not stated because they are environment-dependent.

FAQ

Where can I check the binlog retention time?

Run `CALL mysql.rds_show_configuration;` and look at the `binlog retention hours` row. If the value is `NULL`, there is no explicit setting, and binlogs are deleted as soon as RDS judges them unnecessary.

Why does rds_set_configuration give a permission error?

`mysql.rds_set_configuration` is an administrative stored procedure provided by RDS, and running it requires master-user-equivalent privileges. A regular application user will get access denied. Run it as the master user rather than adding privileges to a regular user.

Can this be run in production?

The read-only checks (`rds_show_configuration`, `SHOW BINARY LOGS`, reading global variables) can be run in production. Changing the retention time increases storage consumption and needs an estimate first; changing `binlog_format` involves a restart and needs a planned outage. As a rule, do not run `PURGE BINARY LOGS` in production.

How long should the retention time be set to?

Rather than a generic recommended value, derive it from the acceptable downtime of consumers. Estimate "the maximum time it could take to recover after CDC stops" and set a value comfortably longer than that. The longer it is, the more storage it consumes.

Is a restart required to change binlog_format?

Yes. `binlog_format` is a DB cluster parameter group setting, and applying it requires restarting the writer instance. Since this causes a connection drop, carry it out during a maintenance window.

How should the results be interpreted?

If `binlog retention hours` is shorter than the consumer's maximum downtime, the setting is insufficient. If the timestamp of the oldest file in `SHOW BINARY LOGS` is newer than the consumer's read position, it has already fallen too far behind to catch up. In that case, a setting change will not fix it — it requires starting over from the initial load.

Questions This Document Covers

  • Getting a permission error on rds_set_configuration
  • DMS CDC says it cannot find the binlog
  • Want to enable the binlog in Aurora MySQL
  • The binlog is putting pressure on storage

What the Risk Labels Mean

  • Read-onlyDoes not change data or settings.
  • LowImpact is limited, but permissions and load should be checked.
  • MediumMay affect performance, locking, or cost.
  • HighMay cause an outage, data loss, or require recovery work.
  • Expert Review RequiredRequires a separate review before applying to production.

GIIP's Scope of Support

binlog retention tends to become a "set it once and forget it" setting, but in practice its appropriateness changes every time the CDC consumer configuration changes. GIIP tracks the retention setting, the total size of existing binlogs, and the CDC-side lag on the same screen, and notifies as soon as the lag approaches the retention time. Irreversible operations such as deleting binlogs or changing `binlog_format` are excluded from automation and are designed to always require human approval.

Author & Technical Review

GIIP Production Operations Team

About 30 years of experience in designing, migrating, and operating large-scale web services, SQL Server, Oracle, AWS, and Azure. Experience includes 12 sets of x12large-class AWS RDS for SQL Server environments, an Oracle environment with roughly 120,000 tables, and migrating roughly 3TB from TiDB to Aurora MySQL. AI agents and human experts currently continue to monitor and operate multiple cloud databases and about 30 web services.

Related Knowledge

Related Services

Request a review of binlog retention and the CDC setup

If you need to repeat the same checks across multiple environments, we can discuss your entire operations setup.

Request a review of binlog retention and the CDC setup

← Back to Knowledge Base