Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?



share|improve this question

migrated from Dec 7 '09 at 14:15

This question came from our site for computer enthusiasts and power users.

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.

share|improve this answer

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: Configuring MySQL Logging:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.