Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 141017 8:57:31 4 Connect root@localhost as anonymous on
- $ systemctl stop mysqld
- $ rm -f /var/lib/mysql/yuri.log
- // enable general log in /etc/mysql/my.cnf
- $ systemctl start mysqld
- $ mysql -u root -p -BNe 'SELECT USER() HowYouAttemptedToLogin, CURRENT_USER() HowMySQLAllowedYouToLogin;'
- Enter password:
- root@localhost root@localhost
- $ mysql -u root -p -BNe 'SELECT host, user FROM mysql.user;'
- Enter password:
- 127.0.0.1 root
- ::1 root
- localhost hostname
- localhost root
- $ cat /var/lib/mysql/yuri.log
- /usr/bin/mysqld, Version: 10.0.14-MariaDB-log (MariaDB Server). started with:
- Tcp port: 3306 Unix socket: /run/mysqld/mysqld.sock
- Time Id Command Argument
- 141204 19:03:19 3 Connect UNKNOWN_USER@localhost as anonymous on
- 3 Connect Access denied for user 'UNKNOWN_USER'@'localhost' (using password: NO)
- 141204 19:04:55 4 Connect root@localhost as anonymous on
- 4 Query select @@version_comment limit 1
- 4 Query SELECT USER() HowYouAttemptedToLogin, CURRENT_USER() HowMySQLAllowedYouToLogin
- 4 Quit
- 141204 19:05:47 5 Connect root@localhost as anonymous on
- 5 Query select @@version_comment limit 1
- 5 Query SELECT host, user FROM mysql.user
- 5 Quit
- mysql -u root -Dmysql -p -BNe 'SELECT USER(),CURRENT_USER()'
- mysql -u root -Dtest -p -BNe 'SELECT USER(),CURRENT_USER()'
- mysql -u root -p -BNe 'SELECT USER(),CURRENT_USER()'
- [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.
- 131021 17:43:50 43 Connect root@localhost as anonymous on pnet_blog
- 43 Init DB pnet_blog
- 43 Query SELECT count(id) as total_posts FROM posts WHERE date_published is not null AND date_published <= '20131021144350'
- 43 Query SELECT * FROM posts WHERE date_published is not null AND date_published <= '20131021144350' ORDER BY date_published DESC LIMIT 0,10
- 44 Connect root@localhost as anonymous on pnet_blog
- 44 Query SELECT id, title, impressions FROM tips WHERE date_published IS NOT NULL AND date_published <= '20131021144350' ORDER BY date_published DESC LIMIT 0, 10
- 44 Quit
- 43 Quit
- 131021 17:44:28 45 Connect root@localhost as anonymous on pnet_blog
- 45 Init DB pnet_blog
- 45 Query SELECT * FROM posts WHERE url='how-and-when-to-enable-mysql-logs'
- 45 Query UPDATE posts SET impressions=impressions+1 WHERE id='41'
- 45 Query SELECT url, post_title FROM posts WHERE date_published IS NOT NULL AND date_published < '20131020150000' ORDER BY date_published DESC LIMIT 0,1
- 45 Query SELECT url, post_title FROM posts WHERE date_published IS NOT NULL AND date_published > '20131020150000' ORDER BY date_published ASC LIMIT 0,1
- 45 Query SELECT * FROM posts WHERE date_published is not null AND date_published <= '20131021144428' AND date_published >= '20130421144428' ORDER BY impressions DESC LIMIT 0,10
- 46 Connect root@localhost as anonymous on pnet_blog
- 46 Query SELECT id, title, impressions FROM tips WHERE date_published IS NOT NULL AND date_published <= '20131021144428' ORDER BY date_published DESC LIMIT 0, 10
- 46 Quit
- 45 Quit
- 131021 17:43:50 43 Connect root@localhost as anonymous on pnet_blog
- 131021 17:44:28 45 Connect root@localhost as anonymous on pnet_blog
- 141017 8:57:31 4 Connect root@localhost as anonymous on
Add Comment
Please, Sign In to add comment