我在Linux肉桂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 "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发布于 2015-06-03 17:25:39
在深入研究了这个问题并撕下了几根头发之后,我认为这是包装/安装问题的一些变化,这里也有类似的问题:unable to create user postgres: role "postgres" does not exists。
我完成了一个完整的卸载,如下所示,并在没有postgresql的情况下重新安装。
How to thoroughly purge and reinstall postgresql on ubuntu?
新安装预期了用户"postgres“的行为,我能够将自己添加为超级用户并创建新的数据库。经过一些安装后的花招,Rails似乎在运行,并与postgres合作。
发布于 2015-06-02 22:11:58
为了管理用户,您必须对psql作为超级用户进行身份验证。例如
psql -U根
之后
使用密码“paige”创建用户paige;
https://stackoverflow.com/questions/30606150
复制相似问题