本文介绍了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转储权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!