重置盐渍的Drupalpipe理员密码

有一个与Drupalconfiguration的旧虚拟机,我不记得pipe理员密码。 密码恢复过程给我一个链接重置密码,但生成的页面说:“拒绝访问”。

然后我直接编辑MySQL中的Drupal用户表。 除了Salt模块已经安装,因此哈希无效之外,这一切都奏效了。

我不知道该从哪里走。 有任何想法吗?

看来你已经解决了这个问题,但无论如何这里是一个答案。 连接到MySQL数据库并执行以下操作:

  • 从名称='salt'的variables中select值;
  • 更新用户设置pass = md5('newpassSALT')其中uid = 1; SALT是上面提到的数值。

密码应重置为“newpass”。

在接受的答案中描述的MD5('newpassSALT')方法我没有运气,所以这里是为我工作。 请注意,您需要将您自己的值replace为以下值:

  • /var/www/path/to/drupal :Drupal的安装位置
  • mynewpassword :你想要的密码
  • drupaluser :Drupal数据库用户
  • drupaldb :drupal数据库模式

一步步:

 # cd /var/www/path/to/drupal # scripts/password-hash.sh "mynewpassword" password: mynewpassword hash: $S$C/mWw8UGcAyCwLDOiqRBOShJl8w2vVLsSzYvqCMuAg/LSncU16Iy # mysql -u drupaluser -p enter your password: mysql> use drupaldb Database changed mysql> update users set pass='$S$C/mWw8UGcAyCwLDOiqRBOShJl8w2vVLsSzYvqCMuAg/LSncU16Iy' where uid=1; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> commit; Query OK, 0 rows affected (0.00 sec) 

你有没有第二个非pipe理员帐户在你的Drupal系统的工作? 它是否也使用了过时的密码? 你能够直接编辑MySQL表并将密码从一个已知的帐户复制到pipe理员帐户?

你结束了错误的数据库! mysql.user表是专门为mysql帐户访问Drupal的数据库的。 如果drupal说“访问被拒绝”,那么它可能访问其数据库,你忘记了drupal的pipe理员密码。 我强烈build议使用phpMyAdmin。

 1. Login to phpMyAdmin 2. Select the database which Drupal use from the drop-down menu on the left. 4. Click on the SQL tab. 5. In the text field on the page type the following text: update users set pass=md5('NEWPASS') where uid = 1; 

1的uid是pipe理员,您可以通过更改此查询中的uid来更改其他用户使用的密码。