Clone index.php file and create new file with following coding. I have highlighted the changes by adding comments. Replace the password you want to set and try to open in the url.
You will get hashed version of your password. Now, I assume you have database access if you’re making such changes on file level. Go to PHPMyAdmin or If you’re daring on console and replace the pass under user_field_data
table.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <?php use Drupal\Core\DrupalKernel; use Symfony\Component\HttpFoundation\Request; $autoloader = require_once 'autoload.php'; // LXT - Code Start // Password list to be processed. $passwords = [ 'yourpassword' ]; $request = Request::createFromGlobals(); $kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod', FALSE); $kernel->boot(); $password_hasher = $kernel->getContainer()->get('password'); foreach ($passwords as $password) { print("\npassword: $password \t\thash: " . $password_hasher->hash($password) . "\n"); } print("\n"); // LXT - Code End |
Further, There could be changes, you’re still getting Invalid Logins.
Clear out the following tables:
flood
cache_entity
Don’t worry, We are not deleting something important in Drupal. Flood table basically block the IP which tried many failed attempts on login screen and cache_entity is related to cached version of Drupal copy, you might be getting.
Don’t forget to write us down if still issue persist. You can write to us or comment. We are in Drupal Development too. We can develop and design sites based on the client’s requirements. Our expert will get in touch with you and assist you on your issue.