Today our team installed Magento 1.9 with sample data provided by Magento but the sample data provided by Magento didn’t have any admin login
So our team spent 30 mins to write a mysql script which we thought we must share with the community to save time for others.
Create Magento admin user
The below query helps generating MD5 salt password which you can use in the second query
This query creates Magento admin login using MD5 salt password created in the first query
[sql]INSERT INTO admin_user
SELECT NULL user_id,
NOW( ) created,
(SELECT MAX(extra) FROM admin_user WHERE extra IS NOT NULL) extra,
This query associate adminstrator role with the Magento admin login created in the second query
[sql]INSERT INTO admin_role SELECT NULL role_id,
(SELECT user_id FROM admin_user WHERE username = ‘scommerce.mage’) user_id,
Reset Password for Magento admin userThe below query helps generating MD5 salt password which you can use in the second query
This query reset Magento admin password using MD5 salt password created in the first query
N.B – In both scenerios above, the username is scommerce.mage and password is Password
That’s it, it is as simple as that. Hope this article helped you in some way.