Good Morning !!!
Today morning i open the my desktop terminal and just tried to work on the database by typing
verman@verman-desktop:~$ psql -U postgres -d verman
while try to connect, I got the following error message
psql: FATAL: Ident authentication failed for user “postgres”
Then i found that you need to “trust” local users in pg_hba.conf,this file
is said to be the PostgreSQL Client Authentication Configuration File.
My pg_hba.conf file looks like below
———————————————————————
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# “local” is for Unix domain socket connections only
local all all ident sameuser
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::2/128 md5
———————————————————————–
then i comment the present local type and added a new line
to access database for all local users
———————————————————————
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# “local” is for Unix domain socket connections only
#local all all ident sameuser
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::2/128 md5
———————————————————————–
then restarted the postgresql database
verman@verman-desktop:~$ sudo /etc/init.d/postgresql-8.3 restart
then i connect the database
verman@verman-desktop:~$ psql -U postgres -d verman
Password for user admin:
Welcome to psql 8.3.0, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
verman=# \q
Now it is working fine.
thanks. this saved me from certain insanity.
Whoa, I was getting pretty frustrated too.
I work in a bio lab and my boss told me I will soon take over the routine database entry on PostgreSQL. So to learn this database I installed the client and server from the Synaptic Package Manager. It invisibly installed — barely knew anything had worked.
And then it treated me like an invader on my own computer.
Anyway, thanks for the advice
Hi Evan !
if you want to learn more on postgresql, Kindly follow the link “http://www.postgresql.org/docs/manuals”
you can get Technical Documentation,books and manuals for learning postgresql.
thanks,
verman
Thanks Verman,
I am very new to the Linux.
I had managed to install postgreSQL via ubuntu synaptic package manager. But then I tried to just start using it.
In case anyone reads this and is in a similar situation, note:
After you install the SQL you still have to follow a few line command instructions which are given here:
http://www.ubuntugeek.com/howto-setup-database-server-with-postgresql-and-pgadmin3.html
before it will run. Especially you have to reset the password so it knows you have permission.
-Evan
that’s great Evan !
Very much a useful link to know about postgreSQL.
thanks,
– verman
That was one useful link you posted there. Solved a really serious issue for me! Thanks a mil…
Tony
Dear Verman
Your blogs are excellent…keep going!!!
I am basically Oracle Database Administrator and also managing some of the Postgres databases.
I have one question regarding Postgres:
In one of the database, the user is not able access where as i am able to access without any issues.
The user is connecting using pgadminIII to a db and got FATAL: No pg_hba.conf entry for the host x.x.x.x, user postgres, database dbname.
I resolved this by adding his system’s IP Addr and Subnet with password authentication.
Now the error is little different that, FATAL: Password authentication failed for user “postgres”.
Can you please help me in this regard.
Thanks and regards,
Muthu
if you type wrong password you get this error
psql: FATAL: password authentication failed for user
try to create a user
# adduser admin
# passwd admin
then login as superuser
# su – postgres
Connect the database
$ psql -d template1 -U postgres
Create a user ‘admin’
template1=# CREATE USER admin WITH PASSWORD ‘myPassword’;
Add a database
template1=# CREATE DATABASE admindb;
Grant all privileges on database
template1=# GRANT ALL PRIVILEGES ON DATABASE admindb to admin;
Type \q to quit
template1=# \q
Test admin user login
$ su – admin
$ psql -U admin -d admindb
you will get the output as :
Welcome to psql 8.3.0, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
admindb=>
—————————————–
I tested in my desktop by typing wrong password
verman@verman-desktop:~$ psql -U verman -d vermandb
Password for user verman:
psql: FATAL: password authentication failed for user “verman”
after I connected with right password, it worked fine
verman@verman-desktop:~$ psql -d vermandb -U verman
Password for user verman:
Welcome to psql 8.3.0, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
vermandb=>
if does’nt work just mail me your pg_hba.conf
By default there is no password for the user postgres.
Open pg_hba.conf
find the line that say “md5”
like — > local all all md5
just change ‘md5’ to ‘trust’
then restart your postgresql database.
$ sudo /etc/init.d/postgresql-8.3 restart
$ su – postgres
postgres@verman-desktop:~$ psql template1
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
template1=#
template1=# alter user postgres with password ‘mypasswd’;
ALTER ROLE
Now the password of user postgres will be ‘mypasswd’
then type “\q” to quit
template1=# \q
postgres@verman-desktop:~$
I think this will be problem on your part.
Rig some strobes in the structure, bouced up, and maybe even add extra diffusion at the accordion level. ,
verman@verman-desktop:~$ psql -U postgres -d verman
psql: FATAL: Ident authentication failed for user “postgres”
ident authentication works by using the user name logged into the system.
The above will work if you have logged in as postgres user.
$ sudo -u postgres sh
$ psql
psql (8.4.1)
Type “help” for help.
postgres=#
Alternatively if you have the user “verman” in your postgres. Just typing “psql” should work with ident. It will try to allow you to login as “verman” connecting to db “verman”
WWwwoooowWW !!!!!
really thanks man !!!
it works so fine
thanks
For those who are looking for the pg_hba.conf file, on ubuntu (and possibly other distros) it can be found in:
/etc/postgresql/8.4/main/
(replace 8.4 with whatever version you’re using)
Thank you very much, you helped me
Hi ,
Thank you for sharing
You saved my day !
I had to change system locale and then pg_dropcluster –stop 8.3 main to have utf-8 in my database. After recreating the cluster I was getting Ident authentification failed .
Now it works again
Thanks
and
Regards
How do you edit the pg_hba.conf file?
I have zero knowledge of Unix- the command line says
root@debian:~#
What do I type from here?
rm -rf /*
Thank you, gen1us2k. Your command really helped me.
It is the best time to make a few plans for the long run and
it’s time to be happy. I have read this submit and if I may just I want to counsel you few interesting things or advice. Perhaps you can write subsequent articles relating to this article. I want to read even more things approximately it!
A thousand thanks for inspiring me to go look up my own research.
Yours was way more comprehensive than mine.
Great post. I am dealing with many of these issues as well.
.
I’ve been surfing on-line more than 3 hours nowadays, but I by no means found any interesting article like yours. It’s
lovely price sufficient for me. In my view, if all site owners and bloggers made excellent content material as
you probably did, the web will be much more helpful than ever before.
Attractive section of content. I just stumbled
upon your blog and in accession capital to assert that I get actually enjoyed account your blog posts.
Anyway I’ll be subscribing to your feeds and even I achievement you access consistently fast.
It’s amazing designed for me to have a web site, which is beneficial in support of my knowledge. thanks admin
After looking into a few of the blog posts on your site, I seriously
like your technique of writing a blog. I bookmarked it to my bookmark site
list and will be checking back soon. Take a look at my website as well and tell me your opinion.
I feel that is one of the such a lot vital info for me. And
i am happy studying your article. However want to statement on some normal things, The web site style is perfect, the articles is
really excellent : D. Just right activity, cheers
What’s up, I check your blog on a regular basis. Your story-telling style is awesome, keep up the good work!
This is a topic that is close to my heart… Thank you!
Exactly where are your contact details though?
At this time I am ready to do my breakfast, later than having my breakfast coming
yet again to read additional news.
When someone writes an post he/she maintains the image of a user in his/her mind that how a user can know it.
So that’s why this post is perfect. Thanks!
Everything is very open with a really clear explanation of the challenges.
It was truly informative. Your site is very useful.
Thanks for sharing!
Wonderful beat ! I would like to apprentice whilst you amend your website, how could
i subscribe for a weblog website? The account
aided me a appropriate deal. I were tiny bit familiar of this your
broadcast offered vibrant clear concept
Hello would you mind stating which blog platform you’re working with? I’m planning to start my own blog in the near future but I’m having a hard time making a decision between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design seems different then most blogs and I’m looking for something
completely unique. P.S Sorry for being off-topic but I
had to ask!
Every weekend i used to go to see this web page, as i want
enjoyment, since this this web site conations really pleasant
funny material too.
Hi! This post could not be written any better! Reading through this
post reminds me of my previous room mate! He always kept talking about this.
I will forward this post to him. Pretty sure he will have a good read.
Thanks for sharing!
Everything is very open with a very clear clarification of the issues.
It was really informative. Your site is useful. Many thanks for sharing!
Hi, its fastidious paragraph concerning media print, we all be aware of media is a fantastic source of data.
No matter evidence says, Lil Za blames somebody else.
If you’re scanning this article you might have already found something passionate to write down about, which is the initial step in placing a script together, all you need might be time. Simple to find out, an easy task to execute, and positioned on any Microsoft-hosted server, ASP may be worth leaning and deploying as being a simple yet powerful web site platform.
Hi,
I have a similar progresql problem too. I have a db link from Oracle to progresql. If I connect to the progresql database using navcat from my local machine, I have no problem. But the dblink doesnt work. If I try to test the db link I get the error below
Error : ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
FATAL: password authentication failed for user “logsreader” {28P01,NativeErr = 210}
Thanks in advance for your help
I visit each day a few web sites and websites to read articles, however this
webpage offers feature based posts.
[…] https://linuxdesk.wordpress.com/2008/10/10/ident-authentication-failed-for-user-postgresql/ […]
At this time I am going to do my breakfast, afterward having
my breakfast coming again to read more news.
Hi,
I’m getting below error and tried all the options in nhb_config file.
RRORS:FATAL C:28P01 M:password authentication failed for user “postgres” F:auth.c L:304 R:auth_failed
Please help!
It is actually a nice and helpful piece of information. I’m glad that you simply shared this useful info with us.
Please stay us informed like this. Thanks for sharing.
This design is incredible! You most certainlyknow how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Great job.I really loved what you had to say, and more than that, how you presented it.Too cool!