Postgres服务无法启动

时间:2015-05-20 04:41:56

标签: postgresql

我对postgres有疑问。由于pg_hba.conf文件

的更改而停止

其实我的postgres没有用PHP连接

所以我改变了/var/lib/pgsql/data/pg_hba.conf文件中的方法:

TYPE     DATABASE           USER            ADDRESS                 METHOD
host       all              all             127.0.0.1/32            ident

为了解决我的连接错误,我将方法ident更改为trust并且postgresql servicer停止

即使没有开始,我也会回滚我的更改。

错误是:

  

日志:无法打开配置文件" /var/lib/pgsql/9.4/data/pg_hba.conf":权限被拒绝

1 个答案:

答案 0 :(得分:2)

我假设postgresql与postgres用户一起运行,就像在标准配置中一样。

从终端,以root身份:

ls -l /var/lib/pgsql/9.3/data/pg_hba.conf

并验证所有者。如果所有者不是postgres:

chown postgres:postgres pg_hba.conf

并确保它有读写权限:

chmod u+rwx pg_hba.conf
相关问题