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.

Anvesh Patel

Leave a Reply

6 Comments on "How to reset MySQL root Password in Ubuntu"

Notify of
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…