سؤال

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.
هل كانت مفيدة؟

المحلول

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)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى dba.stackexchange
scroll top