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?
1 Answer
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.
3 Comments
Enrique Vargas
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"?
Dimitar Spasovski
Are you sure that your postgresql server is running ?
Enrique Vargas
Yes, my server was running but I can't find what happened so I had to create another DB.
