A
A
Alexander Bondarenko2020-07-13 23:13:09
PostgreSQL
Alexander Bondarenko, 2020-07-13 23:13:09

How to dump postgresql?

I'm trying to dump the database, but I'm getting errors:

pg_dump: [archiver (db)] connection to database "mydb" failed: could not connect to server: Connection refused
        Is the server running on host "0.0.0.0" and accepting
        TCP/IP connections on port 5432?

Request:
pg_dump -h 0.0.0.0 -U mydb -F c -f dump.tar.gz mydbuser

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2020-07-14
@bond_1013

What kind of IP do you have? If the server is on the same machine from which the dump is being made, use 127.0.0.1 or connect via a unix socket :

-h host
--host=host
Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question