Find out which tables were affected by Triggers
Question
In MySQL (particularly InnoDB) is there any way to know which tables were affected (updated / deleted rows) by CASCADE UPDATES / DELETES or regular triggers?
Solution
Show the cascades and constraints:
mysql> SHOW CREATE TABLE tablename;
Show triggers:
mysql> USE dbname;
mysql> show triggers;
OTHER TIPS
As far as I know, there's no built-in solution for that. If you want to know which triggers have been fired you'll have to call your own logging functions from the triggers themselves. As for cascaded UPDATE/DELETE, they don't fire triggers so short of digging through the binlog I don't see how you can know which rows have been UPDATEd or DELETEd.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow