As discussed earlier, MYSQL trigger can be implemented before or after the INSERT, UPDATE and DELETE events. Hence we can define 6 types of triggers, such as trigger before INSERT, trigger after INSERT, etc... Events such as REPLACE, LOAD DATA may use INSERT internally, hence they also trigger events.

The triggers should have unique name and should be in convention, as shown here:


Triggers are stored in /data/classicmodels/ directory. The file tablename.TRG maps trigger to corresponding table. The triggername.TRN file has trigger information. When a trigger has to be backuped up, these files have to be copied.