Reset MySQL password for Windows Vista

Discussion in 'MySQL' started by shabbir, Oct 7, 2007.

  1. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    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:
      UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
      Replace the ('password') with your password.
    • Now execute
      Code:
      FLUSH PRIVILEGES;
    • Restart your PC and now it should allow you to access MySQL with your password
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    Cool :) It happened to me once, but I just reinstalled MySQL :P
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    :D :D :D :D
     
  4. darsh999

    darsh999 New Member

    Joined:
    Oct 13, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    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 ?
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    What do you mean by
     
  6. verci

    verci New Member

    Joined:
    Oct 20, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    i also reinstalled My SQL
     
  7. izz

    izz New Member

    Joined:
    Aug 3, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I was stuck at the 5th step, it's not accepting to run the MySql without root password.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice