mysql: Cant we create triggers on system tables?(mysql:我们不能在系统表上创建触发器吗?)
问题描述
我正在尝试通过在其上编写触发器来审核 mysql.user 表中的权限更改.
I am trying to audit the privilege changes in mysql.user table by writing a trigger on it.
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
现在,我在编写时遇到错误
Now, I am getting an error while writing like
ERROR 1465 (HY000): Triggers can not be created on system tables
我们可以在系统表上创建触发器吗,有什么解决办法吗,或者更高版本会支持它[> 5.1.61]?
Can we create a trigger on system tables, Is there any work around or it will be supported in higher versions[> 5.1.61] ?
提前致谢.
推荐答案
不,我们不能.即使我们最关心的权限是 all
和 super
No we can not. Even if we have the best concerned privileges are all
and super
查看 mySql 提供的(全部)和(超级)权限
尝试所有类型的权限后
grant super on *.* to root@localhost
grant all on *.* to root@localhost
我在不同的表上尝试过最简单的触发器 mysql.db
并得到相同的错误
I have tried simplest trigger on different tables mysql.db
and got same error
无法在系统表上创建触发器//请接受这一点残酷的事实
Triggers can not be created on system tables // Please accept this bitter truth
如果你发现任何地方都可以在系统表上创建触发器,那就错了
If you found anywhere that triggers can be created on system tables, simply that is wrong
这篇关于mysql:我们不能在系统表上创建触发器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:mysql:我们不能在系统表上创建触发器吗?


- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- SQL 临时表问题 2022-01-01