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

Post a Comment

Mới hơn Cũ hơn