我使用 Homebrew 软件在 OS X Lion 上安装了最新版本的 postgres。路径正确:
$ which postgres
/usr/local/bin/postgres
$ which psql
/usr/local/bin/psql
并且 brew doctor 很高兴。但是,当我尝试创建用户时,会发生这种情况:
$ createuser myuser
Password:
createuser: could not connect to database postgres: FATAL: password authentication failed for user <$USER>
密码绝对不是我的常规用户密码,我不知道如何找出它应该是什么。有可能我前段时间在安装一堆其他东西时使用 homebrew 安装了不同版本的 postgres,但我不记得了。我确实注意到与我删除的新版本的“postgres”一起安装了不同版本的“postgresql”。
不知道这是不是一个线索,但是当我这样做的时候:
$ sudo su - postgres
psql(但不是 postgres)的路径不再正确:
postgres$ which postgres
/usr/local/bin/postgres
postgres$ which psql
/usr/bin/psql
可能很简单。将不胜感激任何帮助。谢谢!
Mac OS X Lion 10.7.5
homebrew 0.9.3
postgres 9.2.1
最佳答案
关于postgresql - Postgres createuser 需要密码(不是我的系统密码),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12937365/