-
-
Save tridungpham/7785460 to your computer and use it in GitHub Desktop.
INSERT INTO admin_user SELECT | |
NULL `user_id`, | |
"Dung" `firstname`, | |
"Pham" `lastname`, | |
"dungpt@sutunam.com" `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` | |
; |
Working in magento 1.7.0.2
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,
"chamal@google.com" 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;
`
Tested for Magento 1.9.2.4
missing 3 columns : failures_num, first_failure, lock_expires
so it should be like this :
missing 3 columns : gws_is_all, gws_websites, gws_store_groups
so it should be like this :