How to Reset forgotten mysql root password

It's only fair to share...Share on Facebook0Share on Google+0Tweet about this on Twitter0Share on LinkedIn0Pin on Pinterest0Digg thisShare on StumbleUpon1

In this article we explain how to reset MySQL root password when we forgot it on Linux OS.
If we want to change the password of mysql root user then just login with root user and update mysql user table. But if we lost our root password of MySQL then how to reset forgotten MySQL Root Password?

Step 1:
Stop the current MySQL service by using the following command:


Step 2: 
Start MySQL service in safe mode using “mysqld_safe”, it will skip the grant tables which store the passwords. issue the following command:

we’ll find that mysqld has been start up and now we can connect mysql services without password.

Step 3:
Login the mysql with root user:

 Step 4:
Try to reset MySQL root user password, issue the following command:

 Step 5:
Restart the MySQL service to quit the safe mode and enter into normal mode:


Login the MySQL with new password:


Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">