PostgreSQL运行不起来怎么办?详细的解决方法来了

很多小伙伴都问小编,我的PostgreSQL运行不起来怎么办?那么今天小编就通过这篇文章来给大家分享一个解决PostgreSQL运行不起来的方法,希望大家通过阅读之后能够完美的解决自己的问题 。

PostgreSQL运行不起来怎么办?详细的解决方法来了

文章插图
PostgreSQL运行不起来的原因之一是文件夹 “/var/lib/pgsql/9.3/data”权限错误,权限应该是 rwx (0700) 。
【PostgreSQL运行不起来怎么办?详细的解决方法来了】日志文件(/var/lib/pgsql/9.3/pgstartup.log)报错如下:
< 2022-04-11 19:09:04.421 CST >DETAIL:Permissions should be u=rwx (0700).< 2022-04-11 19:27:05.271 CST >FATAL:data directory "/var/lib/pgsql/9.3/data" has group or world access< 2022-04-11 19:27:05.271 CST >DETAIL:Permissions should be u=rwx (0700).< 2022-04-11 20:03:10.555 CST >FATAL:data directory "/var/lib/pgsql/9.3/data" has group or world access< 2022-04-11 20:03:10.555 CST >DETAIL:Permissions should be u=rwx (0700).< 2022-04-11 20:11:01.442 CST >FATAL:data directory "/var/lib/pgsql/9.3/data" has group or world access解决方法:
切换到 具有root权限的用户,
(1)先把文件夹 “/var/lib/pgsql/9.3/data” 的用户所属组,给postgres 用户:
进入/var/lib/pgsql/9.3目录
cd /var/lib/pgsql/9.3
chown -R postgres:postgres data
(2)把data目前的所有文件及子目录文件权限改成: rwx (0700)
chmod -R 0700 data
重启PostgreSQL数据库,问题解决 。
以上就是小编给大家带来的解决PostgreSQL运行不起来的方法,希望大家通过阅读小编的文章之后能够有所收获!如果大家觉得小编的文章不错的话,可以多多分享给有需要的人 。

    推荐阅读