If you setup a MySQL server on to your Desktop to host a server or storing databases, you may have a lot of users to keep track of and especially the passwords. If you have forgotten your root account’s password, you will be searching everything to find a way to retrieve it without uninstalling MySQl correctly and installing it again.
So I will be telling you one of the ways to reset your root account’s password.
Open up a command prompt by doing (Windows Key+R) to bring a the Run Box.
Next, type in cmd and press enter
A command prompt should appear.
Now what you want to do is to navigate to your MySQL Server installation and find the binmysqld or something similar to that.
This important step requires to disable and also stop any MySQL Services that are running:
In the run box, you can also type in “services.msc” to bring up the list of services and you will be able to find the MySQL services and you should then disable/stop them.
Now we need to create a .txt that pretty much resets our password to what you want:
UPDATE mysql.user SET Password=PASSWORD(‘ragrag’) WHERE User=’root’;
*This tells us that our new password will be reset to “ragrag”
Finally, you can return to the command box and take note of the directory the mysqld.exe is in.
You will want to “cd” into where the “mysqld.exe” file is in.
Then enter this line into the cmd prompt:
If you installed MySQL using the MySQL Installation Wizard, you may need to specify a
"C:Program FilesMySQLMySQL Server 5.0binmysqld-nt.exe"
--defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini"
--init-file=C:\mysql-init.txtSource: (http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html) The format should look similar except changing the mysqld-nt.exe, you could use mysqld.exe And mysql-init.txt is where the "UPDATE mysql.user SET Password" code is in If you need more assistance with this, I would be glad to make a video guide so you can follow the steps.