To connect to the embedded vPostgres database, use the psql command in the Windows command Prompt:
- To obtain the credentials to connect to the vCenters vPostgres database open the C:\ProgramData\VMware\vCenterServer\cfg\vmware-vpx\vcdb.properties file in a plain text editor.
Note: To view this file, administrator level permissions are required.
- Note the database name after the port in the URL string.
Example: url = jdbc:postgresql:/localhost:5432/VCDB
Note: VCDB is the database name in this example.
- Note the username in the string username = username.
Example: username = vc
Note: vc is the username in this example.
- Note the password in the string password = password.
Example: password = pXrE+82C@Mmn3+P1
Note: pXrE+82C@Mmn3+P1 is the password in this example.
- Click Start > Run type in cmd and press Enter.
- Change to the C:\Program Files\VMware\vCenter Server\vPostgres\bin\ directory.
Note: The drive letter may vary based on installation options.
- Connect to the postgres database by running the psql command:
psql -U username database_name
Note: Replace username with the username noted in steps 3, and database_name with the database name noted in step 2.
Example: psql -U vc VCDB
- Enter the password found in step 4 when prompted.
- To verify connectivity to the database run the following command:
\c database_name
Note: Replace database_name with the database name found in step 2.
Example: \c VCDB
You are now connected to database "VCDB" as user "vc"
- To exit the database type \q and press Enter.