PostgreSQL:pg_hba.conf中的MD5身份验证给我致命:用户“ postgres”的对等身份验证失败

Vic*_*oni 0 authentication postgresql psql

我正在运行Ubuntu 14.04,并安装了PostgreSQL 9.3。将/etc/postgresql/9.3/main/pg_hba.conf编辑为:

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
Run Code Online (Sandbox Code Playgroud)

我重新启动了服务器,现在我想以postgres身份登录postgres

victor@workstation:~$ psql -U postgres
psql: FATAL:  Peer authentication failed for user "postgres"
Run Code Online (Sandbox Code Playgroud)

我已将其身份验证方法设置为MD5,因此postgres不应该提示输入密码吗?

我知道,如果我添加-h localhost它将起作用。

不添加此标志会导致psql使用对等身份验证吗?

小智 6

1)从终端打开-> / etc / phppgadmin-> config.inc.php。

2)找到下面的线并将其更改为False。

$conf['extra_login_security'] = true; to $conf['extra_login_security'] = false;
Run Code Online (Sandbox Code Playgroud)

3)更改后,重新启动Server.it将解决您的问题。

/etc/init.d/httpd restart
Run Code Online (Sandbox Code Playgroud)