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 :

Leave a Reply

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