How To Reset Forgotten MySQL Root Password

Yo World!!! I’m going to teach you guys how to change mysql root password on Linux platform using Command-Line.

1. Login to your terminal using root
2. Turn off mysql

/etc/init.d/mysqld stop

3. Type in this command to turn on your MySQL to skip grant table

mysqld_safe –skip-grant-tables

4. Type this after turning on the MySQL using command above.

mysql –user=root mysql

5. Now Type this to do change it

update user set Password=PASSWORD(‘new-password’) where user=’root’;
flush privileges;
exit;

6. Now kill Mysqld using “htop/top”

7. Start Mysqld

/etc/init.d/mysqld start

TaaDaa!!! Done!!! Hope You Like That!!

Cheers :p

Leave a Reply

Your email address will not be published. Please enter your name, email and a comment.