我通过命令行运行docker postgres容器:
docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=passme -d postgres
但是在IntelliJ中我无法访问此容器 出现以下错误信息:
[08001] Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
java.net.ConnectException: Connection refused: connect.
您知道任何问题吗,也许是端口问题?