How to reset mysql root user password

This blog will guide you on how to reset myql 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;
Share this nice post:

One thought on “How to reset mysql root user password

  1. I just want to say I’m all new to blogs and truly liked this blog.You absolutely come with remarkable article content. Many thanks for sharing with us your web site.

Comments are closed.