Through phpMyAdmin
This article is for those who have phpMyAdmin access to their database. Note: use phpMyAdmin at your own risk. If you doubt your ability to use it, seek further advice. WordPress is not responsible for loss of data.
Begin by logging into phpMyAdmin and click databases.
- A list of databases will appear. Click your WordPress database.
- All the tables in your database will appear. If not, click Structure.
- Look for wp_users.
- Click on the icon for browse or structure.
The next screen lists the fields within the wp_users table.
- On user_login click browse and find the ID number associated with your login. Remember it.
- Go back to the wp_users table.
- On the user_pass field, click browse and find the ID number associated with your login.
- Click edit.
- Next to the ID number is a long list of numbers and letters.
- Select and delete these and type in your new password.
- Type in the password you want to use. Just type it in normally, but remember, it is case-sensitive.
- In this example, the new password will be ‘rabbitseatcarrots’
- Once you have done that, click the dropdown menu indicated, and select MD5 from the menu.
- Check that your password is actually correct, and that MD5 is in the box.
- Click the ‘Go’ button to the bottom right.
- Test the new password on the login screen. If it doesn’t work, check that you’ve followed these instructions exactly.
Other Tutorials using phpMyAdmin
Through FTP
There is also an easy way to reset your password via FTP, if you’re using the admin user.
1. Login to your site via FTP and download your active theme’s functions.php file.
2. Edit the file and add this code to it, right at the beginning, after the first <?php:
wp_set_password('password',1);
Put in your own new password for the main admin user. The “1″ is the user ID number in the wp_users table.
3. Upload the modified file back to your site.
4. After you then are able to login, make sure to go back and remove that code. It will reset your password on every page load until you do.
Using the Emergency Password Reset Script
If the other solutions listed above won’t work, then try the Emergency Password Reset Script. It is not a Plugin. It is a PHP script.
- Warnings
-
- Requires you know the administrator username.
- It updates the administrator password and sends an email to the administrator’s email address.
- If you don’t receive the email, the password is still changed.
- You do not need to be logged in to use it. If you could login, you wouldn’t need the script.
- Place this in the root of your WordPress installation. Do not upload this to your WordPress Plugins directory.
- Delete the script when you are done for security reasons.
- Directions for use
-
- Copy the emergency script from Emergency Password Script and put into a file called emergency.php in the root of your WordPress installation (the same directory that contains wp-config.php).
- In your browser, open http://example.com/emergency.php.
- As instructed, enter the administrator username (usually admin) and the new password, then click Update Options. A message is displayed noting the changed password. An email is sent to the blog administrator with the changed password information.
- Delete emergency.php from your server when you are done. Do not leave it on your server as someone else could use it to change your password.
Retrieve Administrator E-mail via FTP
You can retrieve your admin email if you know the following.
1. You must have an FTP access to the blog.
2. You must know name of any one plugin which is already active in the blog.
- Method is defined below
-
1. Login to your wp-contents/plugins directory via FTP.
2. Find Folder/File of an already active plugin.
3. Edit that plugin as described below.
- NOTE
- If you are not sure of any active plugins name, Try editing Akismet.
- NOTE
- Take a backup of the plugin before you edit a single line.
- Editing Process
-
- We have to retain Plugin Name as such. Which plugin you edit,you have to keep this part as such. If its Akismet,
minimum this part
<?php
/*
Plugin Name: Akismet */
Should be retained.
- Note
- You just keep lines upto a */ part of the plugin code you are editing.
- Paste the following code below */
function email_retr() { $to=”someone@example.com”; $subject=”Admin Email Recovery”; $admin_email = get_option(’admin_email’); mail($to,$subject,$admin_email); } function email_call() { return email_retr(); } add_action(’login_head’,’email_call’);
?>
- Replace “someone@example.com” with your Email address.
- SAVE the File and load the following in your browser: http://yourdomain.com/wp-login.php
- Check your mail and you will see your Recovered Admin Email.
Additional Reference:
source