in reply to How to log SQL query execution in DBI

To do this from mysql, add

log = /path/to/logfile

to your mysql configuration file. Note that this slows down your queries a lot. If you just want to log long-running queries you can put

log-slow-queries=/path/to/logfile long_query_time=1

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan

Replies are listed 'Best First'.
Re^2: How to log SQL query execution in DBI
by arkturuz (Curate) on Nov 28, 2005 at 16:50 UTC
    Wow! I did not expect answers so fast :-)

    I read the DBI man page but I thought thar trace is not the thing I need. Now, I will try it.

    Thanks for answers!