我正在尝试通过在其上编写触发器来审核 mysql.user 表中的权限更改。
insert trigger: will capture who gave the new permissions and when
update trigger: will capture who changes the privileges from what[old privilege]
remove trigger: will capture who removed the privileges and what are they
现在,我在写 like 时遇到错误
ERROR 1465 (HY000): Triggers can not be created on system tables
我们可以在系统表上创建触发器吗?是否有任何解决方法,或者它会在更高版本[> 5.1.61]中得到支持?
提前致谢。
最佳答案
不,我们不能。即使我们最关心的权限是 all
和 super
See (All) and (Super) Privileges Provided by mySql
在尝试了所有类型的特权之后
grant super on *.* to root@localhost
grant all on *.* to root@localhost
我在不同的表 mysql.db
上尝试了最简单的触发器并得到了同样的错误
Triggers can not be created on system tables // Please accept this bitter truth
如果您发现任何地方都可以在系统表上创建触发器,那就错了
关于mysql:我们不能在系统表上创建触发器吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10346546/