title: Getting authentication error while creating Postgres db
body: <p>Getting authentication error while creating Postgres db</p>
  <pre class="lang-sh prettyprint-override"><code>bash-3.2$ createdb blog_api_db
  Password: 
  Password: 
  createdb: error: could not connect to database template1: FATAL:  password authentication failed for user &quot;vish&quot;
  </code></pre>
  <p>login as postgres user works:</p>
  <pre><code>sudo -u postgres psql
  Password:
  Password for user postgres:
  psql (13.2) Type &quot;help&quot; for help.
  postgres=# 
  </code></pre>
  <p><code>pg_hba.conf</code> contents:</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                 trust
  # IPv4 local connections:
  host    all   all   127.0.0.1/32  trust
  # IPv6 local connections:
  host    all   all   ::1/128       trust
  # Allow replication connections from localhost, by a user with the
  # replication privilege.
  local   replication     all                       trust
  host    replication     all       127.0.0.1/32    trust
  host    replication     all       ::1/128         trust
  </code></pre>