
























登陆 Gitlab 服务器进行数据库登陆、数据查询及信息导出操作。
1cat /var/opt/gitlab/gitlab-rails/etc/database.yml

1cat /etc/passwd | grep gitlab

1psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
(1) 查看帮助信息
1gitlabhq_production=# \h
(2) 查看数据库
1gitlabhq_production=# \l
(3) 查看库中的表(执行命令后,按回车键显示更多表信息)
1gitlabhq_production=# \dt
(4) 通过筛查,可在库中找到 users 表,相关用户信息都记录在表中!
1gitlabhq_production=# \d users
(5) 查看表信息
1gitlabhq_production=# SELECT * FROM users;
(6) 查看 users 表中的 name 字段
1gitlabhq_production=# SELECT name FROM users;
(7)登出数据库
1gitlabhq_production=# \q
1echo 'select name,username,email,state from users;' |psql -h /var/opt/gitlab/postgresql -d gitlabhq_production > userinfo.txt
存储在/var/opt/gitlab/postgresql/userinfo.txt
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。