Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MySQL (http://www.go4expert.com/articles/mysql/)
-   -   Reset MySQL password for Windows Vista (http://www.go4expert.com/articles/reset-mysql-password-windows-vista-t6723/)

shabbir 7Oct2007 22:07

Reset MySQL password for Windows Vista
 
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

pradeep 10Oct2007 11:36

Re: Reset MySQL password for Windows Vista
 
Cool :-) It happened to me once, but I just reinstalled MySQL :P

shabbir 10Oct2007 11:50

Re: Reset MySQL password for Windows Vista
 
Quote:

Originally Posted by pradeep
Cool :-) It happened to me once, but I just reinstalled MySQL :P

:D :D :D :D

darsh999 14Oct2007 01:08

Re: Reset MySQL password for Windows Vista
 
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 ?

shabbir 14Oct2007 05:11

Re: Reset MySQL password for Windows Vista
 
What do you mean by
Quote:

Originally Posted by darsh999
service manager is not opening in other servers !


verci 21Oct2007 11:07

Re: Reset MySQL password for Windows Vista
 
i also reinstalled My SQL

izz 3Aug2011 16:46

Re: Reset MySQL password for Windows Vista
 
I was stuck at the 5th step, it's not accepting to run the MySql without root password.


All times are GMT +5.5. The time now is 11:37.