开发者

How to retrieve admin password set during Admin info?

开发者 https://www.devze.com 2023-03-08 18:00 出处:网络
I have successfully installed Magento 1.5.1.0 in my localhost.Then i go to admin panel and tried to login with t开发者_如何学JAVAhe username and password I set, but it says wrong password.Then I click

I have successfully installed Magento 1.5.1.0 in my localhost.Then i go to admin panel and tried to login with t开发者_如何学JAVAhe username and password I set, but it says wrong password.Then I clicked forgot password.It says your new password is sent to your email address. I checked the email id I used during creating the personal info. But there was no mail. It might be due to the email not firing from local server.

But my problem is how can I retrieve my admin password?


Magento stores a hashed+salted value of the password (you can't get the password back).

Your only option here is to use phpMyAdmin or the mysql shell to reset that password...

To use the MySQL shell...

Run cmd.exe and enter the mysql shell with: mysql -u root -p

Enter your MySQL root account password.

Run query...

UPDATE `{db_name}`.`admin_user` SET `password` = CONCAT(MD5('zN{master_password}'), ':zN') WHERE `admin_user`.`user_id` = 1 LIMIT 1;

(taken from WampDeveloper's Magento installation script)

Replace in the above query {db_name} with the magento database name and {master_password} with whatever password you want to set.


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/


you can't retrieve it, its stored as a secure hash. go to the database and update the relevant row in the admin_user table setting the password value with the MD5 function to a new password.


Thanks a lot for these suggestions.My problem is successfully solved.I changed the password value of "admin_user" table to a md5 converted of a known word.It worked. But for knowledge I want to know about the hashed+salted value of the password, magento used to store for password explained by "rightstuff". Bcz I noticed that the password value of "admin_user" table was some thing like that concated ,when I clicked the forget password link.


You can't retrieve it, it's stored as a secure hash.

Go to the database and update the relevant row in the admin_user table. Go to column user password. Next go to any md5 encryptor link http://www.md5decrypt.org/. In that site give your text and encrypt by clicking on button md5 encrypt. Now copy the encrypted password and replace this password with the column present in admin_user table. Now login with your user id and new text password.

0

精彩评论

暂无评论...
验证码 换一张
取 消