Created
December 4, 2013 10:28
-
-
Save tridungpham/7785460 to your computer and use it in GitHub Desktop.
Create new admin user in Magento with password "admin"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO admin_user SELECT | |
NULL `user_id`, | |
"Dung" `firstname`, | |
"Pham" `lastname`, | |
"[email protected]" `email`, | |
"dungpt.sutunam" `username`, | |
"9684dfd577831f73890e88fe18ca9072:Hs" `password`, | |
NOW() `created`, | |
NULL `modified`, | |
NULL `logdate`, | |
0 `lognum`, | |
0 `reload_acl_flag`, | |
1 `is_active`, | |
NULL `extra`, | |
NULL `rp_token`, | |
NOW() `rp_token_created_at` | |
; | |
INSERT INTO admin_role SELECT | |
NULL `role_id`, | |
(SELECT `role_id` FROM admin_role WHERE `role_name` = 'Administrators') `parent_id`, | |
2 `tree_level`, | |
0 `sort_order`, | |
'U' `role_type`, | |
(SELECT `user_id` FROM admin_user WHERE `username` = 'dungpt.sutunam') `user_id`, | |
'dungpt.sutunam' `role_name` | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For Magento EE 1.14.1.0 this need to change little bit
`
INSERT INTO admin_user SELECT
NULL user_id,
"Chamal" firstname,
"Chamaikara" lastname,
"[email protected]" email,
"chamal" username,
MD5('xoxox') password,
NOW() created,
NULL modified,
NULL logdate,
0 lognum,
0 reload_acl_flag,
1 is_active,
NULL extra,
NULL rp_token,
NOW() rp_token_created_at,
NULL failures_num,
NULL first_failure,
NULL lock_expires,
0 token_login_enabled,
NULL login_token_secret,
NULL last_token_used
;
INSERT INTO admin_role SELECT
NULL role_id,
(
SELECT
role_id
FROM
admin_role
WHERE
role_name = 'Administrators'
) parent_id,
2 tree_level,
0 sort_order,
'U' role_type,
(
SELECT
user_id
FROM
admin_user
WHERE
username = 'chamal'
) user_id,
'Administrator' role_name,
1 gws_is_all,
NULL gws_websites,
NULL gws_store_groups;
`