====== Access Bundled PostgreSQL in GitLab Omnibus Installation ====== ===== Connection Details ===== * Host: ''/var/opt/gitlab/postgresql'' * Socket: ''/var/opt/gitlab/postgresql/.s.PGSQL.5432'' * UNIX User: ''gitlab-psql'' * User: ''gitlab-psql'' * Password: (empty) * Database: ''gitlabhq_production'' ===== Shell ===== sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d gitlabhq_production ===== Port forwarding (for Docker installation) ===== apt update && apt install -y socat sudo -u gitlab-psql socat TCP-LISTEN:5432,reuseaddr,fork UNIX-CLIENT:/var/opt/gitlab/postgresql/.s.PGSQL.5432 ===== References ===== # This file is managed by gitlab-ctl. Manual changes will be # erased! To change the contents below, edit /etc/gitlab/gitlab.rb # and run `sudo gitlab-ctl reconfigure`. production: adapter: postgresql encoding: unicode collation: database: gitlabhq_production pool: 10 username: 'gitlab' password: host: '/var/opt/gitlab/postgresql' port: 5432 socket: sslmode: sslrootcert: sslca: ===== See Alsos ===== * https://gitlab.com/gitlab-org/gitlab-ce/issues/3487#note_11709946 * http://docs.gitlab.com/omnibus/settings/database.html#connecting-to-the-bundled-postgresql-database {{tag>gitlab postgresql}}