Bug #43625 --log-warning=2 should record more Aborted_connects to error log
Submitted: 13 Mar 2009 9:39
Reporter: Mikiya Okuno Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Errors Severity:S4 (Feature request)
Version:5.0, 5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[13 Mar 2009 9:39] Mikiya Okuno
Description:
When 2 or lager value for log-warnings is evaluated, errors should be recorded in the error log as well as general log. Especially, when mysql got errors on any login attempts, error log should be updated in order to keep track of security problems.

How to repeat:
See bug #41602.

Suggested fix:
Where general_log_print() is used instead of sql_print_warning() listed below should be modified:

shell> cd /path/to/mysql-5.1-src/sql
shell> grep -Hn general_log_print *|grep ER_
sql_connect.cc:338:    general_log_print(thd, COM_CONNECT, ER(ER_NOT_SUPPORTED_AUTH_MODE));
sql_connect.cc:369:      general_log_print(thd, COM_CONNECT, ER(ER_SERVER_IS_IN_SECURE_AUTH_MODE),
sql_connect.cc:486:    general_log_print(thd, COM_CONNECT, ER(ER_NOT_SUPPORTED_AUTH_MODE));
sql_connect.cc:495:  general_log_print(thd, COM_CONNECT, ER(ER_ACCESS_DENIED_ERROR),
sql_db.cc:1621:    general_log_print(thd, COM_INIT_DB, ER(ER_DBACCESS_DENIED_ERROR),
sql_show.cc:710:    general_log_print(thd,COM_INIT_DB,ER(ER_DBACCESS_DENIED_ERROR),
[13 Mar 2009 9:39] MySQL Verification Team
Patch for MySQL 5.1.32

Attachment: accesspatch (video/x-flv, text), 3.43 KiB.

[13 Mar 2009 13:53] MySQL Verification Team
Updated patch for MySQL 5.1.32, removed spaces ;p

Attachment: logwarn_5.1.patch (application/octet-stream, text), 3.24 KiB.

[13 Mar 2009 13:53] MySQL Verification Team
Patch for MySQL 5.0.78

Attachment: logwarn_5.0.patch (application/octet-stream, text), 3.05 KiB.

[26 Mar 2010 19:53] MySQL Verification Team
This appears fixed in 5.6.99:

Version: '5.6.99-m4-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
100112 13:32:09 [Warning] Access denied for user 'ODBC'@'192.168.1.100' (using password: NO)
100112 13:32:19 [Warning] Access denied for user 'ODBC'@'192.168.1.100' (using password: YES)
100112 13:33:19 [Warning] Access denied for user 'ODBC'@'192.168.1.100' (using password: YES)
[20 Aug 2010 7:40] MySQL Verification Team
see also bug #25822 which is fixed.