My username and password correct, but not logged into magento back end or control panel, its return Access Denied. enter image description here

  • I think your password should be expire. Try to Update it via db and check. Else check from db role of your admin user. – Nits May 18 '16 at 11:13
  • after bulk import images, product page not visible magento back end, so i did roles -> reset filters. right after i get access denied problem. – Gem May 18 '16 at 11:15
  • create new user from db and login with the new one then reset password and roles from admin for your existing one. – Ashish Madankar M2 Professiona May 18 '16 at 11:21
  • how can i do what you told – Gem May 18 '16 at 11:22
  • 1
    are u their i am done with it please come to chat room – Ashish Madankar M2 Professiona May 18 '16 at 13:06

This is on basis of chat with you it looks that your admin_rule table get clear it is not able to find a rule for your role.

For this you have to create entry in this table for your role which is in admin_role table. or else you can upload a backup of your old table if you have.

To make a user login 3 tables are taken into consideration whose relation are as follows.

1) admin_user

This table stores all data of user information like name, password,create date, active or not etc.

2) admin_role

This tables holds data of roles for users created in magento. for admin it is Administrators.This tables links to admin_user by user_id column.

3) admin_rule

This table is used to hold a data related to permission for a role. This table link to admin_role table by role_id column.

In your case you can use https://drive.google.com/folderview?id=0BweKwHQ_asV2TnJreDZnRWszME0&usp=drive_web this link which will create above table with admin as user name and admin@123 as password

before importing this table take a backup of your existing tables.

after making login rest password for your user and you are done.

| improve this answer | |

Use below mentioned MySql for generate new admin user :

LOCK TABLES `admin_role` WRITE , `admin_user` WRITE;

SET @SALT = "rp";
SET @USERID = "user_id"; /*Replace user_id with your user_id*/
SET @PASS = CONCAT(MD5(CONCAT( @SALT , "Password123") ), CONCAT(":", @SALT )); /*Replace Password123 with your password*/
SELECT @EXTRA := MAX(extra) FROM `admin_user` WHERE extra IS NOT NULL;

INSERT INTO `admin_user` (firstname,lastname,email,username,password,created,lognum,reload_acl_flag,is_active,extra,rp_token_created_at) 
VALUES ('Firstname','Lastname','email@example.com',@USERID,@PASS,NOW(),0,0,1,@EXTRA,NOW()); /*Replace Firstname,Lastname,Email with your details*/

INSERT INTO `admin_role` (parent_id,tree_level,sort_order,role_type,user_id,role_name) 
VALUES (1,2,0,'U',(SELECT user_id FROM `admin_user` WHERE username = @USERID),'Firstname'); /*Replace firstname with provided firstname on above insert*/


Note : If you are using table prefix then please add your table prefix in each table before using this query.

| improve this answer | |
  • same problem access denied – Gem May 18 '16 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.