Thursday, March 18, 2010

How to reset ROOT password for MySQL Server 5.0

  1. Stop my sql server
  2.  Start Menu -> Control Panel -> Administrative Tools -> Services  
    

    Find mysql, right click and select stop

  3. Open Command Prompt
  4.  Run -> type "cmd"  
    
  5. Execute the following command in the command prompt
  6.  cd C:\Program Files\MySQL\MySQL Server 5.0\bin  
     mysqld-nt.exe -u root --skip-grant-tables  
    
  7. Leave the current command prompt as it is, and open a command prompt window.
  8. Execute the following command in the command prompt in the second command prompt.
  9.  cd C:\Program Files\MySQL\MySQL Server 5.0\bin  
     mysql  
    
    You should have this
     C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql  
     Welcome to the MySQL monitor. Commands end with ; or \g.  
     Your MySQL connection id is 1  
     Server version: 5.0.67-community-nt MySQL Community Edition (GPL)  
     Type 'help;' or '\h' for help. Type '\c' to clear the buffer.  
     mysql>  
    
  10. Execute the following command to update the password in the sql command windows.
  11.  UPDATE user SET Password = PASSWORD('NEW_PASSWORD') WHERE User = 'root';   
    
    Where 'NEW_PASSWORD' will be your new ROOT password

  12. After you are finished close the first command prompt and type "exit;" in the second command prompt windows to disconnect successfully. You can now start the MySQL service.
  13. *Note for Haslyn : Sorry, I just forgot mysql pass in your PC, so i write this for u.*

No comments:

Post a Comment