I cannot login to Magento 2 admin due to the fact it is installed on 127.0.0.1:8080. 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?
I cannot login to Magento 2 admin due to the fact it is installed on 127.0.0.1:8080. 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?
Try creating a new user:
bin/magento admin:user:create --admin-user="testing" --admin-password="123123q" --admin-email="[email protected]" --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
:
web/cookie/cookie_domain
web/cookie/cookie_httponly
web/cookie/cookie_lifetime
web/cookie/cookie_path
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
Probably the authorization_role table is empty.
For Imported site,check the following things,
1). remove the cookie domain and cookie path
web/cookie/cookie_domain web/cookie/cookie_path
2). Disable the Two Factor Authentication
bin/magento module:disable Magento_TwoFactorAuth
3). Create new user
php bin/magento admin:user:create