Cannot login to Drupal admin or reset password

2019-08-24 03:03发布

问题:

I cannot login to Drupal admin or reset password. What could I do?

I am using xampp. Here is what I tried.

1 Go to http://127.0.0.1/doesnotmatter/user. I tried to provide Username and Password I am very sure that I am trying out the correct credentials, but it still tells me Sorry, unrecognized username or password. Have you forgotten your password?.

2 I tried to reset the password and after providing the correct Username I am getting redirected to login page with the message shown Unable to send e-mail. Contact the site administrator if the problem persists.

What else may I try?

I have a direct access to everything and the highest privileges possible in the Drupal project, since I deploy it locally using xampp.

May it be that I have to enable some of the xampp modules in Control Panel? For example, FileZilla, Mercury or Tomcat?

Thank you.

回答1:

I think you should change password to login now.

Option 1: If you are using Drush, you can use the user-password command to update password.

drush user-password usernamehere --password="newpasswordhere"

Option 2: If you have access of database then try with below query.

update users set pass=md5(’NEWPASS’) where uid = 1; // uid 1 is for admin role. 


回答2:

You could:

  • try to set smtp server so drupal can send you that mail for changing the password

  • try to login to original site with credential you have. if they works there they must work at your local site.

  • You could setup another site locally. Use the same files (same "secret" string and similar). Then create an user there and copy it's data (username, hashed password, basically whole user record) to your problematic site and then try to login.



回答3:

maybe if you reset your password it's work

you can reset password using drush :

drush upwd USERNAME PASSWORD