Forgot your WordPress admin account password? MySQL database background login to retrieve reset/modify

WordPressForgot your administrator account password?

MySQL databaseBackground login to retrieve reset/modify

new mediaPeople often need to register an account to doWeb Promotion, There are so many website account passwords, especially new passwords, it is easy to forget, it is really worth the loss...

What should I do if I forget the password of the WordPress website I built by myself?

Chen WeiliangIn this article, I share 4 ways to quickly retrieve WordPress password, so that everyone can easily recover the forgotten WP account password.

Method XNUMX: Recover Password by WordPress Email

  • log inWordpress backend, click the "Forgot Password" link,
  • Enter username or email address (must be installed when installing wordpress mail),
  • You will receive a link to the activation code in your email.

Wordpress email retrieved the first one

  • This is the easiest WordPress password recovery method.

However, in some cases, the mailbox will not receive the password recovery email because your webhost has disabled the mail() function▼

WordPress forgot password, failed to send email to retrieve password, disable mail() function No. 2

We can change the WordPress account password in other ways.

Method two:phpMyAdminDatabase management, execute SQL statements

step 1:Enter the website virtual host database management (phpMyAdmin) interface, select the database used by the website, and enter the SQL command interface.

MySQL database, enter the third sheet of the SQL command interface

step 2:In the SQL interface, execute the following command ▼

update wp_users set user_pass=md5("123456") where user_login='admin';
  • The password is reset to 123456, we can change 123456 to the password we set by ourselves.

Wordpress database reset password: execute SQL command to modify Wordpress password sheet 4

Method XNUMX: phpMyAdmin database management, reset wp_users table password

step 1:enterMySQLDatabase, find the wp_users data table, click browse ▼

mysql changes the password and finds the fifth sheet of the wp_users table in the WordPress database

step 2:After entering the interface, click the edit button ▼

Click the edit button on the wp_users table sheet 6

step 3:In the user_pass field, select the function MD5, enter the password for the value, and execute it.

WordPress change password function to select MD5 picture No. 7

Alternatively, you can also directly fill in the value of the password user_pass as:

$P$Bq7reNi.JleBGtK057wQBK0vPrY0Cx0

Here is the password:123456

WordPress database reset password: modify user_pass value sheet 8

The login password of the WordPress background is encrypted. When you need to generate a user password, randomly generate a salt, then add the salt and password, then count to md5, and finally add the encode64 hash value to get a password headed by $P$, The result of each password generation is different.

Method XNUMX: Reset password using php file

Copy the code below▼

<?
php
/*你的数据库服务器地址,一般保持默认*/
$servername = "localhost:3306";
/*数据库用户名*/
$phpMyadminUser = "root";
/*数据库密码*/
$phpMyadminKey = "yiduqiang";
/*数据库名称*/
$phpMyadminName = "test";
/*wordpress数据表格前缀*/
$QZ = "wp_";
/*你要设置的wordpress新密码*/
$NewKey = "yiduqiang";
/*你要设置新密码的用户名*/
$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密码找回工具</title>
</head>
<body>
<?php
error_reporting(0);
if(!mysql_connect($servername,$phpMyadminUser,$phpMyadminKey))
{
    echo "对不起,数据库链接出错。<br />";
}
else
{
    echo "数据库链接成功。<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 "对不起,修改密码失败。";
    }
    else
    {
        echo "修改密码成功。";
    }
}
?>
</body>
</html>
  • modifyDatabase Server Address, Database Username, Database Password, Database Name, User New Password, New Password Username(Username must be filled correctly, password can be reset successfully).
  • Then, save as change-wp-password.php file, uploaded to the root directory of the website,
  • Run http://your-domain/change-wp-password.php and you are good to go.

Remember, if you use Method XNUMX to change the WordPress password, be sure to delete the file after the modification, otherwise there will be endless troubles!

What is the best way to change the password of the WordPress administrator account?

  • To modify the WordPress account password, method XNUMX is recommended;
  • If method XNUMX does not work, use method XNUMX to change the WordPress administrator account password.

If you try this a lot, still can'tLog in to the WordPress backend, the solution please see here ▼

Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "Forgot your WordPress administrator account password? MySQL database background login to retrieve reset/modify" to help you.

Welcome to share the link of this article:https://www.chenweiliang.com/cwl-609.html

Welcome to the Telegram channel of Chen Weiliang's blog to get the latest updates!

🔔 Be the first to get the valuable "ChatGPT Content Marketing AI Tool Usage Guide" in the channel top directory! 🌟
📚 This guide contains huge value, 🌟This is a rare opportunity, don’t miss it! ⏰⌛💨
Share and like if you like!
Your sharing and likes are our continuous motivation!

 

10 people commented on "WordPress administrator account password forgotten? MySQL database background login to retrieve reset/modify"

  1. Hello, blogger!
    Woohoo...my wordpress blog has been coming well, but I can't log in to the background recently.
    The user name, password, and login address have not changed. Why is this happening?Is there any way to solve it?I hope you can enlighten me, I would be very grateful!

      1. There are a total of 3 second-level domain names under my blog. At first, only one of the second-level domain names could not be logged in (the blog is normal). In the past few days, I found that even the blog has become like this.So far, only the other two second-level domain names have been logged in normally. What is the problem?I'm getting so depressed...

          1. Without this mode enabled, the second-level domain is in the root folder: a complete reinstallation of the WP program and theme is achieved.

          2. Recall what plugins, theme codes have you installed before?You need to use the renaming method to troubleshoot one by one.

            Do you have an automatic daily backup of your website?If so, simply restore the previous backup, which is the fastest and easiest.

  2. I haven't made any changes to it in days.
    In the past two days, I have changed the password in the database, but I still can't log in.I also tried to re-install the WP program, although I can log in normally, but once I import the original database, I can't log in again.

    1. Most of the problems are caused by WordPress plugins or code. You need to use the plugin renaming method to troubleshoot one by one patiently.

      Also, I'm not sure if the emails sent by Chen Weiliang after commenting on his blog can be sent as usual?

      So, just wanted to ask if you have received an email from me replying to your comment?

Comment

Your email address will not be published. Required fields * Callout

scroll to top