after installing magento in my local machine I forgot admin password

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

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

    If you have access to phpMyAdmin, here are the steps to reset your password.

    First, open up phpMyAdmin. Click on your database name for Magento from the sidebar on the left. Click on the SQL tab and type the following in to the text box:

    UPDATE `admin_user` SET `password` = MD5('PASSWORD') WHERE `username` = 'USERNAME';
    

    You’ll want to replace the capitalized values with the correct information:

    USERNAME - The user whose password you’ll be udpating PASSWORD - The new password you want to use For example, if my username was admin and I wanted to reset the password to 123456, I would do this:

    UPDATE `admin_user` SET `password` = MD5('123456') WHERE `username` = 'admin';
    

    If you don’t know the name of the user you want to update, you can see all the users by clicking on the admin_user link from the sidebar, and then select the Browse tab. The username column has the list of available users.

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

    Open phpMyAdmin and under open your database and under that find table "admin_user" and find your username in that table. Delete the password over there and create a new MD5 hash of your new password and place it there.

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