Guest User

Untitled

a guest
Apr 25th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. If you don't remember the password you set for root and need to reset it, follow these steps:
  2.  
  3. Stop the mysqld server, this varies per install
  4. Run the server in safe mode with privilege bypass
  5.  
  6. sudo mysqld_safe --skip-grant-tables;
  7.  
  8. In a new window connect to the database, set a new password and flush the permissions & quit:
  9.  
  10. mysql -u root
  11.  
  12. For MySQL older than MySQL 5.7 use:
  13.  
  14. UPDATE mysql.user SET Password=PASSWORD('your-password') WHERE User='root';
  15.  
  16. For MySQL 5.7+ use:
  17.  
  18. USE mysql;
  19.  
  20. UPDATE mysql.user SET authentication_string=PASSWORD("your-password") WHERE User='root';
  21.  
  22. Refresh and quit:
  23.  
  24. FLUSH PRIVILEGES;
  25.  
  26. \q
Add Comment
Please, Sign In to add comment