Reputation: 44293
I got my new lion machine. Ran the PostgreSQL installer from the PostgreSQL site for Mac and i have no multiple apps installed. One of them is "pgAdmin III.app". When I open it there is already one server connection available. localhost:5432
Whenever I try to connect to the server with a doubleclick the programm asks me for a password. I have no idea what to enter. It's not my admin password, it's not "postgres", it's not "localhost", it's not empty.
I just can't seem to connect to the server. Even when I check the properties of the localhost server the password field seems empty. However I'm not allowed to leave the password field empty.
Any idea what to do? I really need to setup postgres?
Upvotes: 17
Views: 39129
Reputation: 10226
here's a better answer (works in OSX HighSierra): the account used is the one you're logged onto OSX with, therefore, the password is your password!
Upvotes: 2
Reputation: 2054
Haven't tried it on OSX, but on Ubuntu you can login as the system user 'postgres' to the default database 'postgres' without a password with
su postgres -c psql
You can then (re)set the password of the database superuser 'postgres'.
You can also edit the configuration file pg_hba.conf
(don't know where it is located on a default OSX installation, on Ubuntu it is /etc/postgresql/8.4/main/pg_hba.conf
) and grant access to the default database without authentication
# TYPE DATABASE USER CIDR-ADDRESS METHOD
host postgres postgres 127.0.0.1/32 trust
After editing pg_hba.conf you must reload the configuration with
pg_ctlcluster 8.4 main reload
You can then connect with pgAdmin and (re)set the password, but don't forget to change the authentication method back to md5
again...
Upvotes: 4
Reputation: 9883
On my Mac OSX Lion, PostgreSQL configuration files are stored under /Library/PostgreSQL/9.0/data/
Upvotes: 9
Reputation: 66213
A similar question has been asked a short time ago. The steps described there should be appropriate for Lion also.
Postgresql: password authentication failed for user "postgres"
Upvotes: 0