How to recover Mysql root password on Windows easily?

It has happened to everyone that due to confusion, they forget the key to a program. Believe it or not, this is something that happens often in Mysql which is very serious because without it you won't be able to do anything. But don't worry, if you are one of the unlucky ones who happened to be, today you will see How to recover the root password Mysql in Windows?

Before continuing, please note that the process is for perform password recovery it is somewhat complex if you don't master this program (you don't have to be an expert but you have some knowledge), however this tutorial will try to summarize everything as best as possible.




How to recover Mysql root password on Windows?

Before starting the process it will help you answer the question How to recover the root password Mysql in Windows? You should know that all the necessary steps will be divided so that there is no confusion or excess information.

Now, the first thing you need to do is go to the Windows process manager (services.msc), once there, right click on Mysql and give the option » Stop ". Next, open a CMD window when the computer starts and go to the folder where Mysql is located on the computer (opening the CMD command window is mandatory, without it you will do nothing).

It is usually located in the BIN section, which in turn is located in the program installation folder. When you have found it, write in the CMD "Mysqld-nt –skip-grant-tables", which will start a process that will render the console unusable.

How to recover Mysql root password on Windows easily?


 



Step number two

Now that you have the above, reopen a CMD window (without closing the other one), from there, go to the Mysql installation folder and type the following: " mysql -u root ", with that you will be able to log in without a password, but the process is not finished yet.

Step number 3

The next thing you should do is locate yourself in the database (using Myswl), and then proceed to create another root by entering the following: "INSERT INTO user VALUES ('localhost', 'roottemporary',", 'Y', 'Y ','Y ', 'Y ','Y ', 'Y ','Y ', 'Y ', 'Y ', 'AND ', 'AND ', 'AND ', 'AND ', 'AND ', 'AND', 'AND', 'AND', 'AND', 'AND', 'AND', 'AND', 'AND', 'AND', 'AND', 'AND', 'AND', ”, ”,”, ”, '0', '0', '0', '0)”

Keep in mind that the last line that you will have to manually place, are exactly 26 Y, 4 0 and 4 blanks. By placing them and running them, a temporary root will be created, which will have all permissions enabled.

With that already working, close the first CMD window you opened and also the Mysql process you were using (in case they don't allow it, use the task manager to kill them both or choose to forcibly delete files and folders from CMD).

Last steps to take

You are about to answer the question How to recover Mysql root password in Windows? , and thus solving your problem, there are only a few final steps to take. The first of these is to start over with the Mysql service manager.



How to recover Mysql root password on Windows easily?


 

Then, open a CMD window and enter temporary root (at the same time select the database with Mysql). To finish, run: ”UPDATE user SET Password = PASSWORD (‘the_new_password’) WHERE User = ‘root’”, e poi ”flush privilegi”.


Then you are done, then you can use the program again completely, the only thing you need to do is remove the temporary root with the commands: » delete from user where user = 'roottemporal'; " and "flush privileges"; (put them in that order).


And voila, now you can finally say that you have the answer to the original question, How to recover Mysql root password in Windows?, So your problem is now a thing of the past and shouldn't repeat itself.


Remember that each of the instructions here must be followed to the letter, as a mistake can be quite annoying (it can leave you with more problems than you started with). As a recommendation, look for more information about this program, as this way you can improve and achieve more things, like connecting two computers to a MySQL database (which is difficult).


add a comment of How to recover Mysql root password on Windows easily?
Comment sent successfully! We will review it in the next few hours.

End of content

No more pages to load