Skip to main content
Fixed the weird syntax highlighting (as a result, the diff looks more extensive than it really is - use view "Side-by-side Markdown" to compare), etc.
Source Link
Peter Mortensen
  • 31.2k
  • 22
  • 111
  • 134

Go to your PostgreSQL configuration and edit file pg_hba.conf:

sudo vim /etc/postgresql/9.3/main/pg_hba.conf

Then change this line:

Database administrative login by Unix domain socket
local      all              postgres                                md5
Database administrative login by Unix domain socket
local      all              postgres                                md5

to:

Database administrative login by Unix domain socket
local   all             postgres                                peer
Database administrative login by Unix domain socket
local   all             postgres                                peer

then RestartThen restart the PostgreSQL service via SUDOthe 'sudo' command then. Then

psql -U postgres

You will be now entered and will see the PostgresqlPostgreSQL terminal.

Then enter

\password

\password

And enter the new password for the PostgreSQL default user. After successfully changing the password again, go to the pg_hba.conf and revert the change to "md5".

Now you will be logged in as.

psql -U postgres
psql -U postgres

with your new password.

Go to your PostgreSQL configuration and edit pg_hba.conf:

sudo vim /etc/postgresql/9.3/main/pg_hba.conf

Then change this line:

Database administrative login by Unix domain socket
local      all              postgres                                md5

to:

Database administrative login by Unix domain socket
local   all             postgres                                peer

then Restart the PostgreSQL service via SUDO command then

psql -U postgres

You will be now entered and will see the Postgresql terminal.

Then enter

\password

And enter the new password for the PostgreSQL default user. After successfully changing the password again go to the pg_hba.conf and revert the change to "md5".

Now you will be logged in as.

psql -U postgres

with your new password.

Go to your PostgreSQL configuration and edit file pg_hba.conf:

sudo vim /etc/postgresql/9.3/main/pg_hba.conf

Then change this line:

Database administrative login by Unix domain socket
local      all              postgres                                md5

to:

Database administrative login by Unix domain socket
local   all             postgres                                peer

Then restart the PostgreSQL service via the 'sudo' command. Then

psql -U postgres

You will be now entered and will see the PostgreSQL terminal.

Then enter

\password

And enter the new password for the PostgreSQL default user. After successfully changing the password again, go to the pg_hba.conf and revert the change to "md5".

Now you will be logged in as

psql -U postgres

with your new password.

Active reading [<https://en.wikipedia.org/wiki/PostgreSQL> <https://english.stackexchange.com/questions/4645/is-it-ever-correct-to-have-a-space-before-a-question-or-exclamation-mark#comment206109_4645>]. Removed the weird capitalisation of words. Removed meta information (this belongs in comments).
Source Link
Peter Mortensen
  • 31.2k
  • 22
  • 111
  • 134

Go to your Postgresql ConfigPostgreSQL configuration and Edit pg_hba.confedit pg_hba.conf:

sudo vim /etc/postgresql/9.3/main/pg_hba.conf

Then Changechange this Line line:

Database administrative login by Unix domain socket
local      all              postgres                                md5

to  :

Database administrative login by Unix domain socket
local   all             postgres                                peer

then Restart the PostgreSQL service via SUDO command then

psql -U postgres

You will be now entered and will Seesee the Postgresql terminal.

thenThen enter

\password

andAnd enter the NEW Passwordnew password for Postgresthe PostgreSQL default user,. After Successfullysuccessfully changing the Passwordpassword again go to the pg_hba.confpg_hba.conf and revert the change to "md5".

nowNow you will be logged in as.

psql -U postgres

psql -U postgres

with your new Password.

Let me know if you all find any issue in itpassword.

Go to your Postgresql Config and Edit pg_hba.conf

sudo vim /etc/postgresql/9.3/main/pg_hba.conf

Then Change this Line :

Database administrative login by Unix domain socket
local      all              postgres                                md5

to  :

Database administrative login by Unix domain socket
local   all             postgres                                peer

then Restart the PostgreSQL service via SUDO command then

psql -U postgres

You will be now entered and will See the Postgresql terminal

then enter

\password

and enter the NEW Password for Postgres default user, After Successfully changing the Password again go to the pg_hba.conf and revert the change to "md5"

now you will be logged in as

psql -U postgres

with your new Password.

Let me know if you all find any issue in it.

Go to your PostgreSQL configuration and edit pg_hba.conf:

sudo vim /etc/postgresql/9.3/main/pg_hba.conf

Then change this line:

Database administrative login by Unix domain socket
local      all              postgres                                md5

to:

Database administrative login by Unix domain socket
local   all             postgres                                peer

then Restart the PostgreSQL service via SUDO command then

psql -U postgres

You will be now entered and will see the Postgresql terminal.

Then enter

\password

And enter the new password for the PostgreSQL default user. After successfully changing the password again go to the pg_hba.conf and revert the change to "md5".

Now you will be logged in as.

psql -U postgres

with your new password.

Source Link

Go to your Postgresql Config and Edit pg_hba.conf

sudo vim /etc/postgresql/9.3/main/pg_hba.conf

Then Change this Line :

Database administrative login by Unix domain socket
local      all              postgres                                md5

to :

Database administrative login by Unix domain socket
local   all             postgres                                peer

then Restart the PostgreSQL service via SUDO command then

psql -U postgres

You will be now entered and will See the Postgresql terminal

then enter

\password

and enter the NEW Password for Postgres default user, After Successfully changing the Password again go to the pg_hba.conf and revert the change to "md5"

now you will be logged in as

psql -U postgres

with your new Password.

Let me know if you all find any issue in it.