原創:轉載需註明原創地址 https://www.cnblogs.com/fanerwei222/p/11776726.html
MySQL觸發器html
建立一個觸發器-->當stu_user表任意一行有插入操做以前,都將執行begin和end之間的操做,before能夠換成after, insert能夠換成udpate, delete CREATE TRIGGER dog BEFORE INSERT ON stu_user FOR EACH ROW BEGIN INSERT INTO class_user values( 1, 'hello' ); END; 刪除觸發器 DROP TRIGGER IF EXISTS dog 查看觸發器 SHOW TRIGGERS;