Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Recovering Drupal Admin Password from From database

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 524
    Comment on it

    If we forget administrator password in Drupal then it is very easy to recover it using Email or Drush. But situation get tougher when we don't have Drush and email notification enabled. In this way only database update query is the best way but you must have database access for it.

    Use the following query for Drupal 6:

    UPDATE users SET pass = MD5('newpassword') WHERE uid=1;
    

    And for Drupal 7:

    Step 1: Execute the following commands from the command line, in the Drupal root directory:

    ./scripts/password-hash.sh newpassword
    

    Or for Windows:

    php .\scripts\password-hash.sh newpwd
    

    But make sure that php path is right in the first line of /scripts/password-hash.sh file.

    Step 2: Execute following query in database:

    UPDATE users SET pass ='output_from_step1' WHERE uid = 1;
    

    I hope this will help.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: