Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 585
Raghav Patel Avatar asked Apr 17 '26 03:04

Raghav Patel


1 Answers

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.

like image 55
Laurenz Albe Avatar answered Apr 18 '26 17:04

Laurenz Albe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!