Accessing/controling postgres in VirtualBox


Qing Gong
 

I deployed cf-service-contrib package, including postgres, rabbit, etc. I know postgres93 is running on port 5435 but I could not access it because there is no known users. I tried to create a user but got errors like the following.

root(a)9f209fcb-d266-41c6-b97d-6b0cf9a155d3:/var/vcap/packages/postgresql93/bin#
./createuser -h 127.0.0.1 -p 5435 -U postgres
./createuser -h 127.0.0.1 -p 5435 -U root

createuser: could not connect to database postgres: FATAL: password authentication failed for user "postgres"
(I know my root password for the VM, but it seems to ask for the DB user's password).
createuser: could not connect to database postgres: FATAL: password authentication failed for user "root"

I have two questions:
1. How'd I get or create a postgres user in the VBox VM? This seems to be different from postgres on ubuntu. The default user postgres doesn't exist here.
2. After making changes to postgres configuration files, how'd I restart the postgres server to load the changes? This also seems to be different from regular postgres on unbuntu.

Thanks!