在postgres用户下,我尝试了psql
命令,我收到了这个错误:
psql:无法连接到服务器:没有这样的文件或目录 服务器是在本地运行还是接受 Unix域套接字上的连接“/var/run/postgresql/.s.PGSQL.5432”
但是当我运行/usr/local/pgsql/bin/psql
时,它正在运行。
我的配置有什么问题吗?
答案 0 :(得分:1)
您也可以包含数据库用户:
psql -U postgres -p 5432 -h localhost
答案 1 :(得分:0)
您是否重新安装了postgresql-9.6.3?
您需要完全卸载postgresql
sudo apt-get --purge autoremove postgresql*
sudo apt install postgresql-9.6