4

I want to an audit log for a particular user/connection and not the application itself. Anytime a client manually connects to the server with specific credentials, I want the query log, and binary log to be enabled.

Is this possible, how would I activate the log for only that user/connection while ignoring the statements run by the application?

Thanks,

Walter

2 Answers2

1

There aren't any options to control such granularity. The general query log is either on or off. The binary log can include or exclude particular databases, but that's all.

Possibly the best you can do to obtain this information is to parse the log files retroactively with tools like mysqlsla or mysql-log-filter. Beware though, as you might already be, that the general query log can be a cause of I/O contention in production environments.

Dan Carley
  • 25,617
  • 5
  • 53
  • 70
0

What I have done is to enable full logging and use OSSEC to filter/alert only on the things I am interested.

Link for OSSEC: http://www.ossec.net Configuring MySQL Logging: http://www.ossec.net/wiki/SQL_Logging#MySQL_Logging

sucuri
  • 2,867
  • 1
  • 23
  • 22