使用的命令 psql -U gitea -d giteadb pg服务正常。 原因为pg监听的是tcp端口。所以需要加上 -h 指定host psql -U gitea -d giteadb -h localhost