I have recently copied a site from a client server and set it up on an AWS EC2 instance. The front end of the site works fine, however when trying to log into the backend, I receive the error "You did not sign in correctly or your account is temporarily disabled".

I have already tried unlocking the account as suggested in another similar thread here, and when I tried creating a new user through the CLI, I receive the following error:

SQLSTATE[HY000] [2002] Connection refused

Any ideas?

  • 1
    maybe try to unlock your user directly via the database. there's a "admin_user" table with "failures_num", "first_failure" and "lock expires". You can try to set them to "0","NULL","NULL".I have not tested this, but probably worth a try. And ofcourse make a backup first. Can you run any other CLI which tries to change the database, or do you always get the error message?
    – juhanix
    Jun 1, 2017 at 8:17

1 Answer 1


Turns out the login issue was resolved partly by disabling Page caching within Magento - system > cache management. If you need to confirm that you are entering the correct password (sounds silly, but caching was a nightmare for me here!), you can do this via vendor/zendframework/zend-crypt/src/Utils.php and modify to output the hashes at the login screen:

if (function_exists('hash_equals')) {
    echo "Expected:" . $expected;
    echo "<br>";
    echo "Actual:"  . $actual;
    return hash_equals($expected, $actual);

The SQLSTATE... error was simply caused by a lack of resources on the server. I just upgraded the AWS instance and the site is working as it should.

If things still aren't working for you as they should, ensure that you clear var/cache, var/generation.

Hopefully someone finds this useful!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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