如何记录Mysql服务器上发生的活动的审核日志。我想记录精确查询,如删除,插入,更新,删除,截断等。
如果有人有此要求的解决方案,请提供帮助。
答案 0 :(得分:1)
你需要的是BINary Bin Log:
http://dev.mysql.com/doc/refman/5.0/en/binary-log.html
The binary log is not used for statements such as SELECT or SHOW that do not modify data. To log all statements (for example, to identify a problem query), use the general query log. See Section 5.2.2, “The General Query Log”.
Running a server with binary logging enabled makes performance slightly slower. However, the benefits of the binary log in enabling you to set up replication and for restore operations generally outweigh this minor performance decrement.