Passwords are very important in order to keep our accounts secure. But sometimes we may forget our password or may need to change the password. Here I will point out some common ways to reset WordPress admin password. We can reset WordPress admin password using different methods:
- Using phpMyAdmin
- From MySQL command prompt
- Through WordPress interface
Using phpMyAdmin
1. Log into cPanel and select phpMyAdmin under Databases section.
2. Once you’re inside phpMyAdmin, select the database that you’re using for your WordPress installation ( The Db name is specified in wp_config.php file )
3. Then select the table called wp_users. (wp_ is the default prefix. If you have a chosen a custom prefix at the time of WordPress installation this will be different).
4. Once the table is loaded, look for the username you had chosen while installing as WordPress Admin and click on “Edit” (the little pencil icon near to the admin username).
5. Look for the row named user_pass (usually the third one) and make the following changes.
- Under the Function field, set it to MD5.
- Under the Value field, enter your new password.
- Click on Save Changes and click on “Go”.
From MySQL command prompt
1) Log into MySQL
mysql -u root -p
2) Once you have logged into the mysql enter the database that is being used by wordpress installation
mysql> use wordpress_databasename;
3) Now run the following commands;
mysql> SELECT ID, user_login, user_pass FROM wp_users; #(assuming custom prefix is not set) mysql> UPDATE wp_users, SET user_pass = MD5('new password') WHERE ID = ('ID of the account which you need to reset the password');
Through WordPress interface
- Log into your WordPress admin panel and go to users.
- Click on the edit button under your username.
- In the Edit User screen, scroll down to the New Password section and type in a new password in the two boxes provided.
- Click on the update profile button.