DELIMITER $
CREATE TRIGGER delete_test_uptongdb_user AFTER delete
ON reg_user FOR EACH ROW
BEGIN
delete from test_uptongdb.reg_user where id=old.id;
END$
DELIMITER $
CREATE TRIGGER add_lm_uptongdb_user AFTER insert
ON reg_user FOR EACH ROW
BEGIN
INSERT INTO `lm_uptongdb`.`reg_user`
(`id`,
`name`,
`mobilenumber`,
`loginaccount`,
`pwd`,
`weixin`,
`cdkey`,
`fingerdata`)
VALUES
(new.id,
new.name,
new.mobilenumber,
new.loginaccount,
new.pwd,
new.weixin,
new.cdkey,
new.fingerdata);
END$
DELIMITER $
CREATE TRIGGER update_lm_uptongdb_user AFTER update
ON reg_user FOR EACH ROW
BEGIN
UPDATE `lm_uptongdb`.`reg_user`
SET
`name` =new.name,
`mobilenumber` = new.mobilenumber,
`loginaccount` =new.loginaccount,
`pwd` = new.pwd,
`weixin` = new.weixin,
`cdkey` = new.cdkey,
`fingerdata` = new.fingerdata
WHERE `id` = old.id;
END$