fcds00 2020-06-06
用的 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