How to change MySQL root password without knowing the old password ?

Sometime we don’t have any idea about the old MySQL root password,but we have to use root password to manage our application so automatically you are going to behind the topic how to change MySQL root password without knowing the old password,here am using Linux os and we have Linux root ssh login details.So lets find out the steps to change root password

1) Stop the server

 #service httpd stop

2) open MySQL section

 #mysql
  How to change MySQL root password without knowing the old password step 1

3) Select Mysql Database

  > use mysql

4) Update root Password Section

>update user SET password=password(“[email protected]”) where user=’root’;

if you are getting error for changing MySQL root password follow steps 5

5) show tables

   > show tables



How to change MySQL root password without knowing the old password step 2

 user table exits

6) Find user table fields

   > describe user
  How to change MySQL root password without knowing the old password step 3
 No password field instead of password we have authentication_string fields

7) Finally update new password

update user SET authentication_string=password("[email protected]") where user='root' 

Leave a Reply

Your email address will not be published. Required fields are marked *