Reset your MYSQL Password

Hi friends,

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 🙂

Published by Tha.Suresh

No pain No gain!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: