Friday, May 24, 2013

How to Reset mysql root password if you forgot it

1. Login as root on the server
2. Stop the mysql service
3. start the mysql service on safemode
           command: mysqld_safe --skip-grant-tables
4. Login or if you have a ready alternate console, you can now do mysql command which will login with out password then do the sql command below:

           update mysql.user set Password=PASSWORD('NeWPassWord') WHERE User='root';


5. Exit and restart the mysql service as normal restart.
6. You can now login using the new password.