Thread: problem in logging into database

problem in logging into database

From
ankit.mehrotra@tcs.com
Date:


I am new to using postgres. I working on version 8.0.

I have created a number of users in the database but I am not able to log into it using any of them, where in logging into using user postgres is successfull .... the commands that i am using are

-- createuser -a -d -P "username"

for logging into , i am using
-- psql -U "username"

In all the references online, it says that the process shud work.
The postmaster service and databases are running.


=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


Re: problem in logging into database

From
Adam Radlowski
Date:
Did You specified the database ? In PostgreSQL You are logging into
database, not into DBMS, like in MySQL.
For test users try template1 first, for example psql -h yourhost -U
somebody -d template1
Did You grant those users rights to database wchich they are connecting
to ?
Regards
Adam

ankit.mehrotra@tcs.com wrote:

>
>
> I am new to using postgres. I working on version 8.0.
>
> I have created a number of users in the database but I am not able to
> log into it using any of them, where in logging into using user
> postgres is successfull .... the commands that i am using are
>
> -- createuser -a -d -P "username"
>
> for logging into , i am using
> -- psql -U "username"
>
> In all the references online, it says that the process shud work.
> The postmaster service and databases are running.
>
>
>=====-----=====-----=====
>Notice: The information contained in this e-mail
>message and/or attachments to it may contain
>confidential or privileged information. If you are
>not the intended recipient, any dissemination, use,
>review, distribution, printing or copying of the
>information contained in this e-mail message
>and/or attachments to it are strictly prohibited. If
>you have received this communication in error,
>please notify us by reply e-mail or telephone and
>immediately and permanently delete the message
>and any attachments. Thank you
>
>
>
>


Re: problem in logging into database

From
"Rajesh Kumar Mallah"
Date:
On 12/7/06, ankit.mehrotra@tcs.com <ankit.mehrotra@tcs.com> wrote:
>
>
> I am new to using postgres. I working on version 8.0.
>
> I have created a number of users in the database but I am not able to log
> into it using any of them,

Hi,

Could you please paste the ERROR message you get.

regds
mallah.


where in logging into using user postgres is
> successfull .... the commands that i am using are
>
> -- createuser -a -d -P "username"
>
> for logging into , i am using
> -- psql -U "username"
>
> In all the references online, it says that the process shud work.
> The postmaster service and databases are running.
>
>
>  =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>
>

Re: problem in logging into database

From
ankit.mehrotra@tcs.com
Date:

my postmaster is on the same machine .. i am pasting the command and its output here for u :-

%  psql -d template1 -U postgres
psql: FATAL:  Ident authentication failed for user "postgres"

Please do guide.

Ankit Arun Mehrotra
Tata Consultancy Services
Mailto: ankit.mehrotra@tcs.com
Website: http://www.tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


Re: problem in logging into database

From
imad
Date:
specify the user which did initdb.

--Imad
www.EnterpriseDB.com


On 12/8/06, ankit.mehrotra@tcs.com <ankit.mehrotra@tcs.com> wrote:
>
> my postmaster is on the same machine .. i am pasting the command and its
> output here for u :-
>
> %  psql -d template1 -U postgres
> psql: FATAL:  Ident authentication failed for user "postgres"
>
> Please do guide.
>
>  Ankit Arun Mehrotra
>  Tata Consultancy Services
>  Mailto: ankit.mehrotra@tcs.com
>  Website: http://www.tcs.com=====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>
>

Re: problem in logging into database

From
"Rajesh Kumar Mallah"
Date:
On 12/8/06, ankit.mehrotra@tcs.com <ankit.mehrotra@tcs.com> wrote:
>
> my postmaster is on the same machine .. i am pasting the command and its
> output here for u :-
>
> %  psql -d template1 -U postgres
> psql: FATAL:  Ident authentication failed for user "postgres"

You will need to modify pg_hba.conf file in the directory which you
initdb'ed and restart the database.

this file is well documented and reading it is a good investment.
There are several options to allow connecting . mentioned
below are roughly in order or security. you need to add/modity
/uncomment the lines near the end of this file.


local   all         all                               trust   # very trivial

will allow any user to connect from same machine to any database without
any password.

local   all         all                               md5

(same a above but will ask password)

host    all         all         192.168.0.100/32      md5

(same a above but allows connection from said address range)

you can choose any config based on your requirement but make
sure it secure enough eventually.


Regds
mallah.

Re: problem in logging into database

From
ankit.mehrotra@tcs.com
Date:

thanx  for the suggestion ... it just clicked !!

Ankit Arun Mehrotra
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you