Lost your MySQL Password? Here is how to reset!

0 992

One day you try to login to MySQL as “root” and suddenly you realize that you don’t remember what you had setup, now what???

No worries, here at nFlicker we will guide you with very easy steps to set a new password for your “root” account.

Requirement: You must be logged in to ssh as root

After logging in as root follow the steps below:
# sudo /etc/init.d/mysqld stop
then give these commands:
# sudo mysqld_safe –skip-grant-tables &
# mysql -uroot

After entering the above command now you can setup your new password for root account.

(Remember to replace “12345678” with your desired password.)
> update user set password=PASSWORD(“12345678”) where User=’root’;
> flush privileges;
> quit
Now you just need to stop and start the MySQL again
# sudo /etc/init.d/mysqld stop

# sudo /etc/init.d/mysqld start
NOW you can login using the new pass as:
# mysql -u root -p

Thats it!

  • Design

Leave A Reply

Your email address will not be published.