Gitlab修改用户密码
进入gitlab数据库
gitlab-rails dbconsole
gitlabhq_production=> \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
---------------------+-------------+----------+-------------+-------------+---------------------------------
gitlabhq_production | gitlab | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 |
postgres | gitlab-psql | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 |
template0 | gitlab-psql | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/"gitlab-psql" +
| | | | | "gitlab-psql"=CTc/"gitlab-psql"
template1 | gitlab-psql | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/"gitlab-psql" +
| | | | | "gitlab-psql"=CTc/"gitlab-psql"
(4 rows)
## 连接数据库
gitlabhq_production=> \c gitlabhq_production
You are now connected to database "gitlabhq_production" as user "gitlab".
## 查找账户id,用户名,名字
gitlabhq_production=> select id,name,username from users;
id | name | username
----+---------------+----------
1 | Administrator | root
(1 row)
## 查找账户id
gitlabhq_production=> select id from users where username = 'root';
id
----
1
(1 row)
修改用户密码
gitlab-rails console -e production
irb(main):005:0> user = User.where(id: 1).first
irb(main):005:1> user.password = 'root123*'
irb(main):005:3> user.save!
irb(main):005:4> quit