psql: could not connect to server: No such file or directory


postgresql报错:

  psql: could not connect to server: No such file or directory         Is the server running locally and accepting         connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

1.可能是服务没启动,以下3中启动方式:

  (1) postmaster -D /usr/local/pgsql/data/  (注意:这里的/usr/local/pgsql/data/ 是你的postgresql安装路径)

  (2)postmaster -D /usr/local/pgsql/data/ > logfile 2>&1 &

  (3)pg_ctl start -D /usr/local/pgsql/data/ 

2.可能是系统环境没加psql:

  用which psql回车找到psql路径,用echo $PATH查看PATH中有没有psql路径,没有的话就添加:方法如下:http://www.cnblogs.com/nightswatch/articles/4439776.html

3.还有问题的话:移步http://stackoverflow.com/questions/12472988/postgresql-error-could-not-connect-to-server-no-such-file-or-directory

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM