Advertisement
Guest User

Untitled

a guest
Feb 7th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. Set up root password for the first time
  2. $ mysqladmin -u root password newpass
  3.  
  4. Change (or update) a root password
  5. $mysqladmin -u root -p oldpassword newpass
  6.  
  7. Change a normal user password
  8. $mysqladmin -u user-name -p oldpassword newpass
  9.  
  10. Change pass for user
  11. mysql> update user set password=PASSWORD("newpass") where User='ENTER-USER-NAME-HERE';
  12. mysql> flush privileges;
  13. mysql> quit
  14.  
  15. Recover
  16. # /etc/init.d/mysql stop
  17.  
  18. Start the MySQL server w/o password:
  19. # mysqld_safe --skip-grant-tables &
  20.  
  21. mysql -u root
  22.  
  23. mysql> use mysql;
  24. mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
  25. mysql> flush privileges;
  26. mysql> quit
  27. # /etc/init.d/mysql stop
  28.  
  29. # /etc/init.d/mysql start
  30. # mysql -u root -p
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement