0

I'm working in this Django app but I stopped working on it per two weeks, so my computer was off during this time. Now I want to work on it again this error appear to me over and over again in my command line, I opened pgAdmin and found is because I need my password for my postgres user and I can't remember it. Does anybody knows how to fix this?

enter image description here

Enrique Vargas
  • 159
  • 2
  • 13
  • your error says nothing on authentication. it looks postgres cluster is not running - just start it. – Vao Tsun Apr 19 '18 at 07:18

1 Answers1

1

The postgres account has no password (by default). You should not be using this account to connect to the database. If you are using a linux distribution, you can execute the following command in order to create another user account that you can use for login:

sudo -u postgres psql -c "create user newuser with superuser password 'new_password_123';"

This way you will create a user with username newuser and password new_password_123

There is also another way to reset the password that is explained in this question.

Dimitar Spasovski
  • 2,023
  • 9
  • 29
  • 45
  • I tried that way and obtained: Password: could not identify current directory: Permission denied psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? – Enrique Vargas Apr 18 '18 at 20:22
  • 2
    Are you sure that your postgresql server is running ? – Dimitar Spasovski Apr 18 '18 at 20:25
  • Yes, my server was running but I can't find what happened so I had to create another DB. – Enrique Vargas Apr 20 '18 at 14:56