2

ALL,

Is there a way to watch for a schema changes in mySQL? Or I will have to continuously query information_schema tabes?

TIA!!

  • 1
    You can use general log to track all queries but it's expensive since it logs everything and the performance may degrade. Alternatively you can try audit log with comes with Enterprise edition. You can filter which to be logged. – James Nov 27 '19 at 4:57
  • @James, OK, thx. – Igor Nov 27 '19 at 5:36
  • 1
    Search for mysql cdc gave me this. Loads of links!, incl. this which seems to give every MySQL CDC tool there is. If I were you, I'd start by looking at Percona and MariaDB stuff - those guys are top-notch! If that doesn't work for you, I'd look at the Maxwell's daemon project (open sourced by Zendesk and actvie) and also Debezium (also active). Databus doesn't appear to be very active any more. – Vérace Nov 27 '19 at 13:25
  • Follow and read all the links. Then set up some tests for a chosen subset of systems. You will possibly be living with this solution for a long time - so you may as well get it right! The question I would ask myself is: "Is there anything that I really need to do that isn't done by Percona or MariaDB? If the answer is "no", then look no further! – Vérace Nov 27 '19 at 13:25
3

If you use standard MySQL or Percona Server (not RDS, for example), you will be able to use Percona Audit Plugin. You can configure it to only log ALTER TABLEs, DROP TABLEs, etc, see this page: https://www.percona.com/doc/percona-server/LATEST/management/audit_log_plugin.html#filtering-by-sql-command-type

MariaDB has its own plugin, with a very similar functionality to filter queries (it allows to only log DDL).

|improve this answer|||||

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.