bitnami是redmine是集成环境,一键安装很方便,对我这种小白太友好了。但是前两天装的忘记了admin密码 找了网上的一些资料,但是环境不太一样,试了一下不好使。http://blog.csdn.net/robinsonmhj/article/details/36876929?utm_source=tuicool这个看了一下
但是我的机器ruby命令也不好使。
我只知道/redmin/apps/redmine/htdocs/config/database.yml这个文件里面有配置数据库连接的
端口 登录名和密码什么的都有了
由于服务器没装mysql界面化只能在Powershell窗口操作了
1.连接到数据库 (mysql -P3307 -u bitnami -p )
2.输入密码 进入数据库(密码就是database文件中的password)
3.查看database(show databases;)
4.进入bitnami_redmine(use bitnami_redmine)
5.查看remine都有些什么表( show tables;)
6.一共有55张表 看到了users表 打开看看里面是啥玩意(select
* from users \G)
PS:不使用;使用\G的作用是为了让查询出的结果不凌乱
看到redmine的密码hashed_password是加密了的 于是只能上官网看看hashed_password是用什么加密(http://www.redmine.org/projects/redmine/wiki/FAQ)
Reset password lost without admin redmine account but with admin redmine database account
Found in file /app/models/user.rb: 'The hashed password is stored in the following form: SHA1\(salt + SHA1)'
So you can reset password in two steps:
- clear salt
- calculate sha1(sha1(new_password))
For example for the password "password" (without quote) it will be "353e8061f2befecb6818ba0c034c632fb0bcae1b"
sah1(password)=0bd181063899c9239016320b50d3e896693a96df
sha1(0bd181063899c9239016320b50d3e896693a96df)=353e8061f2befecb6818ba0c034c632fb0bcae1b
You have to go to redmine database, find "users" table, find user to reset password, clear "salt" field's user and put "353e8061f2befecb6818ba0c034c632fb0bcae1b" in "hashed_password" field's
user and log to redmine with new password 'password' (without quote). To do this redmine database changes, do the following from command line in the operating system where Redmine is working:
- note user and password from a file config/database.yml.
- For MySQL
- execute command:
mysql -u <db user from database.yml> -p
- enter: <password from database.yml>
- execute:
UPDATE users SET hashed_password='353e8061f2befecb6818ba0c034c632fb0bcae1b' WHERE login='admin';
- execute:
UPDATE users SET salt='' WHERE login='admin';
- execute:
exit
- execute command:
Now you can go to Redmine login web page to login as user admin with 'password' as password.
7.在官网找到了这么个解释 咱英语也不会 只能Google翻译了
翻译后的大概意思就是找到“users”表,找到忘记密码的那个用户,清除“salt”字段的用户,并在“hashed_password”字段的用户中输入“353e8061f2befecb6818ba0c034c632fb0bcae1b”,并使用新密码“password”登录到redmine 。
8.直接执行 UPDATE users SET hashed_password ='353e8061f2befecb6818ba0c034c632fb0bcae1b'WHERE login ='admin';
9.执行完后 重启服务 登录成功了 。。。
还是官网厉害