简体   繁体   English

创建 postgresql 数据库的备份找不到文件

[英]Creating backup of postgresql database can't find file

I am on Ubuntu 18.04 and I am using Postgresql database.我在 Ubuntu 18.04 上,我正在使用 Postgresql 数据库。 I ran the command我运行了命令

pg_dump dbname > db.bak

but when I do this, it outputs nothing.但是当我这样做时,它什么也没输出。 I tried to supply a path to the backup and the file does not show up.我尝试提供备份路径,但文件未显示。

My exact commands ran are:我运行的确切命令是:

sudo -i -u postgres
psql
pg_dump dbname > db.bak
pg_dump dbname > /db.bak

pg_dump -U myuser -h localhost mydb > db.sql

This worked for me.这对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM