Обсуждение: Lost password

Поиск
Список
Период
Сортировка

Lost password

От
Martin Roach
Дата:
Hi
 
I started the installation of postrgres got distracted and then started again but forgot my password. I have received the info below:
 
Now what?
If you have access to shell account on the machine PostgreSQL is running, and your shell works as the same user as Postgres itself, or root - solution is easy.
Find your pg_hba.conf file. It might be in many files so try:
  • $ locate pg_hba.conf
  • find /var/lib/ -type f -name pg_hba.conf
  • find /etc -type f -name pg_hba.conf
  • find / -type f -name pg_hba.conf
Of course last option is your last resort - it will take a long time.
 
However, i'm not that computer savvy and don't now how to go about the above. How come you can't just delete the software and try again?
 
Any help in finding these files and working what to do would be a massive help.
 
 
Thanks.


Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now.

Re: Lost password

От
"Allan Kamau"
Дата:
It is assumed you are running Unix (or Linux). The commands you've
been provided with are standard Unix system commands that will help
you find the files (pg_hba.conf) you are looking for, the output of
these commands (locate or find) is the absolute path to your queried
file (in your case pg_hba.conf) if found. Once you find the file you
will then need to edit this file, this file may only be accessible by
user root or user postgres (I could be wrong). Once edited you may
want to restart PostgreSQL then try to log in. For help on how to edit
the pg_hba.conf file (and to understand what each section if it's
contents means) you will need to look at the PostgreSQL documentation.

If you still have difficulties you may what to Google for more
elaborate answers or use the man command.

Allan.

On Tue, Dec 16, 2008 at 7:20 AM, Martin Roach
<martin_roach2001@yahoo.com.au> wrote:
> Hi
>
> I started the installation of postrgres got distracted and then started
> again but forgot my password. I have received the info below:
>
> Now what?
> If you have access to shell account on the machine PostgreSQL is running,
> and your shell works as the same user as Postgres itself, or root - solution
> is easy.
> Find your pg_hba.conf file. It might be in many files so try:
>
> $ locate pg_hba.conf
> find /var/lib/ -type f -name pg_hba.conf
> find /etc -type f -name pg_hba.conf
> find / -type f -name pg_hba.conf
>
> Of course last option is your last resort - it will take a long time.
>
> However, i'm not that computer savvy and don't now how to go about the
> above. How come you can't just delete the software and try again?
>
> Any help in finding these files and working what to do would be a massive
> help.
>
>
> Thanks.
> ________________________________
> Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now.

Re: Lost password

От
TJ O'Donnell
Дата:
It seems you haven't done anything you need to save, so why
not save time and just reinstall postgres?

TJ

> Hi
> Â
> I started the installation of postrgres got distracted and then started again but forgot my password


Re: Lost password

От
"Allan Kamau"
Дата:
That is a windows user account problem, you will need to have Windows
administrative privileges to reset the password for user postgres.

Allan.

On Wed, Dec 17, 2008 at 5:15 PM, Martin Roach
<martin_roach2001@yahoo.com.au> wrote:
> Hi Allan
>
> Hi Allan
>
> I have deleted the Postgres files so I can re-install. Originally I don't
> know if I fully installed the program - I don't think I did. What I did
> however is log in a password that won't go away even If I delete the
> software.  Now if I delete the software and re-install it still asks for
> this password. I had a computer savvy friend come over and help but to no
> avail. If I try and install it now and I provide a password it gives the
> following message "the password specified was incorrect. Please enter the
> correct password for the postgres windows user account". I believe somewhere
> this password has been registered and won't go away even if the software is
> deleted.
>
> Any help much appreciated!
>
> PS I use windows vista and my friend turned my user account control off.
>
> Why on earth is there not a retrieve password function - unbelievable.
>
>
> Marty.
>
> --- On Tue, 16/12/08, Allan Kamau <kamauallan@gmail.com> wrote:
>
> From: Allan Kamau <kamauallan@gmail.com>
> Subject: Re: [GENERAL] Lost password
> To: martin_roach2001@yahoo.com.au
> Cc: pgsql-general@postgresql.org
> Received: Tuesday, 16 December, 2008, 7:32 PM
>
>
> -----Inline Attachment Follows-----
>
> It is assumed you are running Unix (or Linux). The commands you've
> been provided with are standard Unix system commands that will help
> you find the files (pg_hba.conf) you are looking for, the output of
> these commands (locate or find) is the absolute path to your queried
> file (in your case pg_hba.conf) if found. Once you find the file you
> will then need to edit this file, this file may only be accessible by
> user root or user postgres (I could be wrong). Once edited you may
> want to restart PostgreSQL then try to log in. For help on how to edit
> the pg_hba.conf file (and to understand what each section if it's
> contents means) you will need to look at the PostgreSQL documentation.
>
> If you still have difficulties you may what to Google for more
> elaborate answers or use the man command.
>
> Allan.
>
> On Tue, Dec 16, 2008 at 7:20 AM, Martin Roach
> <martin_roach2001@yahoo.com.au> wrote:
>> Hi
>>
>> I started the installation of postrgres got distracted and then started
>> again but forgot my password. I have received the info below:
>>
>> Now what?
>> If you have access to shell account on the machine PostgreSQL is running,
>> and your shell works as the same user as Postgres itself, or root -
>> solution
>> is easy.
>> Find your pg_hba.conf file. It might be in many files so try:
>>
>> $ locate pg_hba.conf
>> find /var/lib/ -type f -name pg_hba.conf
>> find /etc -type f -name pg_hba.conf
>> find / -type f -name pg_hba.conf
>>
>> Of course last option is your last resort - it will take a long time.
>>
>> However, i'm not that computer savvy and don't now how to go about the
>> above. How come you can't just delete the software and try again?
>>
>> Any help in finding these files and working what to do would be a massive
>> help.
>>
>>
>> Thanks.
>> ________________________________
>> Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now.
>
> ________________________________
> Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now.

Re: Lost password

От
Johan Nel
Дата:
Martin,

You need to find the file pg_hba.conf.

Inside of it find the lines showing:
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5

Change the md5 to trust, make sure it is only for local host that you do it.

Save the file and restart your postgres server.

Use pgAdmin and connect to the server.  When prompted for a password,
give it an empty password.

Press the SQL toolbar button and run the following script:

ALTER USER <yourusername> SET PASSWORD = 'newpassword'

Edit the pg_hba.conf file again and change the trust back to what it was.

Restart the server.

HTH,

Johan Nel
Pretoria, South Africa.

Martin Roach wrote:
> Hi
>
> I started the installation of postrgres got distracted and then started
> again but forgot my password. I have received the info below:
>
> Now what?
> If you have access to shell account on the machine PostgreSQL is
> running, and your shell works as the same user as Postgres itself, or
> root - solution is easy.
> Find your pg_hba.conf file. It might be in many files so try:
>
>     * $ locate pg_hba.conf
>     * find /var/lib/ -type f -name pg_hba.conf
>     * find /etc -type f -name pg_hba.conf
>     * find / -type f -name pg_hba.conf
>
> Of course last option is your last resort - it will take a long time.
>
> However, i'm not that computer savvy and don't now how to go about the
> above. How come you can't just delete the software and try again?
>
> Any help in finding these files and working what to do would be a
> massive help.