How to Fix MySQL Error 4113 (ER_DA_EXPIRE_LOGS_DAYS_IGNORED)
You trigger mysql error 4113 when you use two conflicting binary log expiration timers together. To fix it, unset the older day-based timer and keep only the seconds-based timer. MySQL logs every change to binary log files for backups and replicas. These files grow fast and can fill up your disk space. The database engine deletes old logs based on a retention timer you set up. When you define both the legacy day timer and the modern second timer, MySQL warns you. It ignores the day timer and re
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You trigger mysql error 4113 when you use two conflicting binary log expiration timers together. To fix it, unset the older day-based timer and keep only the seconds-based timer.
MySQL logs every change to binary log files for backups and replicas. These files grow fast and can fill up your disk space. The database engine deletes old logs based on a retention timer you set up. When you define both the legacy day timer and the modern second timer, MySQL warns you. It ignores the day timer and returns symbol ER_DA_EXPIRE_LOGS_DAYS_IGNORED with SQLSTATE HY000.
What causes mysql error 4113 in your database
Older MySQL releases measured binary log cleanup time in whole days. Newer releases measure this cleanup window in seconds for finer control. The official error message states that these two options cannot work together. If both options have non-zero values, the server blocks the change or ignores the day setting.
This problem often shows up during version upgrades or server migrations. A team might add the new seconds timer to a startup file. If the old days timer stays in that file, the conflict starts right away. It also happens when an admin tries to change one timer on a running server. MySQL refuses the change until you reset the other timer to zero first.
How to check your active binary log timers
Before you change anything, check which timers are active on your server. Ask an authorized operator to read the current system variables in a read-only session. Look at both the day-based retention value and the seconds-based retention value. One of them will hold a positive number that blocks your new change.
You should also check your startup files and cloud parameter groups. Sometimes a runtime change works, but a bad startup file brings the error back after a reboot. Make sure your team tracks these settings in one clear place. Keeping startup files clean stops surprise warnings during future maintenance windows.
MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
How to fix the conflict safely in production
Fixing this error in production takes two small steps. First, set the legacy day-based retention timer to zero so it turns off. Second, set the seconds-based retention timer to your desired retention window. Once the day timer is zero, MySQL accepts changes to the seconds timer without throwing error 4113.
Be careful when you lower the log retention window on a busy cluster. Replicas need those binary logs to stay in sync with the primary server. If you purge logs too early, a slow replica can break and stop reading updates. Check that all replicas are caught up before you shorten the cleanup timer.
You also want to restrict who can run global system changes in production. Do not give full superuser roles to every developer just to check or fix log timers. Use scoped roles and approval rules for any session that alters server variables. Masking also helps when operators inspect system tables, as it rewrites emails and phone numbers in query results.
Add wire guardrails and masking beside MySQL
Database grants and TLS setup decide who can reach MySQL. Even so, an open session can run broad updates or read raw personal data from allowed tables. In practice, hoop.dev sits inline in the wire protocol beside the database as a sidecar for your MySQL. On every production query an agent or engineer sends, hoop.dev decides to pass, mask, block, or escalate it for human review.
With hoop.dev MySQL support, guardrails refuse bad queries before they run or hold risky calls for approval, while data masking rewrites matched sensitive values in result rows in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for GDPR, HIPAA, and PCI DSS programs. Read the docs and source on GitHub.
Frequently asked questions
Does mysql error 4113 stop the database from running?
No, this error acts as a warning or blocks a specific variable change. Your database keeps running and uses the seconds-based timer until you clear the old setting.
Which binary log expiration setting should my team keep?
Always keep the seconds-based expiration setting for your MySQL servers. The day-based setting is legacy and is removed in newer database versions.
Can changing log retention break database replication?
Yes, setting the timer too low can delete logs before a replica reads them. Always check replica lag before you shorten your binary log retention window.
Related guides
In this post