Postgresql 角色“;博士后;不存在;无法创建用户
我使用Linux Mint肉桂2.2.16 在安装和运行Rails的过程中,我遇到了Postgres的问题Postgresql 角色“;博士后;不存在;无法创建用户,postgresql,psql,Postgresql,Psql,我使用Linux Mint肉桂2.2.16 在安装和运行Rails的过程中,我遇到了Postgres的问题 postgres@BL ~ $ psql --version psql (Postgres-XC) 1.1 (based on PostgreSQL) 9.2.4 我无法在我的常用用户名下使用任何东西,因此我使用 sudo su - postgres 我无法获得任何与createuser一起工作的内容 postgres@BL ~ $ psql psql: FATAL: role "p
postgres@BL ~ $ psql --version
psql (Postgres-XC) 1.1
(based on PostgreSQL) 9.2.4
我无法在我的常用用户名下使用任何东西,因此我使用
sudo su - postgres
我无法获得任何与createuser一起工作的内容
postgres@BL ~ $ psql
psql: FATAL: role "postgres" does not exist
postgres@BL ~ $ createuser -s -U $USER
createuser: could not connect to database postgres: FATAL: role "postgres" does not exist
postgres@BL ~ $ sudo -u postgres createuser newname
Sorry, user postgres is not allowed to execute '/usr/bin/createuser newname' as postgres on BL.
postgres@BL ~ $ which psql
/usr/bin/psql
postgres@BL ~ $ psql \l
psql: FATAL: role "postgres" does not exist
为了管理用户,您必须以超级用户身份向psql进行身份验证。 比如说 psql-U根 后来 使用密码“paige”创建用户paige
在彻底研究该问题并撕下几根头发后,我决定这是包装/安装问题的一个变种,这里也提到了类似的问题: 我做了一个完整的卸载,如下所示,并在没有postgresql xc的情况下重新安装
新安装的用户“postgres”具有预期的行为,我可以将自己添加为超级用户并创建新的数据库。在一些安装后的欺骗之后,Rails似乎正在运行,并与postgres配合得很好。尝试以下解决方案:我没有从$psql\l中获得任何输出,相反,它给了我同样致命的错误:角色“postgres”不存在。让我觉得我根本没有用户,但需要用户创建一个用户…?不幸的是,在这里得到相同的错误。postgres@BL~$psql-U root psql:FATAL:角色“root”不存在您还记得安装postgres时第一次使用的用户名吗?我不相信我创建了一个具有唯一名称的用户,尽管它确实询问我是否要为“admin'root'用户”创建密码,我确实这样做了。除了admin、root、user或postgres之外,还有其他标准用户名吗?