消息"28000:主机\"xx.xxx.xxx.xxxx \",用户\“用户",数据库\“数据库名称\",SSL关闭“无pg_hba.conf条目" [英] Message "28000: no pg_hba.conf entry for host \"xx.xxx.xxx.xxxx\", user \"User", database \"databasename\", SSL off"
问题描述
我正在尝试远程连接postgresql数据库(Heroku). 我使用ASP Web api,但总是有相同的异常:消息"28000:主机\"xx.xxx.xxx.xxxx \",用户\用户",数据库\数据库名称\",SSL的pg_hba.conf条目不存在离开" 我通过编辑pg_hba.conf文件搜索一些解决方案,然后添加: 主机数据库名称用户名xx.xxx.xxx.xxxx md5 并没有改变.
I 'm trying to connect postgresql database remotely ( Heroku ). I use ASP Web api but always i have the same exception :Message "28000: no pg_hba.conf entry for host \"xx.xxx.xxx.xxxx\", user \"User", database \"databasename\", SSL off" I search some solution by editing the pg_hba.conf file and i add : host databasename username xx.xxx.xxx.xxxx md5 and no change .
推荐答案
添加 sslmode = Require; 和 Trust Server Certificate = true; .可以肯定地工作.
Add sslmode=Require; and Trust Server Certificate=true; in your connection string.It will work for sure.
这篇关于消息"28000:主机\"xx.xxx.xxx.xxxx \",用户\“用户",数据库\“数据库名称\",SSL关闭“无pg_hba.conf条目"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!