【发布时间】:2013-04-15 12:08:21
【问题描述】:
我在 ubuntu 13.04 上更改 postgresql 9.1 上的数据目录时遇到问题:
我先做了一个:
sudo pg_dropcluster --stop 9.1 main
然后尝试在所需路径中创建一个新路径:
sudo pg_createcluster -d /home/fccoelho/Documentos/databases/postgresqldata 9.1 main
但我因权限被拒绝而失败:
Creating new cluster (configuration: /etc/postgresql/9.1/main, data: /home/fccoelho/Documentos/databases/postgresqldata/)...
initdb: could not access directory "/home/fccoelho/Documentos/databases/postgresqldata": Permission denied
Error: initdb failed
我应该提一下,我检查了权限,尝试手动创建目录并在之后“chowning”给用户 postgres 等等。没有任何改变权限被拒绝的消息。
我也尝试使用与 POstgresql 一起分发的 initdb 二进制文件,但没有成功
我该如何进行这项工作?
【问题讨论】:
-
不只是目标目录。为了遍历路径,路径上的任何目录都必须为“others”设置“x”位(除非它自己属于 postgres)。你检查过吗?
-
谢谢,请参阅下面的解决方法。可能和x位有关,但我没查过。
标签: database postgresql ubuntu