I am pretty new to linux systems and DBs so having a difficulty in accessing musicbrainz database using VM. I tried my best to resolve this issue but could not find a way.
When I try “psql -h localhost -U musicbrainz -p 5432”
I got a following message:
"Could not connect to server: No route to host
Is the server running on host “localhost (127.0.0.1) and accepting TCP/IP connections on port 5432?”
For your information, I am using virtualbox (5.1.14) in Windows 8. (PostgreSQL (9.5) installed in a server image.)
I could find two “pg_hba.conf” files in different directories so set both of them to include
"host all all 0.0.0.0/0 trust
"host all all ::0/0 trust"
I also edit postgresql.conf: listen_addresses = ‘*’
I tried other network settings in the virtualbox not limited to NAT and also changed “localhost” to other IP address shown in ifconfig, when I execute “psql -h localhost -U musicbrainz -p 5432”.
Using port 15432 instead of 5432 did not help either.
Make sure you get the indentation exactly right. It should look the same as the line with expose and the line after. ports should have 2 spaces in front of it, and the second line should have 3 spaces.
After you have made the changes, run the reset-containers command as described in the documentation: