DELIMITER $$
USE `mydb`$$
DROP TRIGGER /*!50032 IF EXISTS */ `update`$$
CREATE
/*!50017 DEFINER = 'root'@'localhost' */
TRIGGER `update` AFTER UPDATE
ON `users`
FOR EACH ROW BEGIN
UPDATE `users2` SET `users2`.`username` = new.username AND `users2`.`password` = new.password WHERE `users2`.`id` = new.id;
END;
$$
它不会产生任何错误,也不会产生任何错误。
答案 0 :(得分:1)
您的UPDATE
声明不正确。
从
更改UPDATE `users2` SET `users2`.`username` = new.username AND `users2`.`password` = new.password WHERE `users2`.`id` = new.id;
^^^
到
UPDATE `users2`
SET `username` = new.username, `password` = new.password
WHERE `users2`.`id` = new.id;