Nil23
Nil23

Reputation: 377

How to audit log the query in mysql

How to log the Audit log for activity happening on Mysql server. I want to log precise query like Delete, Insert, update, drop, truncate etc.

Please help if anybody has solution for this requirement.

Upvotes: 0

Views: 2590

Answers (1)

davethecoder
davethecoder

Reputation: 3932

what you need is the 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.

Upvotes: 1

Related Questions