每次创建触发器时,即使不使用系统表,也会出现以下错误。
ERROR 1465 (HY000): Triggers can not be created on system tables
这是我的样本测试
select * from student
-> ;
+------------+---------+------+---------+
| name | roll_no | dept | dept_no |
+------------+---------+------+---------+
| diya | xxzz50 | 5 | 20 |
roll_no是主键。
当我执行
时create trigger sample before delete on student for each row insert into temp values(roll_no,name);
我收到错误
ERROR 1465 (HY000): Triggers can not be created on system tables.
有人可以帮助我。我哪里错了?
答案 0 :(得分:2)
我认为你试图在默认的mysql
数据库中制作触发器??
您的表student
所在的数据库名称是什么?也许测试?
create trigger test.sample
before delete on student for each row insert into temp values(roll_no,name);
或......只是......
create trigger `whatever the name of your database is..?`.`sample`
before delete on student for each row insert into temp values(roll_no,name);