Reset MySQL Root Password

Friday, January 8, 2016

How To Reset MySQL Root Password

when ever you forgot root password of mysql. u can reset via below steps:-

Step 1:- Stop Mysql

            > /etc/init.d/mysqld stop


Step 2:- Start Mysql in safe mode with skip grant option

          > mysqld_safe --skip-grant-tables
   
         OR

         > /etc/init.d/mysqld start --skip-grant-tables


Step 3:- Connect to mysql without any user and password

          >mysql

Step 4:- Use Mysql;

Step 5:- Update Root Password

          > update user set Password=PASSWORD('new-password') where user='root';

Step 6:- flush privileges

           >flush privileges;

Step 7:- exit from mysql prompt
          > exit;

Restart mysql and connect via password. you will get success 

0 comments:

About This Blog

Lorem Ipsum

  © Copyright 2009 Linux-HelpLine.Blogspot.com

Back to TOP