Reset MySQL root Password

To reset MySQL root password, stop MySQL

service mysql stop

Start MySQL with

mysqld_safe --skip-grant-tables

Start another terminal, login to MySQL as root

Advertisement

mysql -u root

Run following commands to change password.

update mysql.user set password=PASSWORD("PASSWORD_HERE") where User='root';
flush privileges;
quit

Now you need to kill running MySQL processes and start MySQL as normal.

killall mysqld_safe
killall mysqld

Restart MySQL

service mysql start
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement