一、第一步查看GitLab数据库配置
cat+/var/opt/gitlab/gitlab-rails/etc/database.yml
[root@VM_8_132_centos ~]# cat /var/opt/gitlab/gitlab-rails/etc/database.yml |
二、查看GitLab+数据库用户下一步登录使用
cat+/etc/passwd
[root@VM_8_132_centos ~]# cat /etc/passwd |
三、登录GitLab用户
su gitlab-psql
[root@VM_8_132_centos ~]# su gitlab-psql //登录gitlab-psql用户 |
四、接下来就可以进行psql的操作了
1. \l 查询数据库
gitlabhq_production=# \l |
2. \dt 查看夺标
gitlabhq_production-# \dt List of relations Schema | Name | Type | Owner --------+-------------------------+-------+-------- public | abuse_reports | table | gitlab public | appearances | table | gitlab public | application_settings | table | gitlab public | audit_events | table | gitlab public | broadcast_messages | table | gitlab public | ci_application_settings | table | gitlab 更多..... |
3. \d table 查看单标
gitlabhq_production-# \d abuse_reports |
4. \q 退出psql