Showing posts with label Generate admin through mysql in magento. Show all posts
Showing posts with label Generate admin through mysql in magento. Show all posts

Monday, 14 December 2015

How to create admin user by database?

Paste Following code into your database and then Login to your Magento admin panel by using new credentials.


INSERT INTO `admin_user` (
`user_id` ,
`firstname` ,
`lastname` ,
`email` ,
`username` ,
`password` ,
`created` ,
`modified` ,
`logdate` ,
`lognum` ,
`reload_acl_flag` ,
`is_active` ,
`extra` ,
`rp_token` ,
`rp_token_created_at`
)
VALUES (
NULL , 'CHANDRA', 'BHUSHAN', 'cb8022@gmail.com', 'cb8022', MD5( 'cb#8022' ) ,
CURRENT_TIMESTAMP , NULL , NULL , '0', '0', '1', NULL , NULL , NULL
)



INSERT INTO admin_role SELECT
 NULL `role_id`,
 0 `parent_id`,
 2 `tree_level`,
 0 `sort_order`,
 'U' `role_type`,
 (SELECT `user_id` FROM admin_user WHERE `username` = 'cb8022') `user_id`,
 'Administrators' `role_name`;