after installing magento in my local machine I for

2019-03-08 15:06发布

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 this article http://www.atwix.com/magento/reset-admin-password-mysql/ but it is not working for me. Or may be I am not getting this

please help me am a beginner of Magento

15条回答
等我变得足够好
2楼-- · 2019-03-08 16:02

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.

查看更多
贪生不怕死
3楼-- · 2019-03-08 16:02

Follow the below procedure to reset Magento User Password:

1) Login to PhpMyAdmin.

2)Open Magento Database.

3)Now open "admin_user" table if you not set any table prefix at the time installing Magento, Or if you set table prefix then open "prefixadmin_user" Table.

4)Now in User password field you can see MD5 Hash converted password. So first you need to convert your plain text into MD5 Hash format and after that copy the MD5 Hast format password and paste it in User Password field under "prefixadmin_user" database table.

查看更多
仙女界的扛把子
4楼-- · 2019-03-08 16:03

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.

查看更多
冷血范
5楼-- · 2019-03-08 16:03

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.

查看更多
\"骚年 ilove
6楼-- · 2019-03-08 16:04

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.

查看更多
爷、活的狠高调
7楼-- · 2019-03-08 16:04

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/

查看更多
登录 后发表回答