Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
CREATE TRIGGER giveaccess AFTER INSERT ON `befree_user` FOR EACH ROW BEGIN INSERT INTO user_access(user_id) VALUES (NEW.user_id); END;
您需要定义另一个分隔符;
;
delimiter | CREATE TRIGGER giveaccess AFTER INSERT ON `befree_user` FOR EACH ROW BEGIN INSERT INTO user_access(user_id) VALUES (NEW.user_id); END; | delimiter ;
如果不是,数据库认为在第一个;语句完成后会抛出错误。