How to reset the mysql root password

→ Are you a new visitor? Please visit the page guidance for new visitors ←

You can reset the root password for your mysql server if you lost the password and no longer remember.

Even I happened to forget my password and do not remember it, and I had some pretty major databases …

  1. Mysql server under windows

In command prompt (start->run->CMD) navigate to your “bin” folder of your mysql server. here you need to run the following commands

Leave that window open and open a new command prompt window and run the following commands:

And that’s it, you can now login using the new mysql password

  1. Mysql server on linux

For starters you need to login to your SSH and stop the mysql server:

Then start the server without privileges:

We are going to login as root but with no password:

Now to actually change the password:

Finaly restart the mysql service:

That’s it, you can now use the new password:

Request an article ←