OVHcloud Community

Welcome to your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.

Unable to connect to postgres database hosted on OVH VPS (issue with pg_hba.conf)


I am working on a friend’s VPS in order to set up a database for a discord bot they have commissioned me to make. In production, both the bot and database will be hosted on the same server so I won’t need to be able to establish a remote connection to the database from some other computer however for testing and development reasons, I’m hosting the bot on my personal computer and the database needs to be able to be connected to remotely.

Over the past couple of days, I’ve attempted to set it up to allow remote connections however I’ve been completely unsuccessful and despite watching numerous youtube and text tutorials/guides I cannot figure out why on earth it isn’t working. I suspect that OVH physically blocks the ability to use a VPS to host a remote database as they already sell database-specific services. By giving users the ability to host it themselves, it would defeat the purpose of those additional services they offer.

This is becoming rather frustrating as I never intend on using the remote database in the long run and just want to be able to easily connect to it for testing purposes. My issue is that after editing the /postgresql.conf file with the line listen_addresses = '*' and the /pg_hba.conf to include the lines host all all md5 host all all :/0 md5 and after reloading the config and restarting PostgreSQL, when using the command “psql” it returns this error: psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket? - that command works all the time up to that point and external connections still don’t work either.

If someone could help me at all it would be greatly appreciated, thanks.

  • Morgan