. Cascade Mode
Synchronize update/delete out a matching record of a child table when Update/delete records on the parent table
. Set Null method
Set the column of the matching record on the child table to NULL when the record is update/delete on the parent table
Note that the foreign key column of the child table cannot be not NULL
. No Action Mode
If there are matching records in the child table, the Update/delete action is not allowed for the parent table corresponding to the candidate key
. Restrict Way
Same no action, check foreign KEY constraints immediately
. Set default mode
When a parent table has a change, the child table sets the foreign key column to a default value but InnoDB does not recognize
Original not easy, turn from: http://blog.sina.com.cn/s/blog_91339bff0100ymc2.html
Cascade, NO ACTION, Restrict, set NULL in MySQL foreign key settings