MySql: How to reset mysql root user password
This article will guide you on how to reset mysql root user password.
Quick and easy four steps to Set / change / reset the MySQL root password on Ubuntu Linux.
Step 1: Presumming mysql process is running now stop the mysql server
by executing following command.
sudo /etc/init.d/mysql stop
Step 2: Now start the mysqld with skip grant tables this will allow us to login mysql without password.
sudo mysqld –skip-grant-tables &
Step 3: Now login to MySQL as root user, execute following command on terminal. It will show you the mysql prompt.
mysql -u root mysql
Step 4: Reset root user password.
UPDATE user SET Password=PASSWORD(‘YOURNEWPASSWORD’) WHERE User=’root’;
FLUSH PRIVILEGES;
exit;