Six ways to solve WordPress lost password

Sometimes,because this or that reasons,you could lost the WordPress password.If it happened,what can we do to  find the WordPress lost password? There are six methods to get the WordPress lost password.

1.Reinstall WordPress. We do not recommend this method, reinstall the WordPress you would download the WordPress code again and it is too much trouble. It is the worst method.

2.Use the WordPress forgot password feature. WordPress supports mail password recovery feature.If the administrator's e-mail account is valid, in the login interface, click the "forgot your password? " link, after you enter the correct email address, you can receive a password reset message.Then you can reset your WordPress lost password.

3.Delete the WP-config.php file under the WP directory, and then you visit the Web site, which will let you repeat the last installation step, so that you can set a new password of your WordPress.

4.Login phpMyAdmin, find the wp_users table of the WordPress database, here you can see the default user admin,password is encrypted. Now, we can modify this data, find the user_pass field, delete its long data, write down your new password, for example, 123456.Then, you will see a drop down box function, select MD5. This is to encrypt your password with MD5 algorithm, then save. In this way, you can login your WordPress by this password.

5.Use SQL statements to modify the WordPress lost password. Login phpMyAdmin into the WordPress database and execute the following SQL statement:
UPDATE wp_users SET user_pass = MD5('PASSWORD') WHERE wp_users.user_login ='admin' LIMIT 1;

6.Use PHP codes to retrieve the WordPress lost password. PHP method is also using the SQL query statement,but provides a user interface. Copy the following code and save it as password-Reset.php file, upload to your WordPress root directory, and then run this file, enter the password to reset you lost WordPress password.

<?php
//password reset
include("wp-config.php");
include("wp-blog-header.php");
if (empty($_POST['emergency_pass'])) {
?>
<form method="post">
set admin password: <input name="emergency_pass" type="password" />
<input type="submit" />
</form>
<?php
} else {
$sql = "UPDATE ".$wpdb->users." SET user_pass = '".md5($_POST['emergency_pass'])."' WHERE User_login = 'admin'";
$link = $wpdb->query($sql);
wp_redirect('wp-login.php');
exit();
}
?>