How to Change your WordPress Admin Password using phpMyAdmin (Database Method)

If you can no longer access your WordPress admin, for example after a website hack, you can reset your password in the WordPress database using phpMyAdmin.

Most Web Hosting providers allow access to your databases via phpMyAdmin or similar tools. As a 1&1 customer, you can access your databases from within the 1&1 Control Panel using phpMyAdmin.

  • Open the database that is used for your website using phpMyAdmin. Learn how to access phpMyAdmin (1&1 Help Center)
    Tip: The database name is stored in the file wp-config.php. Access your webspace using SFTP and open the file wp-config.php in the root folder of your WordPress website. A search for: DB_NAME will return the database of your website. It should look something like this:
define('DB_NAME', 'db454566683');
  • Open the table prefix_users.
  • Search for your user and then select Edit to the left of the row.
phpMyAdmin Edit Table
  • In the user_pass field, delete the hash value.
  • You must add your new password as a hash value. You can easily generate a hash for your password using tools like the md5 Hash Generator.
wordpress-phpmyadmin-table-edit-details-en
  • Select Save and click OK.

You can now login to your website using the new password (not the password hash :-)).

Alternative: Reset password via email

If you don’t want to work with hashes, you can adjust your email address in the user_email field and then use the WordPress password recovery when logging in to WordPress Admin.

Edit email in phpMyAdmin

You might also like

Please rate this post :

4 thoughts on “How to Change your WordPress Admin Password using phpMyAdmin (Database Method)

  1. Caroline says:

    Hi,
    I’m trying to access to the wordpress admin. Somone has changed my password.
    http://www.taiwantourisme.com/wp-login.php
    Thanks for your precious help.

    1. 1and1help says:

      Hi Caroline,

      if the “forgot my password” function isnt working for you anymore, because a hacker changed not only the password but also the e-mail address of your webspace user, you should follow the steps in the article above.

      If you don’t know how to handle this, you should hire someone who can fix this for you.

      Best regards,
      Michael, 1&1

  2. Hello,

    My name is Tak Bahadur Gurung. I have hosted my website on this hosting.
    Customer ID : 541894950

    I have forget my wp-admin password and also the email address used Admin user.

    I have got the CPanel Access.
    When I go to the Database Section it show , 25 out of 25 free. There is no any Database used on that section.
    I am confused on how and where the Website database is stored. I want to access the PhpMyAdmin to manually change the Password.
    Also couldn’t find the Direct URL for PhpMyAdmin page.

    Please let me know about it,.

    Best Regards,
    Sujan

    1. 1and1help says:

      Hi Sujan,

      you would have to switch your installation from Managed mode into Standard mode. Afterwards you have access to the MySQL database.

      To switch your WordPress to Standard mode, follow this instructions:

      https://help.1and1.com/hosting-c37630/website-building-tools-c85146/wordpress-c85192/switch-managed-wordpress-to-standard-mode-a792802.html

      Best regards,
      Michael, 1&1

Leave a Reply

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