2

I just installed PostGreSQL in my Ubuntu Box, and the first thing I want to do is to create a database. I read the documentation, and it simply says type createdb. Once I typed in that command, PostgreSQL gave me an error: could not connect to database postgres: FATAL: Ident authentication failed for user "myuser". I assume that this is because "myuser" does not have the right administration privileges in the database. Is there an easy way to add that priviliges ?

Thank you.

Wolph
  • 78,177
  • 11
  • 137
  • 148
zfranciscus
  • 16,175
  • 10
  • 47
  • 53
  • I don't understand why would you close this. I mean, if you can migrate it somewhere, yes, but just close w/o migrating? wtf. – MK. Nov 12 '11 at 17:01

2 Answers2

2

The postgresql usually creates a default user postgres. You would have entered a password during installation for this user. If you remember you can use it.

Otherwise, you can add an entry in the pg_hba.conf file to enable your localhost to login without any password for psql command.

A sample entry would be

host    all         all         127.0.0.1/32          trust   
Muthu
  • 2,675
  • 4
  • 28
  • 34
  • Do I need to restart the database, because that entry did not do anything. I typed $pg_ctl and it says command not found – zfranciscus Nov 12 '11 at 04:33
0

Perhaps, create a user first?

http://www.postgresql.org/docs/8.1/static/app-createuser.html

MK.
  • 33,605
  • 18
  • 74
  • 111
  • I tried that and it says: createuser: could not connect to database postgres: FATAL: Ident authentication failed for user "myuser". I thought the database was not running. I typed $ createuser. PostgreSQL asked me "ENter name of role to add". I thought, hmmm, the database is running – zfranciscus Nov 12 '11 at 04:26