Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2010
    Posts
    9

    Unanswered: Trouble connecting from LAN

    I've been working with Microsoft SQL Server for 10 years or so now. It's really about the only enterprise-level database I've ever used. As such, I thought it would be interesting to "see how the other half lives", so to speak, and I decided to tinker with PostgreSQL - on Linux, no less. I'm a glutton for punishment, I guess.

    Anyway, I installed Debian 5.0 on a VirtualBox VM, running on my home theater PC at home. I then installed PostgreSQL using apt-get install postgresql (Debian repo provided version 8.3). I was able to connect locally and perform simple operations as the postgres user, such as \l.

    I then installed pgAdmin III on my Windows 7 Ultimate 64-bit laptop. However, upon trying to connect, I received errors pertaining to the pg_hba.conf and postgresql.conf files. I did some research and made the following changes:

    postgresql.conf
    - Changed
    Code:
    listen_addresses = '*'
    pg_hba.conf
    - Added
    Code:
    host    all         all         192.168.0.0 255.255.255.0    ident sameuser
    While trying various settings, I restarted the database service each time with pg_ctl restart -D /var/lib/postgresql/8.3/main.

    Now, when trying to connect with pgAdmin, I get an hourglass for about a minute, then the following error:

    An error has occurred:

    Error connecting to the server: server closed the connection unexpectedly.

    This probably means the server terminated abnormally
    before or while processing the request.
    When I bounce back to my ssh session, I am still able to connect locally and list the databases.

    I'm sure it's something simple that I'm overlooking here. The problem is clearly in trying to connect from another machine on the LAN, but I've not been able to figure this one out.

    Anyone have any ideas?

  2. #2
    Join Date
    Oct 2010
    Posts
    9
    I figured it out.

    I changed this:
    pg_hba.conf
    Code:
    host    all         all         192.168.0.0 255.255.255.0    ident sameuser
    To this:
    pg_hba.conf
    Code:
    host    all         all         192.168.0.0 255.255.255.0    trust
    I'll have to do a bit more research to fully understand the differences in these settings, but this lets me get up and working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •