postgresql – Postgres应用程序尝试使用不正确的套接字文件

postgresql – Postgres应用程序尝试使用不正确的套接字文件,第1张

概述我有一个运行的本地postgres服务器(在ubuntu linux上).它通过套接字文件监听: $ls -la /var/run/postgresql/total 8drwxrwsrwx 2 postgres postgres 100 2011-04-15 19:06 .drwxr-xr-x 26 root root 1100 2011-04-15 19:12 ..- 我有一个运行的本地postgres服务器(在ubuntu linux上).它通过套接字文件监听:
$ls -la /var/run/postgresql/total 8drwxrwsrwx  2 postgres postgres  100 2011-04-15 19:06 .drwxr-xr-x 26 root     root     1100 2011-04-15 19:12 ..-rw-------  1 postgres postgres    5 2011-04-15 19:06 8.4-main.pIDsrwxrwxrwx  1 postgres postgres    0 2011-04-15 19:06 .s.PGsql.5433-rw-------  1 postgres postgres   34 2011-04-15 19:06 .s.PGsql.5433.lock

我可以在命令行上连接到服务器:

$psql -d gis -U rorypsql (8.4.7)Type "help" for help.gis=# \q$psql -d gispsql (8.4.7)Type "help" for help. gis=# \q

我正在尝试使用osm2pgsql,一个来自OpenStreetMap project的应用程序,它将数据导入到pgsql数据库中.

但是我得到的错误是:

$./osm2pgsql/osm2pgsql -m -d gis -U rory ../data.osm.bz2 osm2pgsql SVN version 0.70.5Connection to database Failed: 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"?

值得注意的是,它试图使用套接字文件.s.PGsql.5432,它不存在,而实际的套接字文件名是.s.PGsql.5433,文件名几乎完全相同.

为什么使用错误的文件名,如何使用正确的文件名?

看起来你的Postgresql服务器已经配置为侦听端口5433,而不是默认的5432.你的Postgres客户端应用程序假设默认,因此找不到套接字.在运行应用程序之前,请尝试将PGPORT环境变量设置为5433.例如.:
PGPORT=5433 ./osm2pgsql/osm2pgsql -m -d gis -U rory ../data.osm.bz2
总结

以上是内存溢出为你收集整理的postgresql – Postgres应用程序尝试使用不正确的套接字文件全部内容,希望文章能够帮你解决postgresql – Postgres应用程序尝试使用不正确的套接字文件所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1168752.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存