Postgresql不适用于ubuntu 16.04

前端之家收集整理的这篇文章主要介绍了Postgresql不适用于ubuntu 16.04前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经安装了 postgresql 9.5.13,但它似乎无法正常工作.我不断得到这条消息:

createuser: could not connect to database postgres: 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.5432”?

当我尝试创建用户时.我已经看到这是常见问题,但我无法找到解决方案.

解决方法

查看该服务是否正在运行

systemctl status postgresql

如果Postgresql正在运行,您将看到包含文本Active:active(exited)的输出.

如果您看到Active:inactive(dead),请使用以下命令启动Postgresql服务:

systemctl start postgresql

还需要启用Postgresql才能重启.使用此命令执行此操作:

systemctl enable postgresql

pg_lsclusters

Ver Cluster Port Status Owner    Data directory               Log file
9.5 main 5433 online postgres /var/lib/postgresql/9.5/main /var/log/postgresql/postgresql-9.5-main.log
Status - online - fine

猜你在找的Postgre SQL相关文章