redmine忘记username和password

时间:2021-09-19 13:10:32

环境:

Ubuntu 13.10

bitnami-redmine-2.5.1-1-linux-x64-installer.run

用bitnami安装完redmine以后,有是否忘记了username和password。可是又没有配置邮件server,无法找回password。

仅仅能去server更改了。更改过程例如以下:

1. 改动 安装文件夹/redmin/apps/redmine/htdocs/config/database.yml,更对相应的username,password,数据库地址,port号

production:
adapter: mysql2
database: bitnami_redmine
host: 127.0.0.1
username: root
password: ""
port: 3307
encoding: utf8
socket: /home/hyadmin/redmin/mysql/tmp/mysql.sock
development:
adapter: mysql2
database: redmine_development
host: localhost
username: root
password: ""
encoding: utf8
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
database: redmine_test
host: localhost
username: root
password: ""
encoding: utf8

2. 进入例如以下文件夹

cd 安装文件夹/redmin/apps/redmine/htdocs/script

3. 运行例如以下命令,进入ruby

./rails console production

4.
取得你要改动的用户对象(ruby>代表进入ruby环境)

ruby> admin_user = User.find_by_login('你要改的username')

5.改动admin用户对象password

ruby> admin_user.password = '你的密码'

注: 这个password不能太短,否则报错。

6.保存admin用户对象信息

ruby> admin_user.save!

7.退出ruby环境

ruby> quit

这样应该就能够用yourpassword这个新密码登录系统了