psycopg2.OperationalError:严重:客户端身份验证失败

时间:2019-02-09 04:46:38

标签: python python-3.x enterprisedb

我遇到错误,尝试连接到企业数据库时,任何信息都会受到赞赏。

psycopg2.OperationalError: FATAL:  client authentication failed
DETAIL:  no pool_hba.conf entry for host "xxx.xx.xx.xxx", user "enterprisedb", database "enterprisedb", SSL off
HINT:  see pgpool log for details


import psycopg2

conn = psycopg2.connect(database="enterprisedb", user = "enterprisedb", password = "wifimsdp", host = "xx.xxx.xx.xxx", port = "5431")



在pool_hba.conf中具有以下条目

“本地”仅用于Unix域套接字连接

全部本地信任

1 个答案:

答案 0 :(得分:0)

例如,

In [7]: d3 = pd.to_timedelta('09:30:00.031883382') In [8]: d3 Out[8]: Timedelta('0 days 09:30:00.031883') In [9]: d3.nanoseconds # timedelta uses "nanosecondS" but timestamp uses "nanosecond" Out[9]: 382 配置了身份验证信息,postgresql允许哪个主机/ IP地址使用哪个用户并连接到哪个数据库。您要用来连接数据库的IP地址在数据库系统的pg_hba.conf文件中没有任何条目。 pg_hba.conf上特定主机的基本条目如下:

pg_hba.conf

地址部分必须提及带掩码的IP地址,例如host database user address auth-method [auth-options] 格式。有关更多详细信息,请遵循官方的documentation