Logging from mysql only from certain applications

2006-09-19 Thread Markus Fischer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

we've enabled /var/log/mysql.log on our server (5.0.24a on Debian
testing). However I only want to log commands from certain application,
or better say, certain users.

When I look at some log output, it looks like this:

060919  9:53:38
15945 Connect [EMAIL PROTECTED] on
15945 Query   SET AUTOCOMMIT=0
15945 Init DB somedb
15945 Query   SELECT * FROM [...]
15945 Query   SELECT * FROM [..]
15945 Query   UPDATE [...]
15945 Query   COMMIT

The way I read this is that once I have a Connect command, the ID
before uniquely identifies all further SQL commands belonging to this
connection - to this mysql user.

Now what I need is something similar to tail -f but only for selected
connected user. We've so much going on the server that it's impossible
to look over all the data without a tool.

Before I re-invent the wheel I'ld like to know if there are tools/helper
like this available ... ?

thanks,
- - Markus
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFD6Py1nS0RcInK9ARAloJAJ4s/7ckWeE/s4VO92yVgeUebOrRKwCguCvZ
AlJvzmq1VVCCfGj2eIZ3oME=
=aqc3
-END PGP SIGNATURE-

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



Re: Logging from mysql only from certain applications

2006-09-19 Thread Markus Fischer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Markus Fischer wrote:
 Before I re-invent the wheel I'ld like to know if there are tools/helper
 like this available ... ?

Being impatient and in need of this I've written my own version. Maybe
it is valuable to others.

http://markus.fischer.name/lab/php/mysqltail.php.txt

Basic usage:

php mysqltail.php /var/log/mysql.log userToTrace

Stop application with usualy CTRL-C.

- - Markus
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFEAK01nS0RcInK9ARArYiAJ9MH9wGoolDEuU7mW+3O3SNg1XP+QCghjX6
wnLcE+Jb6rnJG/yBYO/W4eg=
=N5PM
-END PGP SIGNATURE-

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