1. says

    Some time ago I had a need to temporary log successful connections without using regular log.
    I did it in the following way:

    Wrote UDF function which accepted 4 arguments: user(),current_user(),now(),connection_id().
    Results should be stored into the custom log file.
    Finally, defined init-connect to execute this UDF.

    PS. I almost don’t have users with SUPER privilege, so this way was worked fine for me.

  2. says

    One more avenue for tailing and searching slow queries, especially with more than one MySQL server, more than one person who cares, or queries that you need to find a day or two later:

    You can use MySQL’s native syslog support (5.1.20 and later) and send it through the system syslog daemon, or keep logging to a standalone log file with either the system syslogd or a transmitter like remote_syslog ( Papertrail gives you the remote syslog target.

    I operate it and the standard first thing that I suggest is a nightly email containing slow queries: Just getting something pushed out on a regular basis seems to help a ton.

Leave a Reply

Your email address will not be published. Required fields are marked *