Posted By

isholgueras on 11/23/10


Tagged

mysql


Versions (?)

Reset root password in MySQL


 / Published in: MySQL
 

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

  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  

You need to login to post a comment.