我正在尝试在删除时创建一个mysql触发器,以便在历史记录表上写一条记录,但每次我都会收到错误:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 14
DELIMITER $$
USE `cedecapr_test`$$
CREATE
DEFINER=`root`@`localhost`
TRIGGER `mytable`.`users_delete`
BEFORE DELETE ON `mytable`.`users`
FOR EACH ROW
BEGIN
INSERT INTO `history_table_users`
VALUES
(
OLD.`username`
);
END$$
任何帮助将不胜感激。谢谢。