Reputation: 1154
Postgresql is not cooperating. I did a yum of postgresql and postgresql-server and that seemed to be fine. I then tried to `` and it gives and error message:
createdb: could not connect to database postgres: FATAL: Ident authentication failed for user "postgres"
If I remove the user it gives the same error just with my username. I'm on a Centos OS. I want it to work with apache and php after I figure out to create a database.
When I run /usr/bin/postgres
it gives an error:
/usr/bin/postgres does not know where to find the server configuration file. You must specify the --config-file or -D invocation option or set the PGDATA environment variable.
Can't figure it out. Did I miss a configuration step? I thought doing yum would work out of the box.
Upvotes: 1
Views: 3626
Reputation: 21993
Sounds like it is configured for ident authentication which requires you to login as the linux user postgres ie:
su postgres
and then run the createdb command. Other method would be to locate your pg_hba.conf probably in something like /var/lib/pgsql/9.1/data and switch to trust authentication. That way you can connect using -U postgres with any linux account and it will let you in without verifying the password. Then you can setup required usernames and passwords and then switch to something more secure like md5.
Upvotes: 1