postgresql怎么登录上
2023-04-18 14:24:14 时间
postgresql登录失败的解决方法:
1.确认phpPgAdmin是否可以链接到postgresql数据库,方法:查看data/pg_log下的log有没有phpPgAdmin的访问记录,有则说明可以链接。
以下为出错信息:
LOG: provided username (postgres) and authenticated username (apache) don't match FATAL: Ident authentication failed for user "postgres"
2.查看postgresql的认证方法:pg_hba.conf
# "local" is for Unix domain socket connections only local all all ident # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5
看着好像跟ident认证方式有点关系,最后在官方文档找到一句话:
When using an external authentication system like Ident or GSSAPI, the name of the operating system user that initiated the connection might not be the same as the database user he needs to connect as.
明白了,原来上面的[local all all ident]搞的鬼,如果是ident的话需要配置 pg_ident.conf文件,所以果断换成除以上两种加密方式外的方法
重启postgresql:#service postgresql restart.
再访问一次,成功。
相关文章
- Python使用tkinter组件Label显示简单数学公式
- 内网渗透之DCOM横向移动
- 以目标为导向的语义交流的共同语言——一个课程学习框架
- python爬虫前奏【成信笔记】
- HTML 5 File API:文件拖放上传功能
- 教你快速创建 Python 虚拟环境
- pyenv 实现Python多版本自由切换
- 用 Python 对 Excel文件进行批量操作
- Python - 接入钉钉机器人
- Python - 抓取 iphone13 pro 线下店供货信息并发送到钉钉机器人,最后设置为定时任务
- crontab - 解决 mac 下通过 crontab 设置了 Python 脚本的定时任务却无法运行
- [源码解析] PyTorch分布式(5) ------ DistributedDataParallel 总述&如何使用
- Python科普系列——类与方法(上篇)
- SAP对STO的交货单执行PGI,报错 -Fld selectn for mvmt type 643 acct 400020 differs
- Spring Boot 实现通用 Auth 认证的 4 种方式
- 盘点4种使用Python批量合并同一文件夹内所有子文件夹下的Excel文件内所有Sheet数据
- OushuDB 学习经验分享(三):技术特点
- Java和Python思维方式的不同之处
- Python中日志记录新技能
- 奥比中光Gemini OpenCV—Python使用