Reset root password in MySQL


/ Published in: MySQL
Save to your folder(s)

How to reset a root password in mysql with OS root user


Copy this code and paste it in your HTML
  1. #From bash
  2. #Stop mysql service
  3. $> service mysqld stop
  4. #Start mysql "for free". Seems dangerous :P
  5. $> mysqld_safe --skip-grant-tables --skip-networking &
  6.  
  7. $> mysql -uroot
  8. mysql> use mysql;
  9. mysql> UPDATE user SET password=PASSWORD('nuevo_pass') WHERE user='root';
  10. mysql> quit;
  11.  
  12. $> service mysqld restart

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.