1. 在root用户下,执行

gitlab-rails console production #进入gitlba控制台

2.获得用户数据,修改用户密码

[root@svr34 bin]# gitlab-rails console production
Loading production environment (Rails 4.2.5.2)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id: 1, email: "admin@example.com", ...
irb(main):002:0> user.password=12345678
=> 12345678
irb(main):003:0> user.password_confirmation=12345678
=> 12345678
irb(main):004:0> user.save!
=> true
irb(main):005:0> quit
 

注意:密码没有使用引号,奇怪的是使用单引号或双引号,密码就无效,估计是包含了这个字符,不包含,就没有问题。
3. 保存用户数据

user.save!

注意需要使用后面的感叹号!

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-04
  • 2021-08-21
猜你喜欢
  • 2021-09-19
  • 2021-11-30
  • 2021-06-20
  • 2021-08-29
  • 2021-10-14
  • 2021-08-13
  • 2021-11-01
相关资源
相似解决方案