I tried to retrieve my MySQL RDS binlogs in order to run manual "rollback" for some SQLs. Unfortunately, I noticed that only 2 binlogs for the last 30 minutes are available.

"call mysql.rds_show_configuration" provides "binlog retention hours | NULL".

I guess (because RDS provides ability to point-in-time restore between daily backups) that AWS RDS keeps its binlogs for 24 hours. But it seems that it's unavailable for the end user...

TIA, Vitay


You need to give it a value if you wish to preserve the binlogs:

call mysql.rds_set_configuration('binlog retention hours', 24);

Will cause the binlogs to be stored for 24 hours, for example.

  • This needs to be done on Master or Slave ?
    – RN.
    May 2 '18 at 21:43
  • Master. This tells the master to hold onto the log files for a longer period of time so disconnected or new slaves have more time to connect and catch up
    – Ross
    May 24 '18 at 23:45
  • Changing the value causes downtime? Mar 16 '20 at 22:00

The documentation page says "Amazon RDS normally purges a binary log as soon as possible". That's why Ross's answer says you must set a value. The NULL you saw effectively means 0, and the only reason you'd see a list of results when running show binary logs in mysql is that mysql is actively using that log. Unfortunately, I don't know what "actively" means exactly. In my experience they last for a few minutes at most with a continually but minimally used database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.