【发布时间】:2016-07-15 15:13:25
【问题描述】:
我刚刚安装了 postgres(使用 brew)并使用 pg_ctl -D /usr/local/var/postgres -l logfile start 启动它
我现在尝试在终端中连接它,但得到以下信息:
与 PostgreSQL 的连接 - postgres@localhost 失败 致命:角色“我”不存在
问题可能是我先安装了 postgres.app,然后没有让它正常工作,然后又将其删除。
【问题讨论】:
-
您最初应该使用的帐户是
postgres,它不需要密码。 -
我运行 'su postgres' 然后
initdb /usr/local/var/postgres9.5 -E utf8但我得到creating directory /usr/local/var/postgres9.5 ... initdb: could not create directory "/usr/local/var/postgres9.5": Permission denied -
由于某种原因,当我运行 initdb 时,我得到了使用 root 用户创建的 var/postgres 目录
-
实际上,我只是检查了我的 mac 上的用户,我有一个 postgresql 用户,我认为这是因为我从 postgres.app 开始,然后切换到 brew,它只是混淆了一些东西,不知道该做什么现在就做@Nicarus
标签: postgresql homebrew