Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer
    
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. –  AndrewWasHere Nov 5 '09 at 23:38
    
Well, if it's not listening on a network socket, you're pretty much hosed. –  Paul Tomblin Nov 6 '09 at 1:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.