我应该如何审核MySQL表中的更改(使用MySQL 4)? [英] How should I audit changes in a MySQL table (using MySQL 4)?

查看:78
本文介绍了我应该如何审核MySQL表中的更改(使用MySQL 4)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已要求我审核MySQL表中的任何/所有更改.有人知道有什么工具可以帮助我做到这一点吗?还是我需要编写自己的解决方案?

I have been asked to audit any/all changes in a MySQL table. Does anyone know of any tools out there to help me do this or do I need to write my own solution?

如果我编写自己的音频,我最初以为它可以构成一个单独的表并在PHP代码中构建一连串的更改.类似于"fieldname1-> oldvalue | fieldname2-> oldvalue,...".如果您发现此方法存在重大问题,请告诉我.

If I write my own audting, my initial thought it to make a separate table and build a string of changes in the PHP code. Something like "fieldname1 -> oldvalue | fieldname2 -> oldvalue, ...". If you see a major problem with this method, please let me know.

推荐答案

捕获数据库表所有更改的唯一可靠方法是使用服务器上的触发器.修改您自己的代码以审核更改的风险在于,将不会捕获来自其他应用程序/用户等的更改.

The only sure-fire way to capture all changes to a DB table is to use triggers on the Server. The risk of modifing your own code to audit the changes is that changes from another application/user etc will not be captured.

话虽如此,但我不确定MySQL 4是否具有触发器支持.

Having said that, I'm not sure that MySQL 4 had trigger support.

这篇关于我应该如何审核MySQL表中的更改(使用MySQL 4)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆