I'm using postgresql 12 with pgadmin4 on ubuntu 20.04. I'm having an issue with creating a new server. I don't remember specifying any password during installation but now i don't know what the password is and whatever i try to put it just gives a password error saying authentication failed. error message
Asked
Active
Viewed 835 times
3 Answers
0
Create a user and password with (don't miss the semicolon):
CREATE USER username WITH PASSWORD 'your password';
After this, try authenticating your USER in pgAdmin4
For more refer to this link: https://www.postgresql.org/docs/current/sql-createuser.html

1337.ishaan
- 21
- 1
- 6
0
You can reset the password or connect to PostgreSQL without password by modifying pgconf.hba
file and then try to connect.
host all all 0.0.0.0/0 trust

Thirumal
- 8,280
- 11
- 53
- 103
0
I don't know how should I express my thanks to @1337.ishaan and @a_horse_with_no_name without which I couldn't have logged into Postgres through pgadmin4. But a small edit to that:
First we have to get inside postgres through using
sudo -u postgres psql postgres
Enter password for user postgres
Now the terminal will be like this:
postgres=#
- Now enter the given line after postgres=#
CREATE USER username WITH PASSWORD 'your password';
(put your password inside quotes('') and don't forget semicolon(;)

Anish R
- 1
- 1