Friday, October 12, 2012

Reset MySQL root password – Windows 7

STEP #1: Go to START / CONTROL PANEL and click on System and Security
STEP #2: Click on Administrative Tools and select Services
STEP #3: Scroll down and stop MYSQL service
STEP #4: Now go to START / ALL PROGRAMS / ACCESSORIES and right click on Command Prompt – Select RUN as Administrator
STEP #5: Repeat it so you have two Command prompt windows running on your desktop.
STEP #6: In each of the Command prompt windows navigate to 
C:\Program Files\Mysql\Mysql server 5.1\bin>
STEP #7: In first Command prompt window type: mysqld.exe –skip-grant-tables and press ENTER
STEP #8: Go to second Command prompt window and type: mysql.exe –u root mysql and press ENTER, you should be granted access and be in mysql> prompt
STEP #9: Now while at the mysql> type here UPDATE mysql.user SET Password=PASSWORD(‘new password’) WHERE User=’root’ and press ENTER
STEP #10: If everything worked, you should receive QUERY OK
STEP #11: Now type FLUSH PRIVILLEGES; and press ENTER, you will receive another Query OK
STEP #12: Now you have to just reboot your machine and once you are back you should be able to log on with your new password.