简体   繁体   中英

Can't remember my postgres user password to connect server

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?

在此处输入图片说明

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM