Guest User

Untitled

a guest
Jan 15th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. mysql> GRANT ALL PRIVILEGES ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY 'password' WITH GRANT OPTION;
  2. Query OK, 0 rows affected (0.00 sec)
  3.  
  4. mysql> FLUSH PRIVILEGES;
  5. Query OK, 0 rows affected (0.00 sec)
  6.  
  7. mysql> select * from mysql.user where User='testuser' \G
  8. *************************** 1. row ***************************
  9. Host: 127.0.0.1
  10. User: testuser
  11. Password: *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19
  12. Select_priv: Y
  13. Insert_priv: Y
  14. Update_priv: Y
  15. Delete_priv: Y
  16. Create_priv: Y
  17. Drop_priv: Y
  18. Reload_priv: Y
  19. Shutdown_priv: Y
  20. Process_priv: Y
  21. File_priv: Y
  22. Grant_priv: Y
  23. References_priv: Y
  24. Index_priv: Y
  25. Alter_priv: Y
  26. Show_db_priv: Y
  27. Super_priv: Y
  28. Create_tmp_table_priv: Y
  29. Lock_tables_priv: Y
  30. Execute_priv: Y
  31. Repl_slave_priv: Y
  32. Repl_client_priv: Y
  33. Create_view_priv: Y
  34. Show_view_priv: Y
  35. Create_routine_priv: Y
  36. Alter_routine_priv: Y
  37. Create_user_priv: Y
  38. Event_priv: Y
  39. Trigger_priv: Y
  40. ssl_type:
  41. ssl_cipher:
  42. x509_issuer:
  43. x509_subject:
  44. max_questions: 0
  45. max_updates: 0
  46. max_connections: 0
  47. max_user_connections: 0
  48. 1 row in set (0.00 sec)
  49.  
  50. mysql> quit
  51. Bye
  52. [root@db1 ~]# mysql -u testuser -ppassword -h 127.0.0.1
  53. Welcome to the MySQL monitor. Commands end with ; or \g.
  54. Your MySQL connection id is 20
  55. Server version: 5.1.61 Source distribution
  56.  
  57. Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  58.  
  59. Oracle is a registered trademark of Oracle Corporation and/or its
  60. affiliates. Other names may be trademarks of their respective
  61. owners.
  62.  
  63. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  64.  
  65. mysql> quit
  66. Bye
  67. [root@db1 ~]# mysql -u testuser -h 127.0.0.1
  68. ERROR 1045 (28000): Access denied for user 'testuser'@'localhost' (using password: NO)
  69. [root@db1 ~]# mysql -u testuser
  70. Welcome to the MySQL monitor. Commands end with ; or \g.
  71. Your MySQL connection id is 22
  72. Server version: 5.1.61 Source distribution
  73.  
  74. Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  75.  
  76. Oracle is a registered trademark of Oracle Corporation and/or its
  77. affiliates. Other names may be trademarks of their respective
  78. owners.
  79.  
  80. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  81.  
  82. mysql>
Add Comment
Please, Sign In to add comment