database su postgres:对不起?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7765269/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 08:21:25  来源:igfitidea点击:

su postgres: Sorry?

databasepostgresqlconsolesu

提问by matt

i have a problem with my postgreSQL setup on my new Mac OSX Lion machine.

我的新 Mac OSX Lion 机器上的 postgreSQL 设置有问题。

I can't seem to connect to the service

我似乎无法连接到该服务

$ createuser -a -d _postgres
Password: 
createuser: could not connect to database postgres: FATAL:  password authentication failed for user 

I have no chance to find the correct password. Any idea what could that be. I have the default setup with a localhost server. The same happens when I try to connect via pgAdmin.

我没有机会找到正确的密码。知道那是什么。我有一个本地主机服务器的默认设置。当我尝试通过 pgAdmin 连接时,也会发生同样的情况。

$ su postgres
Password:
su: Sorry

I have no chance to find out what's wrong?

我没有机会找出问题所在?

回答by jishi

try this:

尝试这个:

$ sudo su postgres

And specify your own password.

并指定您自己的密码。

回答by A.H.

Does this work?

这行得通吗?

First get root access

首先获得root权限

$ su - 
Password: RootPW
# su - postgres