Thread: Problem while using createdb for the first time
Hi, I built postgresql from source using Windows 2005. After installation, I am trying to create a database using createdb. It then asks for a password. What password is it? There are now passwords set on my system. Also tried editing pg_hba.conf.But could not solve the problem. How do I move ahead. Thanks Regards
Thanks for your response, but it didn't work. It goes like this, c:\>createdb demo Password: createdb: couldnot connect to database postgres: FATAL: Password authentication failed for user 'prof'. I made the following change in pg_hba.conf and it still did not work. local all all 127.0.0.1 trust I haven't set any password anywhere. But, just in case I have forgotten, what do I do? Thanks Regards, Swati --- On Tue, 6/30/09, Patrick <flymooney@gmail.com> wrote: > From: Patrick <flymooney@gmail.com> > Subject: Re: [NOVICE] Problem while using createdb for the first time > To: "Ms swati chande" <swativc@yahoo.com> > Date: Tuesday, June 30, 2009, 9:33 AM > Ms swati chande wrote: > > Hi, > > > > I built postgresql from source using Windows 2005. > > > > After installation, I am trying to create a database > using > > > > createdb. > > > > It then asks for a password. What password is it? > There are now passwords set on my system. Also tried editing > pg_hba.conf. But could not solve the problem. > > > > How do I move ahead. > > > > Thanks > > > > Regards > > Try "postgres" (works on Linux but I'm not sure about > Windows). > > If you edit pg_hba.conf to "trust", it should work also > (but watch your security). > > Patrick > > > > > >
In response to Ms swati chande : > > Thanks for your response, but it didn't work. > > It goes like this, > > c:\>createdb demo > Password: > createdb: couldnot connect to database postgres: FATAL: Password authentication failed for user 'prof'. > > I made the following change in pg_hba.conf and it still did not work. > local all all 127.0.0.1 trust You don't need a ip-address for local, local means a Unix-Socket, not a ip-address. I'm not a windoze-expert, but i guess, you need a host-entry, not a local-entry. > > > --- On Tue, 6/30/09, Patrick <flymooney@gmail.com> wrote: Please, no top-posting. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
Hi, > It goes like this, > > c:\>createdb demo > Password: > createdb: couldnot connect to database postgres: FATAL: Password authentication failed for user 'prof'. > > I made the following change in pg_hba.conf and it still did not work. > local all all 127.0.0.1 trust Just a few questions: What did your initdb command look like What version of postgres are you using What windows version are you using (2005 isn't a windows version) Did it work in the past Have you read the manual about pg_hba.conf What do the logs says when starting the database. Is it running as a commandline or as a service What are the starup paramaters. Have you edited postgresql.conf HTH Regards, Serge Fonville
> initdb: removing contents of data directory "e:/postgresql/data" indicates your data directory isn't created. based on the output this is caused by > creating template1 database in e:/postgresql/data/base/1 ... FATAL: could not select a suitable default timezone > DETAIL: It appears that your GMT time zone uses leap seconds. PostgreSQL does not support leap seconds. If you resolve these first, the following steps should go more smoothly. Probably it is a good idea to specify a user when running initdb, this does not need to be a user that exists on the system, although things do tend to become easier when it is. That will then become the superuser. Afterwards, it is advisable to add a host record to he pg_hba.conf (which should be located in the data directory) As an alternative you can set PGDATA environment variable to tell postgres.exe where to find the data That way you do not have to specify it to initdb, pg_ctl, postgres or any other PostgreSQL executable Also change the setting of listen_address under windows. After that, you can change the configuration in pg_hba.conf to match a TCP/IP setup HTH