GitLab 數據庫


訪問 GitLab 數據庫

步驟

用的 Docker Gitlab,首先進入容器

docker exec -it gitlab /bin/bash
``
找到數據庫配置文件
```bash
/var/opt/gitlab/gitlab-rails/etc/database.yml

內容如下,記錄了數據庫配置信息

production:
  adapter: postgresql
  encoding: unicode
  collation: 
  database: gitlabhq_production                 # 數據庫
  pool: 10
  username: "gitlab"
  password: 
  host: "/var/opt/gitlab/postgresql"            # host
  port: 5432                                    # 端口
  socket: 
  sslmode: 
  sslcompression: 0
  sslrootcert: 
  sslca: 
  load_balancing: {"hosts":[]}
  prepared_statements: false
  statements_limit: 1000
  fdw: 

切換為數據庫用戶

su - gitlab-psql

訪問數據庫

psql -h /var/opt/gitlab/postgresql -p 5432 -d gitlabhq_production

查看一下所有的表

\d

退出數據庫

\q


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM