Sunday 27 November 2011

reset MySQL password

Many suggested solutions did not work. But this one does the job

First You have to  Stop mysql server:
 
service mysqld stop

Now Start mysql server in safe mode with Follwing Options:
 


mysqld_safe –user=mysql –skip-grant-tables –skip-networking &

Now you have to Login to mysql server without password:
 


mysql -u root mysql

You will get Mysql Prompt.
 


mysql> UPDATE user SET Password=PASSWORD('newrootpassword') WHERE User='root';
 

mysql> flush privileges;
 

mysql> exit
 
Restart mysql server:
 


service mysqld restart

Login to MySQL With the New Password:
 

 mysql -uroot -pnewrootpassword

Thanks UnixLab

No comments:

Post a Comment