Categories
Coding PHP

Two simple way to Reset the Root Password – MySQL/wamp server

XAMPP-Wamp-server

In MySQL, password can be change by various method. Here I am using two methods:-

  1. By using command line
  2. By using mysql command prompt

If you have already a password, then the old password will be your password which is already set for user root. After the flush privileges it will automatically reload the updated password.

Reset password in MySQL

[divider]

Method 1: By using command line

The basic steps for open a command line are:

  1. GoTo start menu
  2. Enter cmd (a command line is opened).
  3. Enter cd "c:\program files\MySQL\MySQL Server 5.0\bin"
  4. c:\program files\MySQL\MySQL Server 5.0\bin > mysql –u root –p
  5. Enter password:     //if you have already a password then write here otherwise blank
  6. Mysql> use mysql ;
  7. Mysql> update user SET password="" where password="old password" and user="root";
  8. Mysql> flush privileges;

 

Method 2: By using mysql command prompt

The basic steps for reset password using mysql command prompt are:-

  1. Mysql> use mysql ;
  2. Mysql> update user SET password="" where password="old password" and user="root";
  3. Mysql> flush privileges;

 

After performing all steps restart your system.

 

Reset password in Wamp Server

[divider]

Method 1: By using command line

  1. GoTo start menu.
  2. Enter cmd.
  3. Use cd  "wamp\bin\mysql\mysql5.5.24\bin"  
  4. C:\wamp\bin\mysql\mysql5.5.24\bin>mysql -u root -p
  5. Enter password:   //if you have already a password
  6. Mysql> use mysql ;
  7. Mysql> update user SET password="" where password="old password" and user="root";
  8. Mysql> flush privileges;

 

Method 2: By using mysql command prompt

1) Mysql>  use mysql ;
2) Mysql>  update user SET password="" where password="old password" and user="root";
3) Mysql>  flush privileges;

 

NOTE:-
After perform all above process change in below file :-

1) C:\wamp\apps\phpmyadmin3.5.1\config.inc
2) In config.inc search for line $cfg[‘Servers’][$i][‘password’] = ‘ ‘  and put here your password.
3)  Put wamp server online and restart all services.
4) Restart your system after performing all tasks.

By Akshma Sharma

Web & PHP Developer, with a zeal experience of web and application development on various platform like Android, iOS, PHP, MySQL, CMS, Wordpress, Joomla, Magento and Drupal.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.