I cannot login to Magento 2 admin due to the fact it is installed on This is an imported site and not a fresh install.

I have changed cookie domains to reflect the correct paths but still no admin access.

Anyone have any ideas?

enter image description here

enter image description here

  • changed base URLs?
    – Greg
    Feb 23, 2018 at 16:57
  • yes thats what i find really weird ive changed everything i can think of Feb 23, 2018 at 16:58
  • is the login pop up there for admin login? Or 404? do you get error when trying to log in?
    – Greg
    Feb 23, 2018 at 16:59
  • You did not sign in correctly or your account is temporarily disabled. is the error message i get when login in Feb 23, 2018 at 17:01
  • did you check the database connection? Feb 23, 2018 at 17:03

4 Answers 4


Try creating a new user:

bin/magento admin:user:create --admin-user="testing" --admin-password="123123q" --admin-email="testing@example.com" --admin-firstname="Test" --admin-lastname="Test"

When you get the error:

No Administrators role was found, data fixture needs to be run

Follow this link for more info: https://www.maxpronko.com/blog/how-to-create-admin-user-in-magento-2-via-command-line

As a quick fix:

You need to delete value from this table core_config_data:

  • [Exception] No Administrators role was found, data fixture needs to be run Feb 23, 2018 at 17:10
  • maxpronko.com/blog/… have a read. I think it might be that your role name has changed.
    – Greg
    Feb 23, 2018 at 17:13
  • my role name is admin Feb 23, 2018 at 17:28
  • check the quick fix i posted in my answer to see if that works
    – Greg
    Feb 23, 2018 at 19:13
  • 1
    i had to edit the adminaccount.php and add a new user but i am now in thanks Feb 23, 2018 at 19:22

In my case, since I did a data strip with magerun2. The data from this table: authorization_role was also erased.

This query fixed it:

INSERT INTO authorization_role (role_id, parent_id, tree_level, sort_order, role_type, user_id, user_type, role_name) VALUES (1, 0, 1, 1, 'G', 0, '2', 'Administrators');

More details, here: https://github.com/netz98/n98-magerun2/issues/351


it seems that your account is locked, try unlock by command prompt. open cmd got to you magento directory root and type the following command.

php bin/magento admin:user:unlock <username>

username will be your user name of account. it will be like

php bin/magento admin:user:unlock admin
  • nope unlocked and still the same Feb 23, 2018 at 17:07
  • in magento 2 it always show that your account is locked when you type wrong password. try create new admin by following command php bin/magento admin:user:create --admin-user="admin" --admin-password="123123q" --admin-email="admin@example.com" --admin-firstname="Admin" --admin-lastname="Admin" change new admin username , passowrd and email
    – Atif Aqeel
    Feb 23, 2018 at 17:09

Probably the authorization_role table is empty.


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.