Postgress 和 PHP “用户身份验证失败"

编程入门 行业动态 更新时间:2024-10-14 18:14:25
本文介绍了Postgress 和 PHP “用户身份验证失败"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

在我的本地服务器 (Ubuntu 14.04) 上一切正常.但是在测试服务器(Centos)上,我无法从 PHP(Yii 1.1)连接到我的数据库.在两台服务器上,我使用相同的转储、用户名、密码、postgres 和 php 代码版本.

On my local server (Ubuntu 14.04) all work ok. But on test server (Centos) i cannot connect from PHP (Yii 1.1) to my database. On both servers i used same dump, user name, password, postgres and php code versions.

在本地服务器 apache 上.测试 nginx.

On local server apache. On Test nginx.

CDbConnection 无法打开数据库连接:SQLSTATE[08006] [7]致命:用户tripinsu"的身份验证失败

CDbConnection failed to open the DB connection: SQLSTATE[08006] [7] FATAL: Ident authentication failed for user "tripinsu"

pg_hba.conf:

pg_hba.conf:

local   all             all                                     md5
host    all             all             127.0.0.1/32            ident
host    all             all             ::1/128                 ident

推荐答案

我已修复.不确定我改变了什么.我只是从 ubuntu 复制我正确的配置.

I fixed. Not sure what i changed. I just copy my correct config from ubuntu.

local   all             postgres                                peer
local   all             all                                     md5
host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5

我希望这对其他人有帮助

I hope this help somebody else

这篇关于Postgress 和 PHP “用户身份验证失败"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-23 18:21:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1047410.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:身份验证   用户   Postgress   PHP   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!