I have just created a new drupal8 site for testing purposes and for some reason I cannot login with the admin password or username.

I tried changing the password in phpMyAdmin using MD5. That didnt work so I tried reinstalling the site and got the same problem. 

The site is on a Godaddy server and is in a subfolder. Standard settings. Simple installation.  The site appears to work though will not login.  

Anyone know the solution to this?

Comments

VM’s picture

MD5 won't work as the password is salted in the database and has been since Drupal 7 was released.

see https://www.drupal.org/node/2778219 for one method of resetting the password via a script.

That said, the need to reset the password doesn't seem to be the issue here as installing a new site shouldn't cause the same issue. My first thought is that because you are installing into a subdirectory which indicates that your url is domain.com/subdirectory/ that you will need to set rewrite base in .htaccess. It would help if you took the time to elaborate on what the paths look like, particularly along the log in process and if you aren't being logged in what is happening? empty login form being returned?

Firehawk777’s picture

Thanks. I am quite forgetful as I have of course run into the salting issue with D7 years ago.  You have already given me the help I needed to fix the issue.

Nice little code you showed me. 

For anybody reading this don't forget to delete the file after use. 

As you are such great help I will explain. 

The site simply would install correctly though would not log in using the password I entered and double checked twice. The site behaved just as a standard fresh install in every other way though. I did install it using my production servers install rather than drush/composer method I have been using which I think is possibly the issue. I may even reinstall just to test this.

It was a demo site to make sure custom modules I make for my customers and I run on my local are running as expected online before I put them to my production sites. So it helps me immensely.

Thanks again VM.

 

 

tormi’s picture

Simple drush command to rescue:

drush uli
sunilpawar’s picture