Advertisement
Guest User

Untitled

a guest
Apr 18th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. mysql> select host,user,password from mysql.user where user = 'ans';
  2. +-----------+------+-------------------------------------------+
  3. | host | user | password |
  4. +-----------+------+-------------------------------------------+
  5. | localhost | ans | *40BA1B1CA7EE7B1B5FE4B2B754F74CD789DA6959 |
  6. | % | ans | |
  7. +-----------+------+-------------------------------------------+
  8. 2 rows in set (0.05 sec)
  9.  
  10. $ mysql -uans -hvaliant
  11. Welcome to the MySQL monitor. Commands end with ; or g.
  12. Your MySQL connection id is 221
  13. Server version: 5.1.73 Source distribution
  14. mysql>
  15.  
  16. mysql> s
  17. Current user: ans@valiant
  18. Connection: valiant via TCP/IP
  19.  
  20. mysql> set password for 'ans'@'%' = password('foo');
  21. Query OK, 0 rows affected (0.00 sec)
  22. mysql> set password for 'ans'@'localhost' = password('foo');
  23. Query OK, 0 rows affected (0.00 sec)
  24. mysql> select host,user,password from mysql.user where user = 'ans';
  25. +-----------+------+-------------------------------------------+
  26. | host | user | password |
  27. +-----------+------+-------------------------------------------+
  28. | localhost | ans | *F3A2A51A9B0F2BE2468926B4132313728C250DBF |
  29. | % | ans | *F3A2A51A9B0F2BE2468926B4132313728C250DBF |
  30. +-----------+------+-------------------------------------------+
  31. 2 rows in set (0.00 sec)
  32.  
  33. $ mysql -uans -pfoo
  34. Welcome to the MySQL monitor. Commands end with ; or g.
  35. Your MySQL connection id is 233
  36. Server version: 5.1.73 Source distribution
  37. mysql>
  38.  
  39. $ mysql -uans -pfoo -hvaliant
  40. ERROR 1045 (28000): Access denied for user 'ans'@'valiant' (using password: YES)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement