Forums

PSQL dump asking for password

I'm following https://help.pythonanywhere.com/pages/RegularPostgresBackups/ but when I execute the command in the console I am being asked for a password. If I enter through I get an error

pg_dump: [archiver (db)] connection to database "db_name" failed: fe_sendauth: no password supplied

I am sure I have done this previously without supplying a password. If I execute the command from my root directory instead it seems to work but I get the error:

pg_dump: [custom archiver] could not open output file "pgbackup2018-12-12-1924.dump": Permission denied

Which I assume is because I can't create files in that directory.

Yes, you're right about the second error -- I think the file permission check is happening before the password prompt, so that's why you're seeing it rather than the "no password supplied" error.

You'll always be prompted for a password when connecting to your Postgres instance -- the server doesn't know who you are from its end of the network connection, so it has to authenticate you to make sure that you're not another PythonAnywhere user trying to connect to a database they don't own.

Could you send us the exact contents of the bash console where you're getting the error -- everything from the command you're running to the error message? It's probably safest to send it over email to support@pythonanywhere.com just to make sure that you don't inadvertently publish anything secret in the public forums.