Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Resetting MySQL Admin Password In Windows server  (Read 3403 times)

0 Members and 1 Guest are viewing this topic.

Haripriya H

  • Guest
Resetting MySQL Admin Password In Windows server
« on: May 19, 2014, 10:57:08 pm »
Steps to reset mysql admin password in windows server:

1) Log on to the Windows System where MySQL is running as Administrator. Stop MySQL server if it is running. Go to the Services manager:
Start Menu -> Control Panel -> Administrative Tools -> Services
Find MySQL service in the list and stop it.
2) Create a text file and place the following command within it on a single line:
SET PASSWORD FOR root@’localhost = PASSWORD(NewPassword);
Save the file with any name. For example the file will be C:\mysql-pass.txt.
3) Open the DOS command prompt:
Start Menu -> Run -> cmd
4) If MySQL is installed in C:\mysql. At the DOS command prompt execute this command:
C:\> C:\mysql\bin\mysqld-nt init-file=C:\mysql-pass.txt
If MySQL is installed in another location, adjust the following commands accordingly
5) The contents of the file named by the init-file option are executed at server startup, changing the root password. After the server has started successfully.
6) Stop the MySQL server and restart it in normal mode again. If MySQL server is ran as a service, start it from the Windows Services window.
7) Connect to MySQL server by using the new password.