Raghav Patel
Raghav Patel

Reputation: 843

Postgres: psql: FATAL: database "root" does not exist in windows 10

Please check below command which I had run:

C:\Windows\system32>psql -U root
Password for user root:
psql: FATAL:  database "root" does not exist

Upvotes: 2

Views: 6611

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246338

If you don't explicitly specify which database you want to connect to, psql will use the database with the same name as the database user.

Since you specified database user root, psql tries to connect to a database of that name, but the database doesn't exist.

Try specifying an existing database:

psql -U root -d mydb

In case you don't know which database to use, or if you never created a database, you can always use the postgres database.

Upvotes: 10

Related Questions