Dan Vande More wrote:
/* repost: considering I have no answers, is it safe to conclude it's not feasible?*/


I'd like to be able to audit connections to mysql databases. Here is what I'd like to see:

Who connected to the server.
What IP did they come from.
When they disconnected.
Any permission denied errors they may have had.

The only thing that comes close to that is the general log, which is
quite a bit of overhead.

Has anyone come up with a solution for this?
Does anyone see this in future versions?

I've attempted the general query log, but it's not really in the best
format for generating reports. Additionally, it's quite bloated when you
do 300q/s. I've tried pushing it to a fifo, so I can have a daemon get the
information, but mysql doesn't support that either.
(my.cnf:log=/var/log/mysql.fifo) or (my.cnf:log=|/var/log/mysql.fifo, like syslog.conf)


Has anyone else found solutions for this?

Without source modifications, your current solution is as good as it gets.


However, a fairly simple source change could give you want you need. In sql/mysqld.cc initialize what_to_log to ((1L << (uint)COM_CONNECT) & (1L << (uint)COM_QUIT)) instead of ~(1L << (uint) COM_TIME), recompile, and the run with --log - it will log only connects and disconnects. With a little bit more work, you can make it more configurable if desired.


-- Sasha Pachev Create online surveys at http://www.surveyz.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to