Guest User

Untitled

a guest
May 13th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. 1. Stop mysql:
  2. systemctl stop mysqld
  3.  
  4. 2. Set the mySQL environment option
  5. systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
  6.  
  7. 3. Start mysql usig the options you just set
  8. systemctl start mysqld
  9.  
  10. 4. Login as root
  11. mysql -u root
  12.  
  13. 5. Update the root user password with these mysql commands
  14. mysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword')
  15. -> WHERE User = 'root' AND Host = 'localhost';
  16. mysql> FLUSH PRIVILEGES;
  17. mysql> quit
  18.  
  19. 6. Stop mysql
  20. systemctl stop mysqld
  21.  
  22. 7. Unset the mySQL envitroment option so it starts normally next time
  23. systemctl unset-environment MYSQLD_OPTS
  24.  
  25. 8. Start mysql normally:
  26. systemctl start mysqld
  27.  
  28. Try to login using your new password:
  29. 7. mysql -u root -p
Add Comment
Please, Sign In to add comment