How to reset the user password of Drupal 7

Source: Internet
Author: User
Tags drupal

Introduction: This is a detailed page on How to reset the user password of Drupal 7. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 325733 'rolling = 'no'>
Because I haven't logged on to the Drupal 7 website of my local machine for a long time, I found that I have forgotten the admin password. Open phpMyAdmin and want to change the password of the database directly, but it is found that Drupal 7 no longer uses simple MD5 encryption in the Drupal 6 and 5 era. According to a post, because there is an online MD5 database that can find many original MD5 codes, Drupal 7 developers believe that this extremely insecure method cannot be used any more, therefore, Drupal 7 adopts a new hash encryption method to ensure password security.

The new password adding method is the MD5 code of "adding salt (SALT)". Simply put, it means that the password is not directly encrypted by MD5, it will be combined with the user name or other random strings and then MD5 encryption. The specific technical details are not discussed in this article. :-)

The following describes how to change the password (because it is impossible to retrieve the password ).

Under the scripts directory in the installation directory of Drupal 7, there are some PHP scripts prepared by Drupal 7 developers to execute some advanced operations. There is a script named: password-hash.sh, which functions to pass in a password (string) that returns an encrypted password string. Before using PHP, you need to add the php.exe of PHP to the pathenvironment variable of the system. You can directly use php.exe in any directory (I am using the Windows 7 operating system ).

If the password is "ilovedrupal", use the following command to obtain the new password:

 
PHP scripts/password-hash.sh 'ilovedrupal'> new_pwd.txt

This new password is saved in the new_pwd.txt file. After it is opened, the string following the hash is the encrypted password. As follows.

 
Password: 'maid hash: $ S $ cv8wnz0eing3bi19w27wo. uitax. dnyxbimeycshivc8tflvdkb9

The hash string can be used to directly update the users table through phpMyAdmin. If you are using an SQLite database, you must use the sqllite command line client.

However, I encountered a new problem. Because the password was not successfully tested several times at the beginning, after the new password is changed, Drupal still prompts:

Reference sorry, there have been more than 5 failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.

This is because Drupal 7 cannot log on within 6 hours if it fails to log on for five times by default. This information is recorded in the flood table. The solution is to manually clear the flood table.

Clear and use the new password. The logon is successful. I hope to help you.

For more information, visit Dr. Fang's blog: www.fang798.com.

More articles on "How to reset the user password of Drupal 7"

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/325733.html pageno: 13.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.