How to reset mysql root password

it is quiet easy to reset mysql root password, here are the steps

  1. SSH as root to your machine
  2. Turn off the mysqld daemon if running RedHat/Fedora users can do so by executing:  service mysqld stop
  3. Run safe_mysqld by executing:

       safe_mysqld –skip-grant-tables

(this will run allow you to connect without a password)

4. Open a second shell / SSH again and execute:

mysql mysql

(to directly connect and select the mysql database which contains the user authentication data)
On the mysql prompt, execute:

update user set password=password(‘newpassword’) where user=’root’;

where newpassword is your newly chosen password.

4. That’s it! close everything and start your mysql daemon again:

service mysqld start

Satya Prakash

VOIP Expert: More than 8 years of experience in Asterisk Development and Call Center operation Management. Unique Combination of Skill Set as IT, Analytics and operation management.

Leave a Reply