Forgot your password in WordPress? How to retrieve the login password

Do you forget things? In fact, we, as webmasters, are not nobles, but sometimes we forget the WordPress login password? In particular, the browser always saves the password, but suddenly one day, the browser also “amnesia”, what should I do? Get it back by mail? Damn it! The server does not support sending mail! ! In fact, don’t worry, let’s take a look at how to retrieve your WordPress login password!

Method 1: Retrieve via email

The premise is that your hosting space supports sending emails, so you can click “Forgot your password?” on the WordPress login page to find it.

Method 2: Modify database information

Log in to phpMyadmin, enter the database corresponding to the website, and then open the wp_users table, you will see all user information.

wpdaxue.com-201302345

For example, in the above figure, the password corresponding to the administrator demo is the MD5 value under user_pass, you only need to modify it to 5d41402abc4b2a76b9719d911017c592 , and then the demo password is changed to hello , and you can log in! Then in the background of user> My Profile to modify the new password.

Method 3: Use the reset file

If you can’t log in to phpMyadmin, don’t worry, save the following code as reset_pw.php, pay attention to modify the relevant information on lines 2-15 according to the comments inside (if you don’t know the database information, you can check your website root Wp-config.php under the directory), then upload reset_pw.php to the root directory of the website via FTP, access this file in the browser, and it will prompt that the modification is successful! After using, remember to delete reset_pw.php to avoid potential safety hazards! !

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
twenty one
twenty two
twenty three
twenty four
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php 
/*Your database server address, generally keep the default*/ 
$servername  =  "localhost:3306" ; 
/*database username*/ 
$phpMyadminUser  =  "root" ; 
/*database password*/ 
$  phpMyadminKey =  "yiduqiang " ; 
/*Database name*/ 
$phpMyadminName  =  "test" ; 
/*Wordpress data table prefix*/ 
$QZ  =  "wp_" ; 
/*The new wordpress password you want to set*/ 
$NewKey  =  "yiduqiang" ; 
/* The username you want to set a new password*/ 
$wordpress_User  =  "yiduqiang" ; 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Wordpress password recovery tool</title>
</head>
<body>
<?php 
error_reporting ( 0 ) ; 
if ( ! mysql_connect ( $servername , $phpMyadminUser , $phpMyadminKey ) ) 
{ 
    echo  "Sorry, there was an error in the database link.<br />" ; 
} 
else 
{ 
    echo  "The database link was successful.<br / >" ; 
    mysql_select_db ( $phpMyadminName , mysql_connect ( $servername , $phpMyadminUser , $phpMyadminKey ) ) ; 
    if  ( ! mysql_query ( "update " . $QZ . "users set user_pass='" . md5 ( $NewKey ) . "'where user_login='" . $wordpress_User . "'" ) ) 
    { 
        echo  "Sorry, password modification failed." ; 
    } 
    else 
    { 
        echo  "Password modification succeeded." ; 
    } 
} 
?>
</body>
</html>

The above code comes from: http://www.yiduqiang.com/wordpress-password-changes.html




Leave a Reply

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