Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

The docs for 5.1 say that I can set log_warnings = 2 to capture Aborted_connects in the error log. This bug report suggests that this was only merged into 5.5 and 6.0 (and maybe 5.2) but not into 5.1.

I tried out all combinations of set global log_warnings = 2; and set global log_warnings = 1; followed by login attempts with valid and invalid users and invalid and no passwords results in nothing in the error log.

  1. Are the docs incorrect or have I made a mistake somewhere?
  2. Do other types of aborted connections (such as a loss of network during the login or improper permissions for the database) get logged in the error log?
  3. Do aborted clients get logged in the error log?

Some other things I have checked/done:

  • log_error is set to /var/log/mysql/error.log.
  • That file exists and the mysqld process has it open.
  • The last entry in it is from 2012/06/01.
  • skip-log-warnings is not set in my.cnf and the process was started with no arguments.
  • skip_log_warnings does not exist in SHOW GLOBAL VARIABLES LIKE '%skip%'
  • The uptime of MySQL is 50 days.
  • I ran FLUSH LOGS just in case.
  • The version string is 5.1.62-0ubuntu0.10.04.1-log.
  • The Aborted_connects value is increasing by one every time I try an invalid connection attempt.
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

This seems to be an elusive bug nobody wants to fix

According to http://bugs.mysql.com/bug.php?id=24761, the aborted connect is recorded in the general log

[29 Sep 2008 8:03] Konstantin Osipov
OK, it was fixed differently:
      /*
        Log the command before authentication checks, so that the user can
        check the log for the tried login tried and also to detect
        break-in attempts.
      */
      general_log_print(thd, command,
                        (thd->main_security_ctx.priv_user ==
                         thd->main_security_ctx.user ?
                         (char*) "%s@%s on %s" :
                         (char*) "%s@%s as anonymous on %s"),
                        thd->main_security_ctx.user,
                        thd->main_security_ctx.host_or_ip,
                        db ? db : (char*) "");

So, this is logged in the general log at least.

I was reviewing a patch that added more logging,
but I can't remember the worklog task number.

We just have to wait on MySQL (I mean Oracle) to fix it. (That was sarcasm)

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.