【PostgreSQL】FATAL: Ident authentication failed for user

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Mr_EvanChen/article/details/83626250

问题描述

      项目部署在服务器上(数据库postgresql同样是安装在该服务器上),启动时发现报错,org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "ptms"。

问题原因

      postgresql的一个配置文件pg_hba.conf中没有信任该服务器ip导致报错。

解决办法

      修改pg_hba.conf配置文件相应的地方,将其改为trust。

      如果找不到该文件,可使用如下命令进行查找

find / -name pg_hba.conf

      重新启动postgresql服务,即可!

systemctl restart postgresql-10.service

猜你喜欢

转载自blog.csdn.net/Mr_EvanChen/article/details/83626250