1

I do not have root access on the host machine. (no php installed)

I have a guest virtual machine running a local server and database. (I do not have any login access to this machine)

I need to access the guest machine database from the host machine.

Chopper3
  • 101,299
  • 9
  • 108
  • 239

2 Answers2

1

if postgres has been set up to bind to the IP address of the server (not localhost or 127.0.0.1) then you should be able to access the database on port 5432 using the IP address of the virtual machine.

Brent
  • 22,857
  • 19
  • 70
  • 102
1

To expand on what Brent is saying, configuring your Postgres server to listen to non-local connections varies wildly between versions. On 8.1 on my Debian server, you do it in /etc/postgresql/8.1/main/postgresql.conf - there is a line that says "listen_addresses = 'localhost'" and you comment that out. I don't remember for sure if that's the only thing. You may also need to configure connections in pg_hba.conf in that directory.

Previous to 8.x, I think you configured the network in pg_hba.conf as well, and it didn't used to be in /etc/postgresql/, but in /var/lib/pgsql or something like that.

Paul Tomblin
  • 5,225
  • 1
  • 28
  • 39
  • As I stated in the original post, I don't have access to the machine that is running postgres. It is running in a locked down VM on my local machine which I did not set up. –  Nov 05 '09 at 23:38
  • Well, if it's not listening on a network socket, you're pretty much hosed. – Paul Tomblin Nov 06 '09 at 01:05