Thread: Password?
Hi When I write the following commands at the prompt, >createuser -S -d -R user1 > createdb sample I am asked to enter a password. I have not set any password anywhere. Which password is it asking for? Please help. I have built from source on Windows XP. Thanks is advance, Regards Swati |
Ms swati chande schrieb: > Hi > > When I write the following commands at the prompt, > > >createuser -S -d -R user1 > > createdb sample > > I am asked to enter a password. I have not set any password anywhere. > Which password is it asking for? > Please help. > I have built from source on Windows XP. > > Thanks is advance, > > Regards > Swati Hi Swati, what are the setting of your pg_hba.conf? I assume that there is a entry like this: # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all password That means that the password you are asked is the password of the standard user for your cluster - commonly postgres. Cheers Andy
Andreas Wenk schrieb: > Ms swati chande schrieb: >> Hi >> >> When I write the following commands at the prompt, >> >> >createuser -S -d -R user1 >> > createdb sample >> >> I am asked to enter a password. I have not set any password anywhere. >> Which password is it asking for? >> Please help. >> I have built from source on Windows XP. >> >> Thanks is advance, >> >> Regards >> Swati > Hi Swati, > > what are the setting of your pg_hba.conf? I assume that there is a entry > like this: > > # TYPE DATABASE USER CIDR-ADDRESS METHOD > > # "local" is for Unix domain socket connections only > local all all password > > > That means that the password you are asked is the password of the > standard user for your cluster - commonly postgres. > > Cheers > > Andy *argh* - more detailed to avoid confusion. The auth method 'password' in pg_hba.conf means, that you will be asked for a password for the user you try to create a db with. If no user is given (with createdb -U [username]), this user is postgres ... see also createdb --help for options ... Cheers Andy
Ms swati chande schrieb: > --- On *Wed, 7/8/09, Andreas Wenk /<a.wenk@netzmeister-st-pauli.de>/* wrote: > > > From: Andreas Wenk <a.wenk@netzmeister-st-pauli.de> > Subject: Re: [GENERAL] Password? > To: "Ms swati chande" <swativc@yahoo.com>, "PG-General Mailing List" > <pgsql-general@postgresql.org> > Date: Wednesday, July 8, 2009, 3:47 PM > > Ms swati chande schrieb: > > Thanks Andy, > > I am working on Windows XP. Have built from source using Visual > Studio 2005. > > I have made a change in pg_hba.conf to include the ipconfig of > my system. > > # TYPE DATABASE USER CIDR-ADDRESS METHOD > > *host all all <my ipconfig> trust* > > # IPv4 local connections: > > host all all 127.0.0.1/32 trust > > # IPv6 local connections: > > #host all all ::1/128 trust > > > > This was to take care of the following problem: > > LOG: could not bind IPv4 socket: Address already in use > > HINT: Is another postmaster already running on port 5432? If not, > wait a few seconds and retry. > > WARNING: could not create listen socket for "*" > > FATAL: could not create any TCP/IP sockets > > For this I changed the listen_addresses to my current ip. and > made the same change in pg_hba.conf. > > Thanks > > Regards > > Swati > > > > So does it work now ? Why is there a * sign before host? This seems > to be incorrect ... > > P.S.: dont' forget to reply also to the mailinglist (reply to all) > > > > No its still not working. > The * doesn't exist in pg_hba. It was probably in the mail as I had > formatted that line to be 'bold'. ah ok .. Actually it should work if you set listen_addresses to '*' in postgresql.conf. Did you change anything else in postgresql.conf or pg_hba.conf? I am not too experienced with Windows so maybe someone with more knowledge is able to find the trick (I installed 8.4 once with the one click installer ...no problems at all). But as far as I understand something is wrong with: > WARNING: could not create listen socket for "*" > FATAL: could not create any TCP/IP sockets I understand correct, that you fixed this? Then it should work as I mentioned earlier ... Cheers Andy
On Wed, Jul 8, 2009 at 3:22 PM, Andreas Wenk <a.wenk@netzmeister-st-pauli.de> wrote:
If you don't need the password authentication you have to edit the pg_conf file and replace "password" with "trust", after this reload the cluster. It won't prompt you for password.
Thanks,
Abbas.
Andreas Wenk schrieb:*argh* - more detailed to avoid confusion. The auth method 'password' in pg_hba.conf means, that you will be asked for a password for the user you try to create a db with. If no user is given (with createdb -U [username]), this user is postgres ...Ms swati chande schrieb:HiHi Swati,
When I write the following commands at the prompt,
>createuser -S -d -R user1
> createdb sample
I am asked to enter a password. I have not set any password anywhere. Which password is it asking for?
Please help.
I have built from source on Windows XP.
Thanks is advance,
Regards
Swati
what are the setting of your pg_hba.conf? I assume that there is a entry like this:
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all password
That means that the password you are asked is the password of the standard user for your cluster - commonly postgres.
Cheers
Andy
see also createdb --help for options ...
Cheers
Andy
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
If you don't need the password authentication you have to edit the pg_conf file and replace "password" with "trust", after this reload the cluster. It won't prompt you for password.
Thanks,
Abbas.
Ms swati chande schrieb: > Thanks Andy, > > I am working on Windows XP. Have built from source using Visual Studio 2005. > > I have made a change in pg_hba.conf to include the ipconfig of my system. > > # TYPE DATABASE USER CIDR-ADDRESS METHOD > > *host all all <my ipconfig> trust* > > # IPv4 local connections: > host all all 127.0.0.1/32 trust > # IPv6 local connections: > #host all all ::1/128 trust > > > This was to take care of the following problem: > > LOG: could not bind IPv4 socket: Address already in use > HINT: Is another postmaster already running on port 5432? If not, wait a > few seconds and retry. > WARNING: could not create listen socket for "*" > FATAL: could not create any TCP/IP sockets > > For this I changed the listen_addresses to my current ip. and made the > same change in pg_hba.conf. > > Thanks > > Regards > Swati > So does it work now ? Why is there a * sign before host? This seems to be incorrect ... P.S.: dont' forget to reply also to the mailinglist (reply to all)
>ah ok .. >Actually it should work if you set listen_addresses to '*' in postgresql.conf. Did you >change anything else in postgresql.conf or pg_hba.conf? >I am not too experienced with Windows so maybe someone with more knowledge is able >to find the trick (I installed 8.4 once with the one click installer ...no problems at all). But >as far as I understand something is wrong with: >> WARNING: could not create listen socket for "*" >>FATAL: could not create any TCP/IP sockets >I understand correct, that you fixed this? Then it should work as I mentioned earlier ... Cheers Andy Ok. Will check the '*' part of it and then get back. Infact it was to move ahead with it that I changes the listen addresses in postgresql.conf. But will take another look into it. Thanks, Regards Swati |
On Wed, Jul 8, 2009 at 4:12 PM, Andreas Wenk <a.wenk@netzmeister-st-pauli.de> wrote:
Yes, the * sign should removed and have to mention listen_addresses = ' * ' in Postgresql.conf file.
Ms swati chande schrieb:--- On *Wed, 7/8/09, Andreas Wenk /<a.wenk@netzmeister-st-pauli.de>/* wrote:
From: Andreas Wenk <a.wenk@netzmeister-st-pauli.de>
Subject: Re: [GENERAL] Password?
To: "Ms swati chande" <swativc@yahoo.com>, "PG-General Mailing List"
<pgsql-general@postgresql.org>
Date: Wednesday, July 8, 2009, 3:47 PM
Ms swati chande schrieb:
> Thanks Andy,
> I am working on Windows XP. Have built from source using Visual
Studio 2005.
> I have made a change in pg_hba.conf to include the ipconfig of
my system.
> # TYPE DATABASE USER CIDR-ADDRESS METHOD
> *host all all <my ipconfig> trust*
> # IPv4 local connections:
> host all all 127.0.0.1/32 trust
> # IPv6 local connections:
> #host all all ::1/128 trust
Yes, the * sign should removed and have to mention listen_addresses = ' * ' in Postgresql.conf file.
>> This was to take care of the following problem:
>
> LOG: could not bind IPv4 socket: Address already in use
> HINT: Is another postmaster already running on port 5432? If not,
wait a few seconds and retry.
> WARNING: could not create listen socket for "*"
> FATAL: could not create any TCP/IP sockets
> For this I changed the listen_addresses to my current ip. and
made the same change in pg_hba.conf.
> Thanks
> Regards
> Swati
>
So does it work now ? Why is there a * sign before host? This seems
to be incorrect ...
P.S.: dont' forget to reply also to the mailinglist (reply to all)
> No its still not working.
> The * doesn't exist in pg_hba. It was probably in the mail as I had
> formatted that line to be 'bold'.
ah ok ..
Actually it should work if you set listen_addresses to '*' in postgresql.conf. Did you change anything else in postgresql.conf or pg_hba.conf?
I am not too experienced with Windows so maybe someone with more knowledge is able to find the trick (I installed 8.4 once with the one click installer ...no problems at all). But as far as I understand something is wrong with:
> WARNING: could not create listen socket for "*"
> FATAL: could not create any TCP/IP sockets
I understand correct, that you fixed this? Then it should work as I mentioned earlier ...
Cheers Andy
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
|
Ms swati chande schrieb: > Hi, > > I started everything again from scratch. > 1. Created a new user("Swati"), with limited/ restricted rights. > Ensured that no password is set anywhere. > > 2. Ran initdb from the new user. > c:\postgresql\bin>initdb -D c:\postgresql\data2 > It displayed the DEBUG: start transaction and commit > transaction states etc. > and ended with DEBUG: exit(0) > A warning with the following statement was also displayed: > WARNING: enabling "trust" authentication foe local > connections > you can change this by editing "pg_hba.conf" or by > initdb -A. > > 3. After this I executed pg_ctl: > c:\postgresql\bin>pg_ctl -D c:\postgresql\data2 -l > logfile start > got the the message:server starting > and the logfile contained the following: > LOG: could not bind IPv4 socket: No error > HINT: Is another postmaster already running on > port 5432? If not, > wait a few seconds and retry. > WARNING: could not create listen socket for > "localhost" > FATAL: could not create any TCP/IP sockets > LOG: could not bind IPv4 socket: No error > HINT: Is another postmaster already running on > port 5432? If not, wait > a few seconds and retry. > WARNING: could not create listen socket for > "localhost" > FATAL: could not create any TCP/IP sockets > > 4. To take care of the above issues, > Made the following change in the postgresql.conf file: > listen_addresses = 'xxx.xxx.x.x' (my current ip) > and in pg_hba: > host all all 'xxx.xxx.x.x' trust > > 5.Then issued > c:\postgresql\bin>pg_ctl -D c:\postgresql\data2 -l logfile > start > again. > Now got the following in logfile: > LOG: database system was shut down at 2009-07-08 > 22:34:50 > LOG: database system is ready to accept connections > LOG: autovacuum launcher started > > 6.Opened another command window. > Now when I write in the new window (or even in the same), > c:\postgresql\bin>createdb demo > OR > c:\postgresql\bin>createuser -S -d -R svc > I am prompted for password, I don't know what to enter here. > > I think I am making some mistake in pg_hba.conf. Can't make out. > Must be some brainless blunder some where. > > Thanks a ton for sparing your time and bearing with me. > > Please guide. > > Regards > Swati Swati, sorry to say - but I got no solution as I cannot try to simulate this. I do not have a Windows machine ... hopefully someone else can help. One thing anyway ... Step 4. seems to be correct. Actually, is there a user postgres on your system? Why not give postgres then a password (in the windows user administration) and use c:\postgresql\bin>createuser -U postgres -S -d -R svc But this is really vague ... Cheers Andy
Ms swati chande wrote: > > .... > Made the following change in the postgresql.conf file: > listen_addresses = 'xxx.xxx.x.x' (my current ip) > and in pg_hba: > host all all 'xxx.xxx.x.x' trust > > ... > 6.Opened another command window. > Now when I write in the new window (or even in the same), > c:\postgresql\bin>createdb demo > OR > c:\postgresql\bin>createuser -S -d -R svc > I am prompted for password, I don't know what to enter here. > > try ... createuser -h xxx.xxx.x.x -S -d -R svc by default, its connecting to localhost (127.0.0.1) rather than your IP. (note this behavior is different than on Unix/Linux type systems, where by default it connects to a 'unix domain socket', which doesn't exist on MS Windows). If you only want to connect to this database from the same computer, I'd suggest using 127.0.0.1/localhost rather than xxx.xxx.x.x in both the listen_address and pg_hba...
On Wednesday 08 July 2009 11:48:08 am Ms swati chande wrote: > Hi, > > I started everything again from scratch. > 1. Created a new user("Swati"), with limited/ restricted rights. > Ensured that no password is set anywhere. How limited? Can this user do administrative tasks, i.e create database,create user? > > 2. Ran initdb from the new user. > c:\postgresql\bin>initdb -D c:\postgresql\data2 > It displayed the DEBUG: start transaction and commit transaction > states etc. and ended with DEBUG: exit(0) > A warning with the following statement was also displayed: > WARNING: enabling "trust" authentication foe local connections > you can change this by editing "pg_hba.conf" or by initdb -A. > > 3. After this I executed pg_ctl: > c:\postgresql\bin>pg_ctl -D c:\postgresql\data2 -l logfile > start got the the message:server starting > and the logfile contained the following: > LOG: could not bind IPv4 socket: No error > HINT: Is another postmaster already running on port 5432? > If not, wait a few seconds and retry. > WARNING: could not create listen socket for "localhost" > FATAL: could not create any TCP/IP sockets > LOG: could not bind IPv4 socket: No error > HINT: Is another postmaster already running on port 5432? > If not, wait a few seconds and retry. > WARNING: could not create listen socket for "localhost" > FATAL: could not create any TCP/IP sockets > > 4. To take care of the above issues, > Made the following change in the postgresql.conf file: > listen_addresses = 'xxx.xxx.x.x' (my current ip) > and in pg_hba: > host all all 'xxx.xxx.x.x' trust Can you show the complete pg_hba.conf file? Or to put it another way is the above line the only uncommented line in the file? > > 5.Then issued > c:\postgresql\bin>pg_ctl -D c:\postgresql\data2 -l logfile start > again. > Now got the following in logfile: > LOG: database system was shut down at 2009-07-08 22:34:50 > LOG: database system is ready to accept connections > LOG: autovacuum launcher started > > 6.Opened another command window. > Now when I write in the new window (or even in the same), > c:\postgresql\bin>createdb demo > OR > c:\postgresql\bin>createuser -S -d -R svc > I am prompted for password, I don't know what to enter here. Are you running this as 'Swati' user? > > I think I am making some mistake in pg_hba.conf. Can't make out. > Must be some brainless blunder some where. > > Thanks a ton for sparing your time and bearing with me. > > Please guide. > > Regards > Swati -- Adrian Klaver aklaver@comcast.net