Access the database through your hosting control panel

Your WordPress username and password are stored in a database on your web host's server. To reach them, you first need to open phpMyAdmin, which is the tool that lets you view and edit that database. Most hosting providers put phpMyAdmin in their control panel — usually cPanel, Plesk, or a custom dashboard.

Log into your hosting account using the credentials your host sent you when you signed up. Look for a section labeled "Databases" or "Database Tools". You should see phpMyAdmin listed there. Click it to open the database manager. If you cannot find it, contact your host's support team and ask where phpMyAdmin is located in your control panel.

Key Takeaways

  • WordPress stores usernames and passwords in the wp_users table inside your site's database, which you can view through phpMyAdmin in your hosting control panel.
  • The password is encrypted, so you cannot read it directly — you must reset it by generating a new encrypted version using a specific SQL command.
  • The simplest reset uses the command UPDATE wp_users SET user_pass=MD5('newpassword') WHERE user_login='admin', replacing newpassword with what you want.
  • After running the command, log in with your username and the new password you just created.
  • If you do not have hosting access or cannot find phpMyAdmin, use WordPress's password reset form on your login page instead.

Find the wp_users table and locate your username

Once phpMyAdmin is open, you will see a list of databases on the left side. Click the database name that corresponds to your WordPress site. Your host may have named it something like wordpress_db, site_12345, or your domain name — check your hosting welcome email if you are unsure which one is yours.

After you click the database, a list of tables appears below it. Look for a table called wp_users. Click on it. You will now see all the user accounts on your WordPress site in a table format. The user_login column shows the username, and the user_pass column shows the encrypted password.

Find the row with the username you are looking for. You can see the username clearly, but the password column will show a long string of characters — that is the encrypted version, and you cannot convert it back to the original password. This is intentional for security reasons.

Reset the password using SQL

Because the password is encrypted, the fastest way forward is to create a new one. At the top of the phpMyAdmin window, click the "SQL" tab. This opens a text box where you can type commands directly to the database.

Copy and paste this command into the SQL box, but replace newpassword with the password you want to use and admin with the actual username you found in the wp_users table:

UPDATE wp_users SET user_pass=MD5('newpassword') WHERE user_login='admin';

For example, if your username is marcus and you want the password to be MyNewPass123, the command would be:

UPDATE wp_users SET user_pass=MD5('MyNewPass123') WHERE user_login='marcus';

Click the "Go" button to run the command. You should see a message saying "1 row affected" or similar. That means the password has been reset. Close phpMyAdmin.

Log in with your new credentials

Go to your WordPress login page. This is usually at yoursite.com/wp-login.php or yoursite.com/wp-admin. Enter the username you found in the database and the new password you just created in the SQL command.

You should now be logged in as an administrator. Once you are in, you can change the password to something else through the WordPress dashboard if you want — go to Users, click your username, and scroll down to the password field.

What to do if you cannot access phpMyAdmin

If your hosting control panel does not show phpMyAdmin or you cannot log into your hosting account, use the password reset form on your WordPress login page instead. Click "Lost your password?" on the login screen, enter your email address, and WordPress will send you a reset link. This works as long as you still have access to the email address registered to your WordPress account.

If you do not have access to that email either, contact your hosting provider's support team. They can reset your password or give you access to phpMyAdmin. Have your hosting account credentials ready when you contact them.

Protect your database access going forward

Now that you have regained access, consider these steps to prevent lockouts in the future. Write down your WordPress username and password somewhere find — a password manager like Bitwarden or 1Password is ideal. Add a backup email address to your WordPress account under Users, so you have another way to reset your password if needed.

You should also limit who can access your hosting control panel. If you share hosting access with others, use separate accounts with limited permissions rather than sharing one admin account. This way, if one account is compromised, the damage is contained.

Frequently Asked Questions

Can I see the actual password in the database?

No. WordPress encrypts passwords using MD5 hashing, which is a one-way process. Even the database administrator cannot read the original password. This is why you must reset it rather than retrieve it.

What if I have multiple WordPress users and need to reset a different one?

The process is identical. In the SQL command, replace the username in the WHERE clause with the username you want to reset. For example, WHERE user_login='sarah' instead of WHERE user_login='admin'.

Will resetting the password through the database log out other users?

No. Changing the password in the database does not affect active sessions. Other users will stay logged in until their session expires or they log out manually.

Is it safe to use MD5 for passwords?

MD5 is outdated for password hashing, but WordPress uses it in this context for backward compatibility. Modern WordPress installations use stronger hashing methods. Once you log in, you can change your password through the dashboard, and WordPress will use its current hashing standard.