您现在的位置是:课程教程文章

PostgreSQL运行不起来怎么办

2023-12-18 19:20课程教程文章 人已围观

PostgreSQL运行不起来怎么办

PostgreSQL运行不起来的原因之一是文件夹 “/var/lib/pgsql/9.3/data”权限错误, 权限应该是 rwx (0700)。

推荐:PostgreSQL教程

日志文件(/var/lib/pgsql/9.3/pgstartup.log)报错如下:

...
< 2016-07-11 19:09:04.421 CST >DETAIL:  Permissions should be u=rwx (0700).
< 2016-07-11 19:27:05.271 CST >FATAL:  data directory "/var/lib/pgsql/9.3/data" has group or world access
< 2016-07-11 19:27:05.271 CST >DETAIL:  Permissions should be u=rwx (0700).
< 2016-07-11 20:03:10.555 CST >FATAL:  data directory "/var/lib/pgsql/9.3/data" has group or world access
< 2016-07-11 20:03:10.555 CST >DETAIL:  Permissions should be u=rwx (0700).
< 2016-07-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数据库,问题解决。

推荐学习《Python教程》。

课程教程:PostgreSQL运行不起来怎么办

上一篇:PostgreSQL数组怎么添加元素

下一篇:没有了

站点信息

  • 文章统计篇文章