Guest User

Untitled

a guest
Jun 24th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. First step is to stop MySQL service.
  2.  
  3. sudo /usr/local/mysql/support-files/mysql.server stop
  4. Then you need to start it in safe mode
  5.  
  6. sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
  7. secondly: let's open another shell/terminal window, log in with no password
  8.  
  9. mysql -u root
  10. UPDATE mysql.user SET Password=PASSWORD('my-new-password') WHERE User='root';
  11. FLUSH PRIVILEGES;
  12. \q
  13. Because in MySQL 5.7, the password field in mysql.user table is removed, now the field name is 'authentication_string'.
  14.  
  15. mysql -u root
  16. UPDATE mysql.user SET authentication_string=PASSWORD('my-new-password') WHERE User='root';
  17. FLUSH PRIVILEGES;
  18. \q
  19. Now again yu need to start the MySQL server
  20.  
  21. sudo /usr/local/mysql/support-files/mysql.server start
Add Comment
Please, Sign In to add comment