Postgresql dump permission denied

前端 未结 6 499
予麋鹿
予麋鹿 2021-02-03 18:52

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          


        
6条回答
  •  广开言路
    2021-02-03 19:36

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

    $ pg_dump -h localhost mydb >/tmp/tempfile
    

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

提交回复
热议问题