Re: I lost my password

From: <papa(at)arbolone(dot)ca>
To: "PostGreSQL MailingList" <pgsql-general(at)postgresql(dot)org>
Subject: Re: I lost my password
Date: 2015-07-27 13:54:46
Message-ID: 6B286EA2B04A43B595886EA978569393@ArbolOnePC
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It worked!
Thanks kids, that was awesome!

One last question, is there a tutorial about accessing the back end using
c++
Again, thanks soooo much!

-----Original Message-----
From: Raymond O'Donnell
Sent: Monday, July 27, 2015 9:28 AM
To: papa(at)arbolone(dot)ca ; Adrian Klaver ; PostGreSQL MailingList
Subject: Re: [GENERAL] I lost my password

On 27/07/2015 04:15, papa(at)arbolone(dot)ca wrote:
> OK, I think I should tell you folks that I am a newbie. I am using
> postgresql to learn the SQL for the purpose of learning storing the data
> in my c++ application. I have near zero knowledge of SQL or PostgreSQL
> for that matter.
> When I type C:\pgsql, I am asked to entered a password, but I don't
> recall the any passwords I might've set up at installation time.

Hello there,

Adrian's advice about re-installing is probably the easiest way to do
it. However, here's another route, just for completeness (I'm assuming
that you're installing on your own laptop or similar, not a server):

Find the file pg_hba.conf in the data directory. Look for a "host" line
like this:

host all all 127.0.0.1/32 md5

Change "md5" to "trust", save the file and re-start the PostgreSQL
service. You should then be able to connect without a password:

psql -U postgres

NB - If you don't specify a Postgres user with -U, Postgres assumes that
you're connecting as the current operating system user.

You can then reset the password for the user "postgres" (or whatever
user you used to connect):

alter role postgres with password 'whatever';

Don't forget to edit pg_hba.conf once again and set "trust" back to
"md5' (and re-start the service).

Finally, note that the "postgres" user is the super-user, so the usual
caveats apply... better to create another ordinary user for normal
connections.

I hope this helps,

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2015-07-27 13:55:00 Re: Connections closing due to "terminating connection due to administrator command"
Previous Message Adrian Klaver 2015-07-27 13:54:32 Re: Postgres SSL connection without client certificates.