当前位置:首页 > 操作系统 > Windows

无法连接到服务器:适用于Linux的Windows子系统中ubuntu上的Postgresql

我正在将WSL与ubuntu 18.04发行版一起使用,在bash中击中了sudo -u postgres psql
我收到以下错误:

<code>psql: could not connect to server: No such file or directory
Is the server running locally and accepting connections on
Unix domain socket "/var/run/postgresql/.s.PGSQL.5433"?
</code>

然后我尝试了其他postgres操作,例如:sudo -u createdb mydb
只得到相同的错误.

请指教.

解决方法:

在适用于Linux的Windows子系统中的Ubuntu上运行PostgreSQL时,可能必须手动启动数据库服务器才能连接.使用以下命令启动数据库服务器,然后尝试连接.

sudo /etc/init.d/postgresql开始


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐