title: pgAdmin and terminal: FATAL: password authentication failed for user
body: <p>sup guys!
  I'm trying to create a server local in pdAdmin 4, but everytime i'm trying to create i get this error:</p>
  <p>[Error in pgAdmin]</p>
  <p><img src="https://i.stack.imgur.com/CaHnk.png" alt="1" /></p>
  <p>in case 'veterano' its my username...</p>
  <p>my tries to make this run (but doesnt work)</p>
  <p><strong>Checking if Postgres Service is Installed correctly:</strong></p>
  <p><code>$ sudo systemctl is-active postgresql</code>
  terminal back:
  <code>active</code></p>
  <p><code>$ sudo systemctl is-enabled postgresql</code>
  terminal back:
  <code>enabled</code></p>
  <p><code>$ sudo systemctl status postgresql</code>
  terminal back:
  <code>active (exited)</code></p>
  <p><code>$ sudo pg_isready</code>
  terminal back:
  <code>/var/run/postgresql:5433 - accepting connections</code></p>
  <p><strong>My configuration to pg_hba.conf :</strong></p>
  <pre><code>local   all             postgres                                peer
  
  # TYPE  DATABASE        USER            ADDRESS                 METHOD
  
  # &quot;local&quot; is for Unix domain socket connections only
  local   all             all                                     peer
  # IPv4 local connections:
  host    all             all             127.0.0.1/32            md5
  # IPv6 local connections:
  host    all             all             ::1/128                 md5
  # Allow replication connections from localhost, by a user with the
  # replication privilege.
  local   replication     all                                     peer
  host    replication     all             127.0.0.1/32            md5
  host    replication     all             ::1/128                 md5
  </code></pre>
  <p>(every time after change something in pg_hba.conf I run <code>$ sudo systemctl restart postgresql</code> to restart postgress service.)</p>
  <p><strong>Checking psql and the new superusers:</strong>
  <code>$ sudo -u postgres createuser -s $USER</code></p>
  <p>terminal back
  <code>createuser: error: creation of new role failed: ERROR:  role &quot;veterano&quot; already exists</code>
  if I try
  <code>psql -U veterano</code> i can login... so i try <code>\du</code> to check list of roles
  terminal back</p>
  <pre><code>                                    List of roles
    Role name  |                         Attributes                         | Member of 
  -------------+------------------------------------------------------------+-----------
   postgres    | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
   veterano    | Superuser, Create role, Create DB                          | {}
  
  </code></pre>
  <p>So I try create a localhost server in terminal:
  <code>$ psql -h localhost -d mydatabase -U veterano -p 5432 </code></p>
  <p>terminal back:
  <code> Password for user veterano:</code></p>
  <p><strong>(I put my password maked with <code>ALTER USER veterano PASSWORD 'newPassword';</code>)</strong></p>
  <p>terminal back error
  <code>psql: error: FATAL:  password authentication failed for user &quot;veterano&quot;</code></p>
  <p>I really don't know what to do... I tried everything and still cant create a local server in pgAdmin 4 or directly in terminal.</p>
  <p>Using Ubuntu 20.04.2 LTS</p>
  <p><em>(Sorry for my english )</em></p>