英偉達 RTX 3080 Ti 曝光:跑分與 RTX 3090 幾乎相同
阿新 • • 發佈:2021-01-29
用root賬號執行
gitlab-rails console -e production
- 1
-
找到root使用者
user = User.where(id: 1).first
- 1
或者
user = User.find_by(email: '[email protected]')
- 1
-
修改密碼
user.password = 'secret_pass' user.password_confirmation = 'secret_pass'
- 1
- 2
-
儲存
user.save!
- 1
-
操作樣例
[[email protected] ~]# gitlab-rails console -e production -------------------------------------------------------------------------------- GitLab: 12.4.2 (393a5bdafa2) GitLab Shell: 10.2.0 PostgreSQL: 10.9 -------------------------------------------------------------------------------- user = User.where(id: 1).first Loading production environment (Rails 5.2.3) irb(main):001:0> user = User.where(id: 1).first => #<User id:1 @root> irb(main):002:0> user.password='12345678' => "12345678" irb(main):003:0> user.password_confirmation='12345678' => "12345678" irb(main):004:0> user.save! Enqueued ActionMailer::DeliveryJob (Job ID: b4e0a054-5fea-487d-9b84-cef6c02d9f8f) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", #<GlobalID:0x00007f6ec7477a60 @uri=#<URI::GID gid://gitlab/User/1>> => true irb(main):005:0> irb(main):005:0> exit [