Guest User

Untitled

a guest
Jun 19th, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. # mysql
  2. mysql> UPDATE user set authentication_string=password('secret') where user='root';
  3. Query OK, 1 row affected, 1 warning (0.00 sec)
  4. Rows matched: 1 Changed: 1 Warnings: 1
  5.  
  6. mysql> flush privileges;
  7. Query OK, 0 rows affected (0.00 sec)
  8.  
  9. mysql> exit
  10. Bye
  11.  
  12. # sudo -u www-data mysql -u root -p
  13. Enter password:
  14. ERROR 1698 (28000): Access denied for user 'root'@'localhost'
  15.  
  16. mysql> show grants for 'root'@'localhost';
  17. +---------------------------------------------------------------------+
  18. | Grants for root@localhost |
  19. +---------------------------------------------------------------------+
  20. | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
  21. | GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION |
  22. +---------------------------------------------------------------------+
  23. 2 rows in set (0.00 sec)
  24.  
  25. mysql> select USER(),CURRENT_USER();
  26. +----------------+----------------+
  27. | USER() | CURRENT_USER() |
  28. +----------------+----------------+
  29. | root@localhost | root@localhost |
  30. +----------------+----------------+
  31. 1 row in set (0.00 sec)
Add Comment
Please, Sign In to add comment