user8331511
user8331511

Reputation:

Cannot access postgres PSQL

I have just installed postgres (mac os), however, when I go to access psql it tries to find the database not the user.

I know the username is benbagley (because that's my system name)

I have tried.

➜  ~ psql
psql: FATAL:  database "benbagley" does not exist

and

➜  ~ psql -U benbagley
psql: FATAL:  database "benbagley" does not exist

Upvotes: 0

Views: 82

Answers (1)

YogeshR
YogeshR

Reputation: 1736

As stated in the manual psql assumes that database name is same as the username when the database is not provided explicitly and tries to connect with that database, which does not exist in your case.

Try connecting with default database which is postgres.

psql -U username -d postgres

Upvotes: 1

Related Questions