DELIMITER $$
USE `db_test`$$
DROP TRIGGER /*!50032 IF EXISTS */ `tt`$$
CREATE
/*!50017 DEFINER = ‘root’@’localhost’ */
TRIGGER `tt` BEFORE INSERT ON `tb_test`
FOR EACH ROW BEGIN
SET new.mon=120;
END;
$$
DELIMITER ;
逼格更高
DELIMITER $$
USE `db_test`$$
DROP TRIGGER /*!50032 IF EXISTS */ `tt`$$
CREATE
/*!50017 DEFINER = ‘root’@’localhost’ */
TRIGGER `tt` BEFORE INSERT ON `tb_test`
FOR EACH ROW BEGIN
SET new.mon=120;
END;
$$
DELIMITER ;