3

How can I programatically get a list of a particular mysql instance's binlogs? ie. the same information provided by

mysql> show binary logs;

update: version 5.6 / AWS Aurora preferred.

Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
  • 1
    What language in? What about `mysql -u... -p... -h... -e 'show binary logs'`? – PerlDuck Mar 08 '16 at 21:52
  • This will be good as a backup, I'm hoping for some kind of query I can make over a mysql connection. – Mark Harrison Mar 08 '16 at 21:53
  • What mysql version do you use? 5.7 has an option to actually [fetch the binlogs in their binary form](http://dev.mysql.com/doc/refman/5.7/en/mysqlbinlog-backup.html) from a [remote] server to a local filesystem. – PerlDuck Mar 08 '16 at 21:57
  • 1
    For `show binary logs` I would _try_ the same mechanism as with regular SELECTs in whatever language you use. It returns some kind of _table_ after all and perhaps you're lucky. – PerlDuck Mar 08 '16 at 22:05

0 Answers0