vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I am using Hibernate to connect to my PostgreSQL (btw - I love) database, and can connect my app and the db when using localhost, but when I try to connect via an ip address, it blows up telling me that the connection was refused. I have set the postmaster to listen for TCP/IP connections, but still does not work. Any suggestions? Thanks, Sean |
| |||
| This usually means that you have allowed TCP/IP connections in postgresql.conf, but haven't added a rule allowing remote access in pg_hba.conf for anything other than localhost. A sample pg_hba.conf line to allow any host on the network to connect using MD5 password hashes would be: host all all 0.0.0.0 0.0.0.0 md5 -- Mark Lewis On Fri, 2006-01-27 at 08:31 -0600, Sean wrote: > I am using Hibernate to connect to my PostgreSQL (btw – I love) > database, and can connect my app and the db when using localhost, but > when I try to connect via an ip address, it blows up telling me that > the connection was refused. I have set the postmaster to listen for > TCP/IP connections, but still does not work. Any suggestions? > > > > Thanks, > > Sean > > ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |
| |||
| On Sat, 28 Jan 2006 01:31 am, Sean wrote: > and can connect my app and the db when using localhost, but when I try to > connect via an ip address, it blows up telling me that the connection was > refused. I have set the postmaster to listen for TCP/IP connections, but > still does not work. Any suggestions? In postgresql.conf, the default config is to listen only on localhost IP address (probably listen_addresses will be set to default value and commented out). Change it so that is reads: listen_addresses = '*' and re-start the DB. As Mark mentioned, you may also want to review your pg_hba.conf file. Regards, Philip. -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan ----------------- Utiba Pty Ltd This message has been scanned for viruses and dangerous content by Utiba mail server and is believed to be clean. ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| ||||
| Mark Lewis <mark.lewis 'at' mir3.com> writes: > This usually means that you have allowed TCP/IP connections in > postgresql.conf, but haven't added a rule allowing remote access in > pg_hba.conf for anything other than localhost. Sean - on Linux, you can check this with the following command: [root@meuh ~] netstat -ltpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 3310/postmaster ^^^ my postgres is listening on all addresses [...] tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3259/master ^^^ my postfix is listening on localhost only -- Guillaume Cottenceau ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |