Create history record for every change in MySQL table - Audit trail; MySQL trigger

Here is a way of maintaining records of changes made to a table in your MySQL database using MySQL trigger.

Let us assume that we have a database called my_database, we also have a table called main_table, fields of this table are field1, field2, field3. We want history of changes made to this table into a table we call history_table. This has the same fields as main_table.