首页 > redmine忘记username和password

redmine忘记username和password

环境:



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: mysql2database: bitnami_redminehost: 127.0.0.1username: rootpassword: ""port: 3307encoding: utf8socket: /home/hyadmin/redmin/mysql/tmp/mysql.sock
development:adapter: mysql2database: redmine_developmenthost: localhostusername: rootpassword: ""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: mysql2database: redmine_testhost: localhostusername: rootpassword: ""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这个新密码登录系统了













转载于:https://www.cnblogs.com/hrhguanli/p/4551533.html

更多相关:

  • 1.更新User对象,设置对内的_password class User(db.Model):     __tablename__ = 'user'      _password = db.Column(db.String(200), nullable=False) #内部使用   class User(db.Model):__t...