PostgreSQL转储权限被拒绝

编程入门 行业动态 更新时间:2024-10-28 04:22:37
本文介绍了PostgreSQL转储权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在尝试转储数据库时遇到此错误,我输入了

I get this error while trying to dump database, i entered

linuxuser $ sudo su postgres linuxuser $ [sudo] password for linuxuser:... $ pg_dump -h localhost mydb >tempfile $ sh: cannot create tempfile: Permission denied

什么问题?我刚刚安装了最新的postgresql。

What the problem? i've just installed fresh postgresql.

推荐答案

写到postgres用户具有写权限的目录中。例如 / tmp 。

Write into directory where postgres user has write access. For instance /tmp.

$ pg_dump -h localhost mydb >/tmp/tempfile

在您的尝试中,postgres用户尝试在属于该目录的随机目录中创建文件其他用户。

In your attempt postgres user tries to create a file in some random directory belonging to the other user.

更多推荐

PostgreSQL转储权限被拒绝

本文发布于:2023-10-16 10:07:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1497263.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:被拒   权限   PostgreSQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!