0

Like this question and it's answer: Is there a MySQL option/feature to track history of changes to records?

I have done a table history for another table which track changes like UPDATE, DELETE, INSERT. I made an application in C# that retrieves me from table_history into a text document what I need to know about the changes.

My question is: what can I do to track all database or I make a table_history for all tables in my database, not only for one, same for that link. I need to keep a log from the entire database.

Community
  • 1
  • 1
A. Dragos
  • 33
  • 2
  • 2
  • 10
  • 1
    Enable logging : http://stackoverflow.com/questions/303994/log-all-queries-in-mysql –  Jul 05 '16 at 07:35
  • It don't help me too much...I need a method that I can retrieve the information with an application to a text document. – A. Dragos Jul 05 '16 at 07:48
  • Usually I prefer to have a parallel table for each main table with suffix (Ie: Products, ProductsHistory). On the main table, an automatic Triggers copies the data that is bound to be changed, inserted or deleted into the History table (along with a datetime, the user that made the change and the kind of change applied) – Steve Jul 05 '16 at 08:56
  • Ok, I understand this, but if I have 100 tables and I need to track each table, it's not ok to have another 100 tableHistory and 300 triggers. It's good to have only one tableHistory for that 100 tables. But I can't find a solution for this... – A. Dragos Jul 05 '16 at 09:06
  • So in a single table you want to push all the changes made in the lifetime of your database? I don't think this could scale very well moreover if you need to retrieve data from this monster table (and not to speak about the work needed at the coding level for each of your 100 tables to update the history table) Of course if a thirdy party tool exist then .... However I am expressing opinions so I will stop here. – Steve Jul 05 '16 at 09:19

1 Answers1

0

Try Maxwell it is an Open source tool it will push all db changes to kafka you can later fetch from that topic

http://maxwells-daemon.io/

Mahesh Madushanka
  • 2,902
  • 2
  • 14
  • 28