我刚刚安装了postgres(mac os),但是,当我访问psql时,它将尝试查找数据库而不是用户。
我知道用户名是benbagley(因为这是我的系统名称)
我尝试过。
➜ ~ psql
psql: FATAL: database "benbagley" does not exist
和
➜ ~ psql -U benbagley
psql: FATAL: database "benbagley" does not exist
答案 0 :(得分:1)
As stated in the manual psql
假定未明确提供数据库时该数据库名称与用户名相同,并尝试与该数据库连接(在您的情况下不存在)。
尝试连接默认数据库postgres。
psql -U username -d postgres