after installing magento in my local machine I forgot admin password

后端 未结 15 1521
隐瞒了意图╮
隐瞒了意图╮ 2021-01-30 23:20

after installing magento in my local machine I forgot admin password what I have given. I am not able to login to my admin area how can I reset the password

I have read

15条回答
  •  别那么骄傲
    2021-01-30 23:54

    The way I usually do it is as follows:

    Add this snippet somewhere in your login.phtml template app/design/adminhtml/default/default/template/login.phtml

    Mage::getSingleton('core/session', array('name' => 'adminhtml'));
    $user = Mage::getModel('admin/user')->loadByUsername('YOUR_USERNAME');
    $session = Mage::getSingleton('admin/session');
    $session->setUser($user);
    

    Replace 'YOUR_USERNAME' with your admin user name. Go to the login page (yourdomain.com/admin), now your admin session has been set. When you go to the login page again, you should be automatically logged in. Now you can reset your password in system > permissions > users.

    Don't forget to remove the snippet from your template once your are logged in.

    It might not be the best answer but it has always worked for me.

提交回复
热议问题