WordPress admin login reset: change the password in phpMyAdmin
· The AYT team · 5 min read

If you can't get into wp-admin and the reset email never arrives, you change the password directly in the database: open phpMyAdmin, find the user in the wp_users table and type a new password into the user_pass field with the MD5 function. WordPress accepts the password at your next login and then stores it in a safer format. It takes 5 minutes and touches nothing else on the site.
Try the normal reset first
On the login page, the "Lost your password?" link (the address /wp-login.php?action=lostpassword) sends a reset link to the account's email address. If the email arrives, use it. It's the simplest way, and you don't need the database.
Most of the time it doesn't arrive for one of two reasons: the account's address is an old one you no longer read, or the site sends no email at all. You fix the second problem separately, once you are back in, with SMTP for WordPress.
Step 1: find the database name and the table prefix
Open the wp-config.php file in the site's folder, from the File Manager or over FTP. You need two values:
define( 'DB_NAME', 'account_1' );
$table_prefix = 'wp_';
DB_NAME is the site's database. $table_prefix is the start of every table name. If the prefix is something other than wp_, for example wpx7_, the users table is called wpx7_users. Below we write wp_; use your own prefix.
Step 2: open the users table in phpMyAdmin
- Open phpMyAdmin from your hosting panel.
- On the left, pick the database from
DB_NAME. - Open the
wp_userstable. There is one row per user, withuser_login(the username) anduser_email.
If you don't remember the username either, you'll find it here, in the user_login column. The address in user_email also works at login.

Step 3: set the new password
- On your user's row, click "Edit".
- In the
user_passfield, chooseMD5in the "Function" column. - In the "Value" column, delete the long text that's there and type the new password in plain text.
- Click "Go".
phpMyAdmin stores the MD5 hash of the password in the database, not the plain password. Since WordPress 6.8 new passwords are stored with bcrypt, but WordPress still accepts an old MD5 hash. After the first successful login it replaces it with a bcrypt hash on its own.
The same thing as an SQL query, from the database's "SQL" tab:
UPDATE wp_users
SET user_pass = MD5('a-long-new-password')
WHERE user_login = 'your-username';
The query stays in phpMyAdmin's history with the password in plain text. Use a temporary password and change it from your profile as soon as you are in.
Step 4: log in and set the final password
Go to /wp-admin with your username and the new password. Then:
- change the password under Users → Profile to one generated by WordPress or by a password manager;
- check the email address in your profile, so the normal reset works next time;
- look through Users → All Users for administrators you don't recognise.
If the password is right and you still can't get in
Sometimes the problem isn't the password. A few situations that look the same:
The login page keeps reloading
You enter your details, the page reloads and you're back at the form. It's usually old cookies (try a private window) or different addresses in the siteurl and home settings in the wp_options table, for example one with www and one without. The details are in the article on ERR_TOO_MANY_REDIRECTS.
A security plugin blocks you
Some plugins block your IP address after a few wrong passwords, or move the login page to another address. Disable the plugin by renaming its folder in wp-content/plugins/, for example by adding -off to the end of the name, then try again.
The account is no longer an administrator
If you get in but don't see the admin menus, the account has lost its role. That rarely happens by mistake. More often, someone got into the site and changed the roles or created another administrator. In that case, don't stop at resetting the password: follow the steps for a hacked WordPress site.
You see "Error establishing a database connection"
Then you can't even reach the form, because the site can't connect to its database. The admin password has nothing to do with this error; see how to fix the database connection.
Frequently asked questions
Do I lose anything by changing the password in phpMyAdmin?
No. You change one field of one user. Posts, settings and other users stay as they were. That user's open sessions on other devices are signed out.
Can I do this without phpMyAdmin?
Yes, if you have command-line access, with WP-CLI (wp user update). On hosting without SSH, phpMyAdmin is the usual way. If you haven't used it before, read the phpMyAdmin guide for beginners first.
On AYT hosting
On AYT you don't need phpMyAdmin for this. In the WordPress Toolkit, your site's login button takes you straight into wp-admin with no password, and the Users tab lists the site's users: you change anyone's password or role from the panel. If you prefer the database, phpMyAdmin opens from the panel without another password.
Every plan, the free one included, has the WordPress Toolkit and phpMyAdmin. Details on the WordPress hosting page.
