after installing magento in my local machine I forgot admin password

后端 未结 15 1557
隐瞒了意图╮
隐瞒了意图╮ 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-31 00:05

    Poking around in the database is a horrible idea, when you've got an entire framework at your fingertips. This is the proper way of changing the admin password:

    Create a file called reset-password.php and place it in the site root:

    setUseSessionInUrl(false);
    umask(0);
    
    $user = Mage::getModel('admin/user')
        ->load('admin', 'username')
        ->setNewPassword('mynewpassword')
        ->save();
    

    Make a request for /reset-password.php in your browser, and the Magento framework should update the password for admin to mynewpassword.

提交回复
热议问题