To create a new admin user in Magento via the terminal, follow these steps:
- Access Your Server: Open your terminal or SSH into your server.
- Navigate to Your Magento Installation: Change to the Magento root directory:
- Create a New Admin User: Use the following command to create a new admin user. Replace
<new_username>,<new_email>, and<new_password>with your desired values:
php bin/magento admin:user:create --admin-firstname=FirstName --admin-lastname=LastName --admin-email=<new_email> --admin-user=<new_username> --admin-password=<new_password>
- Clear Cache (optional): It’s good practice to clear the cache after making changes:
php bin/magento cache:clean php bin/magento cache:flush
- Log in to Admin Panel: Use the new credentials to log in to your Magento admin panel.