gpt4 book ai didi

postgresql - 无法创建用户 postgres : role "postgres" does not exists

转载 作者:行者123 更新时间:2023-11-29 11:14:52 29 4
gpt4 key购买 nike

我在 ubuntu 12.04 服务器上,我正在尝试安装 postgresql。截至目前,我已成功安装它但无法配置它。我需要创建一个角色才能继续前进,我在终端中运行了这个命令:


root@hostname: createuser -s -r postgres

它说:

createuser:无法连接到数据库 postgres:致命:角色“root”不存在

好吧,我做到了:

su - postgres

然后再试一次


postgres@hostname: createuser -s -r postgres

我得到了错误

createuser:无法连接到数据库 postgres:致命:角色“postgres”不存在

当我这样做的时候我得到了同样的错误


psql -d 数据库名

这就像一个循环,我无法创建角色 postgres,因为角色 postgres 尚不存在。

我该如何解决这个问题?

postgres版本好像是9.1.x,ubuntu版本是12.10

最佳答案

原来我已经在我的机器上安装了 postgres-xcpostgresql。我不得不完全关闭 postgres-xc。这样做有点困难,因为总是出现错误 --purge remove postgres-xc 并且无法继续卸载。

似乎存在某种打包错误。 (details on launchpad)。

最终,我完成了 this使其发挥作用。

之后我卸载了 postgresql 并重新安装它以使其工作。

关于postgresql - 无法创建用户 postgres : role "postgres" does not exists,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15591749/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com