&gt; ...the entire process never once it asked me for a password and while connecting to the database it says that invalid password and I can&#x27;t reset password without connecting to the database!!<p>Well, because you have access to the file that causes Postgres to determine whether or not you need to provide a password to access a given database (<i>pg_hba.conf</i>), you <i>could</i> simply change the authentication method to one that doesn&#x27;t ask for a password. :)<p>However. On every Postgres install I&#x27;ve ever used, there are the following lines in <i>pg_hba.conf</i>:<p><pre><code>  # &quot;local&quot; is for Unix domain socket connections only
  local   all all trust
</code></pre>
If we look carefully, we see that the Type, Database, User, and Method entries are present, but the Address entry is not. The comment also talks about a Unix domain socket connection.<p>Reading the &quot;Connecting to a Database&quot; section of the manual for psql [0] (the official command-line Postgres client) tells us that if we omit the hostname, psql attempts to connect over the Unix domain socket. So, try the following things:<p>* psql<p>When that fails, because &#x27;role &quot;$MY_USERNAME&quot; does not exist&#x27;, try<p>* psql -U $DATABASE_USER<p>(The Postgresql database user is typically postgres.) If that fails for some other reason, try<p>* sudo su - $DATABASE_USER<p>* psql<p>You should now be connected to Postgres.<p>If we enter <i>help</i> , we see that we can enter &quot;\?&quot; for help with psql commands. If we enter <i>\?</i> and look through the list of commands, we should see one that does exactly the thing that we&#x27;re trying to accomplish.<p>Anyway, leave a message here to let me know how this all went, or to ask any follow up questions.<p>[0] <a href="http:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;9.4&#x2F;static&#x2F;app-psql.html" rel="nofollow">http:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;9.4&#x2F;static&#x2F;app-psql.html</a>