Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from superuser.com Dec 7 '09 at 14:15

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

2 Answers 2

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: http://www.ossec.net Configuring MySQL Logging: http://www.ossec.net/wiki/SQL%5FLogging#MySQL%5FLogging

share|improve this answer

Your Answer

 
discard

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