How to reset MySQL root Password in Ubuntu

Hello Friends,

One DB Developer required help to reset MySQL root password for client solution. As per his concerned, his tired many solution from different blog and website, but he failed and the question came to my desk.

As I am always ready for new research and problem solving so I have started my work to reset MySQL root password.

On the internet, you can find many similar solutions and I have also tired from these solutions, but I was failed to reset root/admin password.

After some exercise I got success on this.

In this post, I am sharing the step by step final solution to reset a MySQL password in Linux Ubantu.

Step 1:
Stop MySQL Service.

Step 2:
Kill all running mysqld.

Step 3:
Starting mysqld in Safe mode.

Step 4:
Start mysql client

Step 5:
After successful login, please execute this command to change any password.
Here you can visit more about MySQL Flush Command:

Step 6:
You can update mysql root password .

Step 7:
Please execute this command.

This is a final solution to reset MySQL root password in Ubuntu.

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from

Sort by:   newest | oldest | most voted

Your place is valueble for me. Thanks!…

Nidhin jacob cleetu

it doesn’t works for me . Access denied msg comes


Oh my goodness! an amazing article dude. Thank you However You helped me lot Anvesh !


WONDERFUL Post.thanks for share..more wait .. …


This worked for me, Thank you Anvesh…