How to run pg_dump/pg_dumpall command on Linux?
Asked Answered
P

1

6

Hello everyone i am try to create backup in postgres through dump. when i run the command through command line it wants password when i give the password it will give some error

pg_dump: [archiver (db)] connection to database "nsdgpkidb" failed: FATAL:  password authentication failed for user "root" 

if any one have some valuable time please help me thanks.

Pattipattie answered 15/6, 2012 at 8:33 Comment(0)
M
13

Such kind of questions are better to ask on ServerFault. You have to provide pg_dump with the valid postgresql account via command line parameter:

pg_dump -U postgres nsdgpkidb > file.sql

By default it assumes the current local user account (root). Another way is to change the current user and issue the command.

Mohsen answered 15/6, 2012 at 8:42 Comment(4)
where will the dump file get saved?Minx
@Minx > file.sql means file.sql in the current directory, or you can use full or relative path, like > /path/to/file/file.sqlMohsen
@ArtemKoshelev server fault or DBA? ;)Fugger
@Minx you can define the path absolute: pg_dump -U postgres name_of_BD > '/dir_to_backup/Class_international.sql'Totem

© 2022 - 2024 — McMap. All rights reserved.