How to reset the mysql root password on Windows server.
Use these instructions if you need change the root password for MySQL on Windows or if you need to add additional new users with general or specific limitations.
1- Stop the MySQL server if it is running. For a server that is running as a Windows service, go to the Services manager:
Start Menu -> Control Panel -> Administrative Tools -> Services
2- Then find the MySQL service in the list, and stop it.
3- If your server is not running as a service, you may need to use the Task Manager to force it to stop.
Create a text file and place the following command within it on a single line:
SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘MyNewPassword’);
Save the file with any name. For this example the file will be C:\mysql-init.txt.
4- Open a console window to get to the DOS command prompt:
Start Menu -> Run -> cmd
We are assuming that you installed MySQL to C:\mysql. If you installed MySQL to another location, adjust the following commands accordingly.
5- At the DOS command prompt, execute this command:
C:\> C:\mysql\bin\mysqld-nt –init-file=C:\mysql-init.txt