How to Connect to VCSA/VCVA postgres database

In order to troubleshoot the embedded vpostgres database in VCSA , below steps are used to connect to the database.

1. Connect to VCSA appliance using SSH.

Use the below commands.

vc:~ # cd /etc

vc:/etc # cd vmware-vpx
vc:/etc/vmware-vpx # ls
vc:/etc/vmware-vpx # less embedded_db.cfg

This will give the password within the quotes : only copy the text within the quotes

c:/etc/vmware-vpx # cd /opt/vmware/vpostgres

vc:/opt/vmware/vpostgres # ls
1.0 9.0 current
vc:/opt/vmware/vpostgres # cd 9.0/
vc:/opt/vmware/vpostgres/9.0 # cd bin
vc:/opt/vmware/vpostgres/9.0/bin # sudo -u postgres /opt/vmware/vpostgres/9.0/bin/psql -d VCDB postgres
Password for user postgres: <Type the same password as picked from embedded db.cfg file>
psql.bin (9.0.13)







Now you can execute the sql commands to fetch details from the postgres DB.

Happy Learning 🙂