after installing magento in my local machine I forgot admin password

后端 未结 15 1558
隐瞒了意图╮
隐瞒了意图╮ 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:07

    Mostly, when we install the Magento Community on our local computer (XAMPP, WAMPP), it looks like we can't log in as the administrator from the backend. The system will prompt us we input the wrong password, but it's not the truth.

    When i come up with this issue, i tried to reset the password by following method (in SQLyog).

    UPDATE admin_user 
    SET password=CONCAT(MD5('qXpassword'), ':qX') 
    WHERE username='admin';
    

    ‘password’ should be set to whatever you want for your new password, and ‘qX’ would be any random characters you like.

    But we still can not log in. At first, I thought this method is wrong method. While, the 'admin' password definitely had been changed. But why we still can not log in?

    Maybe we have input the right user name and password, but we still can't log in.

    Use Notepad ++ to open and edit core file: app/code/core/Mage/Core/Model/Session/Abstract/Varien.php, within your magento directory and comment those below lines:

    $cookieParams = array(
                'lifetime' => $cookie->getLifetime(),
                'path'     => $cookie->getPath() //,
                // 'domain'   => $cookie->getConfigDomain(),
                // 'secure'   => $cookie->isSecure(),
                // 'httponly' => $cookie->getHttponly()
            );
    

    And try again, you should can log in as admin from the backend.

    The problem is Localhost or "127.0.0.1" are not true domains, and browsers allow only real domains to store cookies, that's why login stops and with invalid Username or Password.

提交回复
热议问题