Reset MySQL password for Windows Vista

shabbir's Avatar author of Reset MySQL password for Windows Vista
This is an article on Reset MySQL password for Windows Vista in MySQL.
I just happen to make my life worse when I forgot my MySQL password on my Vista PC. I tried Googling out for forgot password for Windows Vista but happen to find everything from XP to Linux but not Vista and after going through each of them including the Linux one's as well I happen to reset the password so thought I would share my experience on how to reset MySQL password on Vista.
  • Log on to your system as Administrator.
  • 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

    Then find the MySQL service in the list, and stop it.

    If your server is not running as a service, you may need to use the Task Manager to force it to stop.
  • Start the Command Prompt ( cmd.exe ) as an Administrator by Right clicking the short cut and selecting Run as Administrator.
    You will be prompted and allow everything.
  • Now start the mysqld process with --skip-grant-tables option.
  • Keep that window open and open a new command prompt and browse to the location of MySQL and start MySQL with -u root option. It will not ask for any password and now execute the following SQL.
    Code: SQL
    UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
    Replace the ('password') with your password.
  • Now execute
    Code: SQL
    FLUSH PRIVILEGES;
  • Restart your PC and now it should allow you to access MySQL with your password
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
Cool :-) It happened to me once, but I just reinstalled MySQL :P
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by pradeep
Cool :-) It happened to me once, but I just reinstalled MySQL :P
0
darsh999's Avatar
Light Poster
Well my friend also facing the same situation but i have tried your technique too but the service manager is not opening in other servers !
So what should we do ?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
What do you mean by
Quote:
Originally Posted by darsh999
service manager is not opening in other servers !
0
verci's Avatar
Light Poster
i also reinstalled My SQL
0
izz's Avatar, Join Date: Aug 2011
izz
Newbie Member
I was stuck at the 5th step, it's not accepting to run the MySql without root password.