3

Hi am trying to create an admin user from the cli while running the commands i get the following error:-

# php bin/magento admin:user:create --admin-user=pramod --admin-password=pramod@123 --admin-email=pramod.mishra@netsmartz.net --admin-firstname=pramod --admin-lastname=mishra

In AdminAccount.php line 262:

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

how to fix it any idea thankss

Update:- new error now while logging in admin

More permissions are needed to access this.

2
2

For creating a new administrator account for Magento 2 we use the Magento CLI. Hope this helpful for you.

  1. Login into your Magento 2 Server with SSH

    ssh your-username@$your-server-ip

  2. Navigate to the Magento 2 directory e.g.

/home/cloudpanel/htdocs/magento2.com/ 3) Execute the following command in order to create a new administrator with username "new-admin" and password "!admin123!"

php bin/magento admin:user:create --admin-user='new-admin' --admin-password='!admin123!' --admin-email='info@domain.com' --admin-firstname='Jon' --admin-lastname='Doe'

Once the new Magento 2 administrator account has been created, you will see the following success message:

Created Magento administrator user named new-admin

Parameter explanation
Name    Value
--admin-user    Magento administrator user name
--admin-password    Magento administrator user password
--admin-email   Magento administrator user's e-mail address
--admin-firstname   Magento administrator user's first name
--admin-lastname    Magento administrator user's last name

To see all available options you can execute the following command

php bin/magento admin:user:create --help

For The role

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');
0

For me the problem was that the Admin role in the table was set to "Administrator" instead of "Administrators".

So I changed it directly in the database and now it works.

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.