How to Reset the MySQL root password on Ubuntu

If you want to reset the MYSQL root password on Ubuntu then follow the below steps :

1. Stop MySql Service on server

sudo /etc/init.d/mysql stop

2.Configure mysqld on server

sudo mysqld –skip-grant-tables &

3. Login into MySql as root

mysql -u root mysql

4. Reset old password with new

UPDATE user SET Password=PASSWORD(‘NewPassword’) WHERE User=’root’; FLUSH PRIVILEGES; exit;

Note : Replace the NewPassword with the password you want to set .