After long time, today i thought of use my MYSQL db, But the thing is i’ve forget my password 😦 Then i asked to my friend mani, “pls help me mani, i ve to reset my MYSQL password urgently. He gave the simple solution”. 🙂
Here the i’m posting the simple steps to reset the mysql root password.
Open your terminal and type the following commands.
First we’ve to stop the mysql service,
$ sudo service mysqld stop $ sudo mysqld_safe --skip-grant-tables
( It runs the mysql in safe mode and the “skip-grant-tables ” skips the table which ‘ve the MYQSL user passwords )
The above command ‘ll start mysql server, now open a another tab in ur terminal and type this command.
$ mysql --user=root mysql ( It 'll login as root without password)
Now type the below query in myqsl prompt.
Note: change “new-password” to your new password. 🙂
> update user set Password=PASSWORD('new-password') WHERE User='root';
That’s all ve fun 🙂