P
P
PashaLynx2020-11-06 11:20:09
linux
PashaLynx, 2020-11-06 11:20:09

Problem with Postgresql backup, what's wrong?

Firework. There was such a problem. I have a postgresql db, I'm trying to make a backup >

sudo pg_dump -U drurh -W finance > /tmp/finance.dump

but he writes to me (I enter the data correctly) >
pg_dump: ошибка: не удалось подключиться к базе "finance": ВАЖНО:  пользователь "drurh" не прошёл проверку подлинности (Peer)


I know I need to change the settings. But I can't get to the directory. I get to /var/lib/postgresql/12 , and then, in main, writes to me
bash: cd: ./main/: Отказано в доступе
What's wrong? Please don't hit me too hard, I'm new to this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vreitech, 2020-11-06
@PashaLynx

what the commands say:

whoami
ls -l /var/lib/postgresql/12

If access is denied, then the user under which you are trying to get into the directory does not have rights to this directory. which is generally normal: ordinary users do not always even have read access, especially to DBMS directories. run sudo -ito get root permissions and try to change into this directory again.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question