无法创建用户postgres:角色“ postgres”不存在 [英] unable to create user postgres: role "postgres" does not exists

查看:307
本文介绍了无法创建用户postgres:角色“ postgres”不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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 dbname



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



我该如何解决?



p ostgres版本似乎是9.1.x,而ubuntu版本是12.10

解决方案

原来我已经安装了我的机器上的postgres-xc postgresql 。我不得不完全关闭postgres-xc。这样做有点困难,因为总是出现错误-清除postgres-xc ,然后卸载将无法继续。



似乎存在某种包装错误。 (详细信息在启动板上)。



最终,我最终做了

此后,我卸载了postgresql并将其重新安装以使其正常工作。


i am on ubuntu 12.04 server and i am trying to install postgresql. As of now, i have successfully installed it but unable to configure it. I need to create a role to move ahead and i ran this command in terminal :

root@hostname: createuser -s -r postgres

and it said :

createuser: could not connect to database postgres: FATAL: role "root" does not exist

Fine, so i did :

su - postgres

and then tried again

postgres@hostname: createuser -s -r postgres

and i got the error

createuser: could not connect to database postgres: FATAL: role "postgres" does not exist

and i get the same error when i do

psql -d dbname

Its like a loop, i am unable to create a role postgres because a role postgres does not already exist.

How do i fix this ?

The postgres version seems to be 9.1.x and the ubuntu version is 12.10

解决方案

Turns out i had installed postgres-xc and postgresql on my machine. I had to knock off postgres-xc completely. And it was a little difficult to do that because, there was always an error --purge remove postgres-xc and the uninstallation could not continue.

There seems to be some kind of a packaging bug. (details on launchpad).

Eventually, i ended up doing this to make it work.

After that i uninstalled postgresql and installed it back to make it work.

这篇关于无法创建用户postgres:角色“ postgres”不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆