Something Different In Linux

Home » How to » Reset MySQL root Password

Reset MySQL root Password

Posted by Rishikesh Vispute Categories: How to, mysql

If you have forget the mysql root password and you are not able to access your mysql service then you need to reset the password of mysql root user by using following steps

Ans :

1)root@server [~] /etc/init.d/mysqld stop

2) Start to MySQL server without password:

root@server [~] mysqld_safe --skip-grant-tables &

3) root@server [~] mysql

After that you can get the mysql prompt then run the following command

4) mysql >use mysql;

5) mysql >update user set password=PASSWORD("NEWPASSWORD") where User='root';

6) mysql > quit

7) root@server [~] /etc/init.d/mysqld stop

8) root@server [~] /etc/init.d/mysqld start

Now you can access your mysql service by using

[root@server ~]# mysql -u root -p


One Response so far.

  1. Hello, Thanks for comment and I want to share more information to client.

Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...