0

I have installed phpMyAdmin.

I can see the admin user (uid=1) in each of the two databases

I have reset the password using;

update users_field_data set pass=Password("new_password");

I can see that the pass hash has changed confirming a changed password.

I got to http://mysiteURL/user/login and enter the admin name (shown in users_field_data table) and the new password.

Upon submit I only get the border of the login name field changed to red.

I have cleared the sessions table and removed the cache_entity data for uid=1 with no change in behaviour.

yum list | grep -i php

returns a lot of php packages from version 5.6 to 7.3. I am not sure if this is normal but php seems to work since both websites load and I can use phpMyAdmin and phpinfo() returns php7.2.7

I have checked error logs for each website, nginx, drupal and php with no obvious errors.

Curiously drush cli does not work i.e.

./drush uli

sh: module: line 1: syntax error: unexpected end of file sh: error importing function definition for `BASH_FUNC_module' Drupal\Core\Database\ConnectionNotDefinedException: The specified database [error] connection is not defined: default in /app/jbi2/core/lib/Drupal/Core/Database/Database.php:361

I have now resorted to reviewing the Drupal 7 installation steps.

Thanks in advance for any well informed replies.

  • You need to fix your drush installation for starters, then use drush to set the password with ‘user-password’. – Kevin Jun 26 '18 at 11:16
  • Possible duplicate of Cannot login after moving site – No Sssweat Jun 26 '18 at 16:28
1

Drupal 7 and 8 do not use a straight md5 password hash. The hash includes a site specific "salt" string that is created with you set up the site. This is in the settings.php file generally.

To use SQL to set a password, you will need to use the password-hash.sh file which is located in the core/scripts directory.

Run this from your web root directory like ./core/scripts/password-hash.sh` newpassword

Use the string created as the value for your password in query with no Password function.

Re:Drush

You might try running it in the same directory as your site's settings.php file. With D8, some versions of drush have a hard time finding this unless you run it there or set up an alias for the site.

Older version could find it settings.php based on your location (e.g. in a subdirectory of the site directory or would use the sites/default). But newer Drush versions need more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.