本文介绍了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转储权限被拒绝
发布评论