Guest User

Untitled

a guest
Aug 12th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.07 KB | None | 0 0
  1. 141017 8:57:31 4 Connect root@localhost as anonymous on
  2.  
  3. $ systemctl stop mysqld
  4. $ rm -f /var/lib/mysql/yuri.log
  5. // enable general log in /etc/mysql/my.cnf
  6. $ systemctl start mysqld
  7. $ mysql -u root -p -BNe 'SELECT USER() HowYouAttemptedToLogin, CURRENT_USER() HowMySQLAllowedYouToLogin;'
  8. Enter password:
  9. root@localhost root@localhost
  10. $ mysql -u root -p -BNe 'SELECT host, user FROM mysql.user;'
  11. Enter password:
  12. 127.0.0.1 root
  13. ::1 root
  14. localhost hostname
  15. localhost root
  16. $ cat /var/lib/mysql/yuri.log
  17. /usr/bin/mysqld, Version: 10.0.14-MariaDB-log (MariaDB Server). started with:
  18. Tcp port: 3306 Unix socket: /run/mysqld/mysqld.sock
  19. Time Id Command Argument
  20. 141204 19:03:19 3 Connect UNKNOWN_USER@localhost as anonymous on
  21. 3 Connect Access denied for user 'UNKNOWN_USER'@'localhost' (using password: NO)
  22. 141204 19:04:55 4 Connect root@localhost as anonymous on
  23. 4 Query select @@version_comment limit 1
  24. 4 Query SELECT USER() HowYouAttemptedToLogin, CURRENT_USER() HowMySQLAllowedYouToLogin
  25. 4 Quit
  26. 141204 19:05:47 5 Connect root@localhost as anonymous on
  27. 5 Query select @@version_comment limit 1
  28. 5 Query SELECT host, user FROM mysql.user
  29. 5 Quit
  30.  
  31. mysql -u root -Dmysql -p -BNe 'SELECT USER(),CURRENT_USER()'
  32.  
  33. mysql -u root -Dtest -p -BNe 'SELECT USER(),CURRENT_USER()'
  34.  
  35. mysql -u root -p -BNe 'SELECT USER(),CURRENT_USER()'
  36.  
  37. [29 Sep 2008 8:03] Konstantin Osipov
  38. OK, it was fixed differently:
  39. /*
  40. Log the command before authentication checks, so that the user can
  41. check the log for the tried login tried and also to detect
  42. break-in attempts.
  43. */
  44. general_log_print(thd, command,
  45. (thd->main_security_ctx.priv_user ==
  46. thd->main_security_ctx.user ?
  47. (char*) "%s@%s on %s" :
  48. (char*) "%s@%s as anonymous on %s"),
  49. thd->main_security_ctx.user,
  50. thd->main_security_ctx.host_or_ip,
  51. db ? db : (char*) "");
  52.  
  53. So, this is logged in the general log at least.
  54.  
  55. I was reviewing a patch that added more logging,
  56. but I can't remember the worklog task number.
  57.  
  58. 131021 17:43:50 43 Connect root@localhost as anonymous on pnet_blog
  59. 43 Init DB pnet_blog
  60. 43 Query SELECT count(id) as total_posts FROM posts WHERE date_published is not null AND date_published <= '20131021144350'
  61. 43 Query SELECT * FROM posts WHERE date_published is not null AND date_published <= '20131021144350' ORDER BY date_published DESC LIMIT 0,10
  62. 44 Connect root@localhost as anonymous on pnet_blog
  63. 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
  64. 44 Quit
  65. 43 Quit
  66. 131021 17:44:28 45 Connect root@localhost as anonymous on pnet_blog
  67. 45 Init DB pnet_blog
  68. 45 Query SELECT * FROM posts WHERE url='how-and-when-to-enable-mysql-logs'
  69. 45 Query UPDATE posts SET impressions=impressions+1 WHERE id='41'
  70. 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
  71. 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
  72. 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
  73. 46 Connect root@localhost as anonymous on pnet_blog
  74. 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
  75. 46 Quit
  76. 45 Quit
  77.  
  78. 131021 17:43:50 43 Connect root@localhost as anonymous on pnet_blog
  79. 131021 17:44:28 45 Connect root@localhost as anonymous on pnet_blog
  80.  
  81. 141017 8:57:31 4 Connect root@localhost as anonymous on
Add Comment
Please, Sign In to add comment