Unix Technical Forum

Problem Adding A PostgreSQL Server in Debian

This is a discussion on Problem Adding A PostgreSQL Server in Debian within the pgsql Interfaces Pgadmin Support forums, part of the PostgreSQL category; --> I've installed PostgreSQL, and set it up with a user that has the same user name and password as ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces Pgadmin Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 08:17 PM
Sunburned Surveyor
 
Posts: n/a
Default Problem Adding A PostgreSQL Server in Debian

I've installed PostgreSQL, and set it up with a user that has the same user
name and password as one of the Linux Users. I have no problem logging into
the psql terminal with the user via the command line. Once I am logged into
psql, I can execute the CREATE DATABASE and CREATE TABLE commands with no
problem.

However, when I tried to add a server in pgAdmin3 with the same user and
password, I get this error:

"An error has occurred:

Error connecting to the server: FATAL:IDENT authentication failed for user
"myuser" "

I have checked my pg_hba.conf file and everything appears to be as it
should be. (Although I'm not an expert, and I could be missing something.)
It is set up to accepts all connections from the local machine.

Do you guys have any suggestions for me? I'm thinking the problem is with
pgAdmin3, since I can connect to PostgreSQL via the psql terminal with no
problems, but I'm not sure.

I'm running the latest stable version of both PostgreSQL and pgAdmin3.

Thanks,

The Sunburned Surveyor

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 08:18 PM
Sunburned Surveyor
 
Posts: n/a
Default Re: Problem Adding A PostgreSQL Server in Debian

I had posted a couple of weeks back about a problem I had using pgAdmin3. I
was basically unable to add a new server to PostgreSQL from pgAdmin. I
received the following error message:

"An error has occurred: Error connecting to the server: FATAL:IDENT
authentication failed for user "myuser" "

I was able to determine the cause of this error. (Sort of...) I wanted to
post it back to the list so that other newbies might run across it while
they are searching the archives.

Apparently there are a couple of ways to connect to PostgreSQL from a
client. One of them is via UNIX sockets as a UNIX user. (Or Linux Sockets as
a Linux User.) Another is via TCP/IP.

I could successfully connect to PostgreSQL and issue commands via the psql
command prompt. With this command for example:

psql -U postgres tempate1

However, I couldn't connect with this command:

psql -h localhost -U postgres template1

This meant that I was connecting as a Linux user via a socket, and not via
TCP/IP.

If this happens to you, there are a couple of things that you can check:

[1] Issue the 2 commands mentioned above. If the first one works, but the
second one generates the error message, you probably have the same problem I
did.

[2] Make sure that postgresql.conf file contains a line that reads
"tcpip_socket = true", not "tcpip_socket = false". On my Debian Sarge system
the postgresql.conf file could be found at /etc/postgresql/ You will need
root access privileges to modify it.

[3] Make sure that your pg_hba.conf file is set up to accept tcp/ip
connections. I believe this is done by accepting all connections on the
local host. You should have a line in your hba_conf.file that looks like
this:

host all all 127.0.0.1 255.255.255.255 trust

(This might set up your PostgreSQL to accept all connections from the local
or host computer. You might not want this. Perhaps one of the other experts
can tell us how to set up the file to allow tcp/ip access but maintain
password verification on the local computer.)

On my Debian Sarge system you can find the postgresql.conf file at
/etc/postgresql. You will need root access privileges to modify it.


I hope this will help any pgAdmin 3 users that run into the same problem I
did. I am curious why I didn't recieve a response from the mailing list. Did
I violate a rule of ettiquette, or not provide enough information?

My next question would be:

How do you set up pgAdmin to connect to PostgreSQL via Unix Sockets?

I believe I read that this can be done with pgAdmin3.

Thanks,

The Sunburned Surveyor


On 12/16/05, Sunburned Surveyor <sunburned.surveyor@gmail.com> wrote:
>
> I've installed PostgreSQL, and set it up with a user that has the same
> user name and password as one of the Linux Users. I have no problem logging
> into the psql terminal with the user via the command line. Once I am logged
> into psql, I can execute the CREATE DATABASE and CREATE TABLE commands with
> no problem.
>
> However, when I tried to add a server in pgAdmin3 with the same user and
> password, I get this error:
>
> "An error has occurred:
>
> Error connecting to the server: FATAL:IDENT authentication failed for user
> "myuser" "
>
> I have checked my pg_hba.conf file and everything appears to be as it
> should be. (Although I'm not an expert, and I could be missing something.)
> It is set up to accepts all connections from the local machine.
>
> Do you guys have any suggestions for me? I'm thinking the problem is with
> pgAdmin3, since I can connect to PostgreSQL via the psql terminal with no
> problems, but I'm not sure.
>
> I'm running the latest stable version of both PostgreSQL and pgAdmin3.
>
> Thanks,
>
> The Sunburned Surveyor
>
>
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2008, 08:18 PM
Andreas Pflug
 
Posts: n/a
Default Re: Problem Adding A PostgreSQL Server in Debian

Sunburned Surveyor wrote:
> I had posted a couple of weeks back about a problem I had using
> pgAdmin3. I was basically unable to add a new server to PostgreSQL from
> pgAdmin. I received the following error message:
>
> "An error has occurred: Error connecting to the server: FATAL:IDENT
> authentication failed for user "myuser" "
>
> I was able to determine the cause of this error. (Sort of...) I wanted
> to post it back to the list so that other newbies might run across it
> while they are searching the archives.
>
> Apparently there are a couple of ways to connect to PostgreSQL from a
> client. One of them is via UNIX sockets as a UNIX user. (Or Linux
> Sockets as a Linux User.) Another is via TCP/IP.
>
> I could successfully connect to PostgreSQL and issue commands via the
> psql command prompt. With this command for example:
>
> psql -U postgres tempate1
>
> However, I couldn't connect with this command:
>
> psql -h localhost -U postgres template1
>
> This meant that I was connecting as a Linux user via a socket, and not
> via TCP/IP.
>
> If this happens to you, there are a couple of things that you can check:
>
> [1] Issue the 2 commands mentioned above. If the first one works, but
> the second one generates the error message, you probably have the same
> problem I did.
>
> [2] Make sure that postgresql.conf file contains a line that reads
> "tcpip_socket = true", not "tcpip_socket = false". On my Debian Sarge
> system the postgresql.conf file could be found at /etc/postgresql/ You
> will need root access privileges to modify it.
>
> [3] Make sure that your pg_hba.conf file is set up to accept tcp/ip
> connections. I believe this is done by accepting all connections on the
> local host. You should have a line in your hba_conf.file that looks like
> this:
>
> host all all 127.0.0.1 <http://127.0.0.1> 255.255.255.255
> <http://255.255.255.255> trust
>
> (This might set up your PostgreSQL to accept all connections from the
> local or host computer. You might not want this. Perhaps one of the
> other experts can tell us how to set up the file to allow tcp/ip access
> but maintain password verification on the local computer.)
>
> On my Debian Sarge system you can find the postgresql.conf file at
> /etc/postgresql. You will need root access privileges to modify it.
>
>
> I hope this will help any pgAdmin 3 users that run into the same problem
> I did. I am curious why I didn't recieve a response from the mailing
> list. Did I violate a rule of ettiquette, or not provide enough
> information?
>
> My next question would be:
>
> How do you set up pgAdmin to connect to PostgreSQL via Unix Sockets?


How about having a look at pgAdmin's help....

Regards,
Andreas

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:56 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com