9

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

2 Answers2

9

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.

Dherik
  • 107
  • 6
Ross
  • 251
  • 2
  • 8
1

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.