Why can't the PostgreSQL database be accessed from the external network? Where is the problem?
I want to verify if the PostgreSQL I created can be accessed through an external network. I used the
When I use pgAdmin to connect to my database, it keeps failing and shows "connection timeout expired". However, if I use
In other words, it works normally inside the container but not from the outside.
Where could the problem be? I am sure I have opened external port 5432.
telnet host port command in PowerShell to test if the host can be connected, then used the Ctrl+] command and entered status. The screen shows that it is connected, but after about a minute, it shows that the connection is lost.When I use pgAdmin to connect to my database, it keeps failing and shows "connection timeout expired". However, if I use
psql -U myusername -d dbname inside the container, I can enter the database normally and use various commands. In other words, it works normally inside the container but not from the outside.
Where could the problem be? I am sure I have opened external port 5432.

