It has happened to everyone that due to confusion, they forget the key to a program. This, believe it or not, is something that happens a lot in Mysql, which is very serious because without it you will not be able to do anything. But don’t worry, if you are one of the unlucky ones that happened to them, today you will see How to recover the root password Mysql in Windows?
Take into account before continuing, that the process to perform the password recovery is somewhat complex if you do not master this program (you do not have to be an expert but you do have notions), however, this tutorial will try to summarize everything as best as possible.
How to recover Mysql root password on Windows?
Before starting the process that 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 have to do is go to the Windows process manager (services.msc), once there, right-click on Mysql and give the option to ” Stop “. Next, open a CMD window at the start of the computer and go to the folder where Mysql is located on the computer ( opening the CMD command window is mandatory, without it you will not do anything).
This is usually in the BIN section, which in turn is located in the program’s 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 useless.
Step number two
Now that you have achieved the above, reopen a CMD window (without having closed 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 enter without a password, but the process has 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 placing the following: “INSERT INTO user VALUES (‘localhost’, ‘roottemporal’,”, ‘Y’, ‘Y ‘,’ Y ‘,’ Y ‘,’ Y ‘,’ Y ‘,’ Y ‘,’ Y ‘,’ Y ‘,’ Y ‘,’ Y ‘,’ Y ‘,’ Y ‘,’ Y ‘, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ”, ”,”, ”, ‘0’, ‘0’, ‘0’, ‘0 ′)”
Keep in mind that that last line you will have to place manually, they are exactly 26 Y, 4 0 and 4 empty spaces. By putting 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 let you use the task manager to kill them both or choose to forcibly delete files and folders from CMD).
Final steps to take
You are close to answering the question How to recover the root password Mysql in Windows? , and thus solve your problem, there are only a few final steps to take. The first of these is to start again with the Mysql service manager.
Then, open a CMD window and enter the temporary root (at the same time select the database with Mysql). To finish, execute: ”UPDATE user SET Password = PASSWORD (‘the_new_password’) WHERE User = ‘root’”, and then ”flush privileges”.
So you will be done, so you can use the program fully again, 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 initial question, How to recover the Mysql root password in Windows? so your problem is now part of the past and should not happen again.
Remember that each of the instructions here must be followed to the letter because a mistake could be quite annoying (it can leave you with more problems than the ones you started with). As a recommendation, look for more information about this program, since this way you can improve and achieve more things, such as connecting two computers to a MySQL database (which is difficult).