1. Knowledge Base
  2. >
  3. Results
  4. >
  5. How to Log Into Drupal 7 & Retrieve Lost Password

How to Log Into Drupal 7 & Retrieve Lost Password

You can log in to your Drupal website by going to:

http://exampledomain.com/?q=user

Be sure to replace exampledomain.com with your domain name.

If Drupal was installed on the primary domain and pretty URLs was previously enabled, you also can use the following URL:

http://exampledomain.com/user

If Drupal were installed in a folder instead, you would need to add the folder's name to the URL, like so:

http://exampledomain.com/thefolder/?=user

Once there, enter your username and password.


Request a New Password

Sorry, unrecognized username or password. Have you forgotten your password?

If you have forgotten your Drupal password, the easiest way to regain access is to use the new password feature built into Drupal.

  1. Click on the Request new password tab on the login page.

    Drupal Request new password

  2. Enter your email address or Drupal username, and then click on the E-mail new password button.

    Drupal E-mail new password button

    The page will refresh and display the following message:

    Drupal Successful Message

  1. Check your email for your replacement login information.

    Drupal replacement login information

  2. Click on the link in the email.  This link can only be used once.
  3. Once on the page, click on the Log in button.

    Drupal Log in button

  4. Enter a new password in the fields provided.

    Drupal new password in the fields

  5. Click the Save button. The page should refresh and display the following message:
The changes have been saved.

You are now logged in to Drupal 7. Be sure to use the password you just set to log in in the future.


Manually Resetting Your Password

Unlike WordPress and some other scripts, you cannot reset the password directly in the database; instead, you have to change the email to one that works and then reset the password via Drupal's request new password feature.

Didn't get the Email?

If you did not get the email or the email you specified for that username is no longer valid, it is possible to manually change the email address in the database so that you may request a new password. You would need access to your cPanel for this.

Step 1: Figuring Out Which Database

Before changing your email address in the database, we will need to locate the Drupal database. If you only have one database, one Drupal installation, or you already know the name of the database or think you can figure it out easily, then skip to step 2.

Follow these steps to find out the database.

  1. Log in to cPanel.
  2. In the Files section, click on the File Manager icon.

    Control Panel File Manager

  3. Locate the Drupal installation in the file system.  If you installed Drupal in the main folder of the primary domain, you should already be looking at the Drupal files.
    • If you installed it in a subfolder or an addon domain, you would need to navigate to the appropriate folder. You can use the list of folders on the left or use the files and folders in the middle/right.  (As an example, if you installed Drupal in the drupal7 folder, you would double-click on the blue folder icon next to drupal7 in the middle/right. That would take you inside the folder and show you Drupal's files.)
  4. Double-click on the folder for sites.
  5. Double-click on the folder for default.
  6. Right-click on the file settings.php and then select Edit.
  7. A dialog box will pop up called Code Editor. Click the Edit button.
  8. Ignore any gray lines beginning with an asterisk (*)  as this indicates the line is a comment.
  9. Scroll down until you find the line that says something similar to: 'database' => 'user_drp71', where user_drp71 would be whatever your database name is.  Write down or remember this database name, as you will need it in the next step.
  10. You can then close the code editor and close the file manager—no need to save anything since nothing should have been changed here.
Note: The password line in this file is NOT your Drupal password. Do not change the password in this file; otherwise, your Drupal installation will stop working.

Step 2: Fixing the Email Address

To manually change your email address in the database so you can reset your password, please follow these steps:

  1. Go back to the cPanel.
  2. In the Databases section, click on the phpMyAdmin icon.  This will open phpMyAdmin in another window or tab.

    Control Panel PhpMyAdmin

  3. Find the database in the left column and click on its name.
  4. Navigate on the right side of the screen to find the user's table in the list of tables.
  5. Immediately to the right of the table drupal_users, click on the Browse button.

    PhpMyAdmin Users Browse

  6. Find the username you want to reset in the list of users. If you have a lot of users, expect to navigate multiple pages to find the user you want.
  7. Click on the Edit icon next to the user you want to reset the password for.

    PhpMyAdmin Users Edit

  8. Locate the mail category in the first column. Next to mail, you will see the email that is currently set for this user.

    PhpMyAdmin Users Email Edit

  9. Change the email address to a valid working email address.
  10. Click the Go button near the bottom of the page.
  11. Follow the directions in the Request a New Password section for requesting a new password.