-2

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

3 Answers3

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:

  1. First we have to get inside postgres through using

    sudo -u postgres psql postgres

  2. Enter password for user postgres

Now the terminal will be like this:

postgres=#
  1. 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