Advertisement
giordanocardillo

How to recreate ROOT user account on MySQL

Sep 1st, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. Hot to recreate ROOT user account on MySQL:
  2.  
  3. In bash:
  4.  
  5. service stop mysqld;
  6. mysqld_safe --skip-grant-tables &;
  7. mysql -u root;
  8.  
  9. Inside mysql:
  10.  
  11. mysql>use mysql;
  12. mysql>flush privileges;
  13. mysql>create user root@localhost;
  14. mysql>flush privileges;
  15. mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' with grant option;
  16. mysql>UPDATE mysql.user SET Password=PASSWORD('<<< YOUR PASSWORD HERE >>>') WHERE User='root';
  17. mysql>flush privileges;
  18. mysql>quit;
  19.  
  20. And you're done! ;)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement