How to change the Wordpress administrator password from the database

How to change the Wordpress administrator password from the database

The access credentials to the WordPress administrator are stored in the database assigned to it, so it is possible to modify them by following several steps:
 
First of all, we must access phpMyAdmin from our control panel to manage the WordPress database (How to access phpMyAdmin)
 
Once inside, we will need to go to the WordPress users table as shown in the following image:
 
 
Here you will see the databases created in your hosting account along with their respective tables.
 
You must select the corresponding database and go to the "wp_users" table.
 
 
Once inside, a list of users created in your WordPress will appear. If you have never created another one, only one will appear — the administrator:
 
 
To edit the login credentials, click on "Edit" in the section of that same user:
 
 
Next, the window to edit that user will open. You must go to the "user_pass" field:
 
 
Here you must enter the password you want in the "Value" column, and in the "Function" column you must select MD5:
 
 
Finally, save the changes by clicking on "Continue" in the bottom right corner:
 
 
Now, if you try to log in with the new password, you will be able to access correctly.
 
IMPORTANT: Sometimes saving the password in MD5 does not work correctly. That is, phpMyAdmin saves it properly but does not allow access with the entered password. For those cases, below we provide a text code. You only need to create a file inside your hosting account and insert into it the password you want to assign:
 

MD5 Password Generator
 
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>MD5 Password Generator</title>
</head>
<body>
    <h1>MD5 Password Generator</h1>
    <form method="get">
        <input type="text" name="pass" placeholder="newpassword" required>
        <input type="submit" value="Submit">
    </form>

    <?php
    if (isset($_GET['pass']) && $_GET['pass'] !== '') {
        $pass = $_GET['pass'];
        $md5 = md5($pass);
        echo "<p>Your new MD5 password is: <strong>$md5</strong></p>";
    }
    ?>
</body>
</html>

Finally, you only need to access the file you created with this text from your browser. We have named it md5test2.php and uploaded it to our hosting:
 

Here you just need to enter the password you want and click "Submit", and it will automatically generate the password in MD5 format.
 
Finally, copy this generated code and return to phpMyAdmin. Paste it into the "user_pass" section, select MD5 as indicated in the previous steps, save the changes, and the password change will be completed.
 
 
For more information, you can  contact us.
    • Related Articles

    • How to change the WordPress administrator password from wp-admin

      In this guide, we will show how to change your WordPress user password from /wp-admin, that is, from your WordPress admin panel. Your administration folder does not necessarily have to be called /wp-admin, but by default this is the name of the ...
    • How to access the WordPress administrator installed in cdmon

      A default WordPress installation provides access to its administrator panel through the /wp-admin folder. If you installed WordPress from our control panel, the folder will be exactly the same. To access the administration area, you must enter your ...
    • Most common Wordpress errors

      WordPress is a CMS application with a wide range of different applications and functions, which means there are also many errors that can be generated by them. In this guide, we show the most common and generic errors that WordPress may display: ...
    • How to change the Prestashop administrator user password (Backoffice)

      From the PrestaShop database, you can manually modify the PrestaShop administrator password (also known as Back Office) without needing to log into the admin panel itself. To do this, the first step is to obtain the cookie_key of your PrestaShop in ...
    • How to know which database my WordPress uses

      If you want to know which database your WordPress website is using, there are several ways to do it. Below, we provide a step-by-step guide to identify your WordPress site's database from the wp-config.php file of your WordPress: The wp-config.php ...