Few Simple steps to change your MySQL root password.
Few Simple steps to change your MySQL root password.
# service mysql stop
wait until MySQL shuts down. Then run
# mysqld_safe –skip-grant-tables &
Then you will be able to login as root with no password.
# mysql -uroot mysql
In MySQL command prompt issue the following command:
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
At this time your root password is reset to “NEW-ROOT-PASSWORD” set by you and MySQL will now know the privileges and you’ll be able to login with your new password:
mysql -u root -p NEW-ROOT-PASSWORD mysql
Note: NEWPASSWORD is the your desired password, or the password you which to set for root.
|