postgresql - map 服务器错误 : FATAL: Ident authentication failed for user "..."

标签 postgresql centos postgis mapserver pg-hba.conf

我正在尝试在 Centos 6 虚拟机上运行 MapServer 5/PostGIS 安装。
我在我的 cgi-bin 文件夹中部署了 MapServer,但是现在当我查询(使用 firefox)mapserv 文件时
使用网址 [virtual machine local IP]/cgi-bin/mapserv?MAP=/var/www/cgi-bin/[...] ,我得到的只是一张带有以下错误消息的图像:

msDrawMap(): Image handling error. Failed to draw layer named '[name of my layer]'.;msPostGISLayerOpen(): Query error. Database connection failed (FATAL: ident authentification failed for user "foo") with connect string 'user=foo dbname=foo password=foo host=localhost port=5432'



我尝试更改 pg_hba.conf 中的设置,但没有成功。
foo 数据库可以使用 foo 作为 sql 用户和 foo 作为密码使用 psql 命令访问。
我能做些什么 ?

最佳答案

根据 http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html
更改 identmd5为用户 foohba.conf

Obtain the operating system user name of the client by contacting the ident server on the client and check if it matches the requested database user name. Ident authentication can only be used on TCP/IP connections. When specified for local connections, peer authentication will be used instead. See Section 19.3.5 for details.



您可以通过 psql 查看您使用的 hba到您的数据库并运行 show hba_file ;

关于postgresql - map 服务器错误 : FATAL: Ident authentication failed for user "...",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37386956/

相关文章:

mysql - 使用 IUS 依赖警告在 Centos 6.5 上升级 MySQL

postgresql - 无法在我的 docker 镜像中的 postgres 中创建 POSTGIS 扩展

sql - 统计比赛参加人数

sql - 查找所有带有希伯来名字的记录

postgresql - PostgreSQL 的 random() 函数的质量?

google-maps - 使用 PostGIS 围绕线串创建多边形

javascript - Node.js 中的数据库查询(PHP 风格)

postgresql - 如何在 slick 3.2.0 中将 Map[String, String] 映射到 (String, String)

linux - 我可以删除/var/log/btmp和/var/log/auth.log文件吗?

linux - Bash - 获取文件的内容