Postgresql没有在localhost上运行

时间:2016-07-24 15:50:48

标签: postgresql ubuntu-14.04

我最近在我的ubuntu 14.04 vm上安装了postgresql,但我似乎无法从localhost连接到我的数据库:找不到postgres://127.0.0.1:5432/mydb?sslmode=disable,尽管psql mydb带我到正确的终端,sudo netstat -plunt |grep postgres不返回任何内容,但su postgres -c "netstat -plunt |grep postgres"打印:

tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      31/postgres
tcp6       0      0 ::1:5432                :::*                    LISTEN      31/postgres

所以它显然在那里,只是在postgres ubuntu用户之下(但是数据库属于root)。我知道有一种方法可以重新配置我的postgresql安装,以便可以通过localhost(postgres://127.0.0.1:5432/mydb?sslmode=disable工作)来访问它,如果有人能告诉我我需要做什么,那就太棒了。谢谢!

0 个答案:

没有答案
相关问题