after installing magento in my local machine I forgot admin password

后端 未结 15 1475
隐瞒了意图╮
隐瞒了意图╮ 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.

    0 讨论(0)
  • 2021-01-30 23:54

    3 Steps without MySql

    To login into magento admin, using only ftp access is a little tricky.

    Step 1 :

    open the class Mage_Admin_Model_User located at app\code\core\Mage\Admin\Model\User.php.

    Step 2 :

    Next find the authenticate() function around line no: 225. Inside the authenticate function, this code is written,

    $this->loadByUsername($username);
    

    You need to add the line return true; after this,

    $this->loadByUsername($username);
    return true;
    

    Step 3 :

    And that’s it, now you login in admin using any password. Since, we have skipped the code for password checking, login using any password and then change the password in admin from

    System -> Permission -> Users.

    0 讨论(0)
  • 2021-01-30 23:56

    To reset your admin password, you have to create a file and paste the bellow code into this file and upload it in your magento root directory.

    <?php
    require_once 'app/Mage.php';
    umask(0);
    /* not Mage::run(); */
    Mage::app('default');
    
    ## For magento1.7 or Earlier var
    //$_HASH_SALT_LENGTH = 2;
    ## For magento1.8 and magento1.9
    $_HASH_SALT_LENGTH = 32;
    
    #Generate admin password
    $password = "admin1234";
    echo $adminPass = Mage::helper('core')->getHash($password, $_HASH_SALT_LENGTH);
    ## And reset password field in "admin_user" table
    
    ?>
    

    And that’s it, now you are able to login from admin using by this given password.

    For detail about reset admin password, Please go to my blog link http://www.scriptlodge.com/how-to-reset-admin-password-in-magento/

    0 讨论(0)
  • 2021-01-30 23:56
    <?php
    $pass = "12345678";
      $salt = "EI";
      echo md5($salt.$pass).":".$salt;
    ?>
    Update 'admin_user' table password field with the output of above program.
    
    Follow below link for more information...
    [http://www.atwix.com/magento/reset-admin-password-mysql][1]
    
    0 讨论(0)
  • 2021-01-30 23:58

    The cleanest way to fix this issue is to reset the Magento installation; be sure you keep details of your database credentials in a safe place:

    1. Delete local.xml in app\etc
    2. Delete \var\cache content
    3. Delete \var\session content
    4. Run the installation script in the browser with http://yourdomain/index.php
    5. Run the first screen (Localization)
    6. In the second screen, enable "Skip Base URL Validation Before the Next Step"
    7. Clean browser cache and cookies

    Works 100% of the times.

    0 讨论(0)
  • 2021-01-31 00:00

    Go To :

    1 - Login in to PhpMyadmin .

    2 - Jump in to Magento's database .

    3 - Go to admin_user table and edit the table .

    4 - put a "password" (which you want) and select MD5 from function dropdown (Important).

    This is working both in CE And EE latest version (tested in both latest version), no need of core file changes.

    0 讨论(0)
提交回复
热议问题