postgresql psql:致命角色“root”不存在
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46142381/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
psql: fatal role "root" does not exist
提问by Mohideen bin Mohammed
I have gone through many SO question answer my problem was not solved..
我经历了很多这样的问题答案我的问题没有解决..
This is the method I tried:
这是我试过的方法:
user@user-Latitude-XT3:~$ sudo su postgres
No passwd entry for user 'postgres'
user@user-Latitude-XT3:~$
and many others.
和许多其他人。
I keep on getting fatal error user does not exist
我继续得到 fatal error user does not exist
any working solution?
任何工作解决方案?
please Notebefore marking duplicate, tried all similar but wasn't solved yet.
请在标记重复之前注意,尝试了所有类似但尚未解决的问题。
回答by theGtknerd
This is how I normally login to postgres:
这是我通常登录 postgres 的方式:
sudo -i
sudo -i -u postgres
psql
回答by Mohideen bin Mohammed
Here how i fixed,
在这里我是如何修复的,
- vi /etc/postgresql/9.3/main/pg_hba.conf
local all postgres peer
here change peerto trust
restart,
sudo service postgresql restart
now try,
psql -U postgres
- vi /etc/postgresql/9.3/main/pg_hba.conf
local all postgres peer
这里改变对以信任
重新开始,
sudo service postgresql restart
现在试试,
psql -U postgres