Guest User

Untitled

a guest
Feb 23rd, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. ## MariaDB Password Reset
  2.  
  3. Stop the mariadb service:
  4.  
  5. ```
  6. $ sudo systemctl stop mariadb.service
  7. ```
  8.  
  9. Start MariaDB in safe mode:
  10.  
  11. ```
  12. $ sudo mysqld_safe --skip-grant-tables --skip-networking
  13. ```
  14.  
  15. or
  16.  
  17. ```
  18. $ sudo mysqld_safe --skip-grant-tables --skip-networking &
  19. ```
  20.  
  21. to run the process in the background.
  22.  
  23. Login to MariaDB and change password
  24.  
  25. ```
  26. $ sudo mysql -u root
  27.  
  28. ...
  29.  
  30. MariaDB [(none)]> use mysql;
  31. MariaDB [mysql]> UPDATE user SET password=PASSWORD("secret") WHERE User='root';
  32. MariaDB [mysql]> FLUSH PRIVILEGES;
  33. MariaDB [mysql]> \q
  34. ```
  35.  
  36. Restart MariaDB:
  37.  
  38. ```
  39. $ sudo sytemctl restart mariadb.service
  40. ```
  41.  
  42. Login with the new credentials:
  43.  
  44. ```
  45. $ sudo mysql -u root -p
  46. ```
Add Comment
Please, Sign In to add comment