Knowledgebase
Reset Mysql root password Print this Article
Reset Your MySQL Root password on Windows
It is quite easy to reset your mysql root user password (if you know how!) In this howto I will try and explain how this is done.
1. |
Prerequisites:- You have to be logged on with administrator rights |
|
---|---|---|
2. |
Lets Begin: Creating a txt file with the necessary sql commandsStart by making a txt file. I called it reset-mysql.txt. UPDATE mysql.user SET Password=PASSWORD('EnterPassword') WHERE User='root'; Replace “EnterPassword” with your new password. Also make sure that the UPDATE and FLUSH commands are on separate lines! |
|
3. |
Stop the MySQL ServerIf it is running as a service If it is not running as a service use the windows taskmanager to stop the server |
|
4. |
Start the resetting of your root passwordOpen an administrator command prompt and navigate to your MySQL bin directory inside your MySQL install folder ("c:\Program Files\MySQL\MySQL Server 5.0\bin") enter the following command - mysqld-nt --init-file=D:\reset-mysql.txt --console This will reset your root password to that which you have set in the text file. Extra Info: |
|
5. |
Restart the MySQL Serviceself explanatory |
|
6. |
test to see if your password has been reset- open a command prompt |
|
7. |
extra info:When I do this it works great most of the times. But sometimes it seems that the mysql service hangs in between starting and stopping. Restarting the computer usually helps |
Was this answer helpful?
Related Articles
Create, schedule and change paths where applys for the batch script below :: If the time...