Guest User

Untitled

a guest
Jan 15th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. [root@db1 ~]# mysql -uroot -pfoobar
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3. Your MySQL connection id is 3
  4. Server version: 5.1.61 Source distribution
  5.  
  6. Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  7.  
  8. Oracle is a registered trademark of Oracle Corporation and/or its
  9. affiliates. Other names may be trademarks of their respective
  10. owners.
  11.  
  12. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  13.  
  14. mysql> use mysql
  15. Reading table information for completion of table and column names
  16. You can turn off this feature to get a quicker startup with -A
  17.  
  18. Database changed
  19. mysql> select User from user;
  20. +------+
  21. | User |
  22. +------+
  23. | root |
  24. | |
  25. | root |
  26. | |
  27. | root |
  28. +------+
  29. 5 rows in set (0.00 sec)
  30.  
  31. mysql> CREATE USER '123'@'%' IDENTIFIED BY '123';
  32. Query OK, 0 rows affected (0.00 sec)
  33.  
  34. mysql> show databases;
  35. +--------------------+
  36. | Database |
  37. +--------------------+
  38. | information_schema |
  39. | mysql |
  40. | test |
  41. +--------------------+
  42. 3 rows in set (0.00 sec)
  43.  
  44. mysql> create database 123;
  45. Query OK, 1 row affected (0.00 sec)
  46.  
  47. mysql> GRANT ALL ON 123.* to '123'@'%' WITH GRANT OPTION;
  48. Query OK, 0 rows affected (0.00 sec)
  49.  
  50. mysql> FLUSH PRIVILEGES;
  51. Query OK, 0 rows affected (0.00 sec)
  52.  
  53. mysql> quit
  54. Bye
  55. [root@db1 ~]# mysql -u123 -p123
  56. ERROR 1045 (28000): Access denied for user '123'@'localhost' (using password: YES)
  57.  
  58. mysql> use mysql
  59. Database changed
  60.  
  61. mysql> select * from user where User='123' \G
  62. *************************** 1. row ***************************
  63. Host: %
  64. User: 123
  65. Password: *08FA77CAB469297F05D9CA01BAA5529DDBC5265B
  66. Select_priv: N
  67. Insert_priv: N
  68. Update_priv: N
  69. Delete_priv: N
  70. Create_priv: N
  71. Drop_priv: N
  72. Reload_priv: N
  73. Shutdown_priv: N
  74. Process_priv: N
  75. File_priv: N
  76. Grant_priv: N
  77. References_priv: N
  78. Index_priv: N
  79. Alter_priv: N
  80. Show_db_priv: N
  81. Super_priv: N
  82. Create_tmp_table_priv: N
  83. Lock_tables_priv: N
  84. Execute_priv: N
  85. Repl_slave_priv: N
  86. Repl_client_priv: N
  87. Create_view_priv: N
  88. Show_view_priv: N
  89. Create_routine_priv: N
  90. Alter_routine_priv: N
  91. Create_user_priv: N
  92. Event_priv: N
  93. Trigger_priv: N
  94. ssl_type:
  95. ssl_cipher:
  96. x509_issuer:
  97. x509_subject:
  98. max_questions: 0
  99. max_updates: 0
  100. max_connections: 0
  101. max_user_connections: 0
  102. 1 row in set (0.00 sec)
Add Comment
Please, Sign In to add comment