[英]Azure Database for PostgreSQL server: no pg_hba.conf entry for host
In my Azure portal I created the resource "Azure Database for PostgreSQL server".在我的 Azure 门户中,我创建了资源“PostgreSQL 服务器的 Azure 数据库”。 I set up the firewall to enable two Virtual Networks (in order to allow the correct functioning of two applications) and the IP address of my local computer (in order to be able to work on the database using DBeaver as client).
我设置了防火墙以启用两个虚拟网络(以允许两个应用程序正常运行)和我本地计算机的 IP 地址(以便能够使用 DBeaver 作为客户端在数据库上工作)。 This has worked for several months although, since I have a dynamic IP address, I often have to change the enabled address.
虽然这已经工作了几个月,但由于我有一个动态的 IP 地址,我经常不得不更改启用的地址。 Now I'm trying to update it but, when I try to connect to the database via DBeaver, I get the following error:
现在我正在尝试更新它,但是当我尝试通过 DBeaver 连接到数据库时,出现以下错误:
FATAL: no pg_hba.conf entry for host "XX.XX.XX.XX", user "myuser", database "mydatabase", SSL on
where "XX.XX.XX.XX" is exactly the IP address I have enabled in Azure.其中“XX.XX.XX.XX”正是我在 Azure 中启用的 IP 地址。
I tried to install a second Client (pgAdmin) but I get the same error.我试图安装第二个客户端(pgAdmin),但我得到了同样的错误。 Also, since my applications that use the database seem to work properly, I tried to verify the connection data that I use in DBeaver (host, database, user, password) but they are all correct.
此外,由于我使用数据库的应用程序似乎工作正常,我尝试验证我在 DBeaver 中使用的连接数据(主机、数据库、用户、密码),但它们都是正确的。
In Azure, in the "Connection security" tab of my database (see image below) I read the following warning:在 Azure 中,在我的数据库的“连接安全”选项卡中(见下图),我阅读了以下警告:
Some network environments may not report the actual public-facing IP address needed to access your server. Contact your network administrator if adding your IP address does not allow access to your server.
So changing the IP address has no effect?那么改IP地址没有效果? How can I solve the problem?
我该如何解决这个问题?
I solved the problem by restarting the database: https://docs.microsoft.com/en-us/azure/postgresql/howto-restart-server-portal我通过重新启动数据库解决了这个问题: https://docs.microsoft.com/en-us/azure/postgresql/howto-restart-server-portal
In the Azure Portal change require_secure_transport from server parameters to OFF .
在 Azure 门户中,将require_secure_transport从服务器参数更改为OFF 。
make ssl connection non mandatory in server parameters for postgres service in azure, its dynamic parameter so no postgres service restart not required使 ssl 连接在 azure 中的 postgres 服务的服务器参数中不是必需的,它的动态参数因此不需要 postgres 服务重启
or fix/configure application to use secure(ssl) connections only或修复/配置应用程序以仅使用安全(ssl)连接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.