我在ubuntu 12.04服务器上,正在尝试安装postgresql。到目前为止,我已经成功安装了它,但无法配置它。我需要创建一个角色才能前进,我在终端中运行了以下命令:
root@hostname: createuser -s -r postgres
上面写着:
createuser: could not connect to database postgres: FATAL: role "root" does not exist
好吧,所以我就这么做了:
su - postgres
然后再试一次
postgres@hostname: createuser -s -r postgres
我得到了一个错误
createuser: could not connect to database postgres: FATAL: role "postgres" does not exist
当我这样做的时候,我得到了同样的错误
psql -d dbname
这就像一个循环,我无法创建角色postgres,因为角色postgres还不存在。
我该如何解决这个问题?
postgres版本似乎是9.1.x,而ubuntu版本似乎是12.10
发布于 2013-03-25 15:37:53
原来我在我的机器上安装了postgres-xc和postgresql。我不得不完全停用postgres-xc。要做到这一点有点困难,因为总是有一个错误的--purge remove postgres-xc,卸载无法继续。
似乎有某种包装上的bug。(details on launchpad)。
最后,我最终做了this来让它工作。
在那之后,我卸载了postgresql,并将其重新安装以使其正常工作。
发布于 2013-03-24 04:38:41
阅读postgresql tutorial,不管是Ubuntu还是其他Linux。
在创建角色或任何其他内容之前进行编辑在全新安装时,您需要创建数据库集群:您创建了吗?
initdb -D /usr/local/pgsql/data您需要在linux机器上以postgres用户的身份登录。Here提供了更多信息。
https://stackoverflow.com/questions/15591749
复制相似问题