How to Reset MySQL root Password in Ubuntu Linux

Stop MySQL service 
sudo service mysql stop

Or, Kill MySQL process
sudo kill -9 pid_of_mysql

Enable MySQL safe mode
sudo mysqld_safe --skip-grant-tables &

Login to MySQL 
mysql

Chnage MySQL passwor 
UPDATE mysql.user SET Password=PASSWORD('PASSWORD_HERE') WHERE User='root';
flush privileges;
exit;

Start MySQL service
sudo service mysql start
Share on Google Plus

About Penguin Technology

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment