Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Reset / Recover MySQL root Password / MySQL / Linux  (Read 2432 times)

0 Members and 1 Guest are viewing this topic.

Haripriya H

  • Guest
Reset / Recover MySQL root Password / MySQL / Linux
« on: November 01, 2013, 09:56:27 pm »
There are many cases that we used to forget root password of MySQL, So Perform just few steps and you will able to reset root mysql password.

Perform below steps to Recover / Reset MySQL Password.

1. Stop MySQL Service

[root@linux-support-ahmedabad-tejas-barot ~]# /etc/init.d/mysqld stop

2. Execute Following Command

[root@linux-support-ahmedabad-tejas-barot ~]# mysqld_safe --skip-grant-tables and Press ENTER

3. Now Let’s Login to MySQL Without Password

[root@linux-support-ahmedabad-tejas-barot ~]# mysql -u root

4. Use Following Queries to Reset/Change your MySQL root Password

mysql> use mysql;
mysql> update user set password=PASSWORD(“NEW-MYSQL-ROOT-PASSWORD”) where User=’root’;
mysql> flush privileges;
mysql> quit

5. Let’s Stop MySQL Server as we have started in Step 2

[root@linux-support-ahmedabad-tejas-barot ~]# service mysqld stop

6. Now Start MySQL Service for using Databases

[root@linux-support-ahmedabad-tejas-barot ~]# service mysqld start

7. Execute Following Command to Login with New Password

[root@linux-support-ahmedabad-tejas-barot ~]# mysql -u root -p

Hope this will helps you all  !!
Enjoy MySQL  :)