无法访问Postgres PSQL

时间:2018-09-17 12:10:06

标签: postgresql

我刚刚安装了postgres(mac os),但是,当我访问psql时,它将尝试查找数据库而不是用户。

我知道用户名是benbagley(因为这是我的系统名称)

我尝试过。

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

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

1 个答案:

答案 0 :(得分:1)

As stated in the manual psql假定未明确提供数据库时该数据库名称与用户名相同,并尝试与该数据库连接(在您的情况下不存在)。

尝试连接默认数据库postgres。

psql -U username -d postgres