magento admin密码不记得了怎么办呢?

最近研究mangento,下载了版本1.9.1.0,安装完了之后,结果密码给忘了,在网上查了下也没弄好,于是就查看代码,发现加密函数如下

   public function validateHash($password, $hash)
    {
        $hashArr = explode(':', $hash);
        switch (count($hashArr)) {
            case 1:
                return $this->hash($password) === $hash;
            case 2:
                return $this->hash($hashArr[1] . $password) === $hashArr[0];
        }
        Mage::throwException('Invalid hash.');
    }

从这里不难看出,算法,于是执行如下sql即可

update admin_user set password =  concat(md5('px123456'),':px') where user_id = 1;

这样就把用户id为1的管理员的密码更新成123456了

猜你喜欢

转载自blog.csdn.net/ZHUBOYAN123/article/details/41519605
今日推荐