error in your SQL syntax creating MySQL trigger

前端 未结 3 1506
生来不讨喜
生来不讨喜 2021-01-12 14:03

I try create trigger

CREATE TRIGGER `aster_users2` after
update ON `aster_users` FOR EACH ROW
BEGIN  update event set flag=1 where
id=1; END;
3条回答
  •  臣服心动
    2021-01-12 14:33

    Try removing the semi-colons from your statements.

    If you'd like to keep your semi-colons,

    DELIMITER $$
    CREATE TRIGGER `aster_users2` after
    update ON `aster_users` FOR EACH ROW
    BEGIN  update event set flag=1 where
    id=1;  
     END$$
    DELIMITER ;
    

提交回复
热议问题