Postgres under Windows

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

Postgres under Windows

От:
Danny Gaethofs <dgaethofs@yahoo.com>
Дата:
Dear all,

I need some help to get postgres working under
windows.

I installed postgress using the .msi

I am able to start the pgadminiii and start the
database server with no problems.

Now I try to create a database as explained in the
documentation:  

createdb mydb

The systems asks for a password and when I enter the
password it comes back with:

could not connect to database template1: FATAL:
password authentication failed for user "xxx" 

At first I thought that because the user xxx (which is
not the postgres user) did not exist the error was
given. So I went to pgadminiii and created the user
"xxx" and gave him rights to create a database. But
still the error remains. 

After that I made some changes to the pg_hba.conf file
and changed the method 
host    all         all         127.0.0.1/32   md5

INTO 
host    all         all         127.0.0.1/32   trust


But this does not help either.

Why am I not able to connect to the database
template1?

regards,
Danny

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Postgres under Windows

От:
Tony Caduto <tony_caduto@amsoftwaredesign.com>
Дата:
Did you restart the service?

Did you change the postgresql.conf file to listen on tcp/ip all addresses?
listen_addresses = '*'

>
>After that I made some changes to the pg_hba.conf file
>and changed the method 
>host    all         all         127.0.0.1/32   md5
>
>INTO 
>host    all         all         127.0.0.1/32   trust
>
>
>  
>


Re: Postgres under Windows

От:
Danny Gaethofs <dgaethofs@yahoo.com>
Дата:
Tony,

I tried your suggestion but it is not helping me out.

Restarting the server is not helping either.

What I tried next is create the database in pgadminiii
and assign my userid as the owner.

But that is not working either. So I have run out of
options.

regards,
Danny

--- Tony Caduto 
wrote:
> Did you restart the service?
> 
> Did you change the postgresql.conf file to listen on
> tcp/ip all addresses?
> listen_addresses = '*'
> 
> >
> >After that I made some changes to the pg_hba.conf
> file
> >and changed the method 
> >host    all         all         127.0.0.1/32   md5
> >
> >INTO 
> >host    all         all         127.0.0.1/32  
> trust
> >
> >
> >  
> >
> 
> 
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new Resources site
http://smallbusiness.yahoo.com/resources/

Re: Postgres under Windows

От:
John DeSoi <desoi@pgedit.com>
Дата:
Danny,

On May 30, 2005, at 10:13 AM, Danny Gaethofs wrote:

> Now I try to create a database as explained in the
> documentation:
>
> createdb mydb
>
> The systems asks for a password and when I enter the
> password it comes back with:
>
> could not connect to database template1: FATAL:
> password authentication failed for user "xxx"


If you just entered "createdb mydb" that is not going to work unless 
you are logged into a Windows account which has the same name as a 
PostgreSQL user account that can create databases. If you really called 
createdb with more options, please show us exactly what you typed and 
exactly what the error output is.

You probably want something more like:

createdb.exe -h 127.0.0.1 -U postgres mydb

If you can do things OK with pgAdmin, then it is most likely there is 
just some incorrect option in the command line.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

Re: Postgres under Windows

От:
Danny Gaethofs <dgaethofs@yahoo.com>
Дата:
John,

The command you gave createdb.exe -h 127.0.0.1 -U
postgres mydb is working.

The system gives me the result CREATE DATABASE.

Looking into pgadminiii shows the database is created.

Doing the same with my user account is not working.

Thanks anyway it is making me understand postgres
better.

regards,
Danny

--- John DeSoi  wrote:
> Danny,
> 
> On May 30, 2005, at 10:13 AM, Danny Gaethofs wrote:
> 
> > Now I try to create a database as explained in the
> > documentation:
> >
> > createdb mydb
> >
> > The systems asks for a password and when I enter
> the
> > password it comes back with:
> >
> > could not connect to database template1: FATAL:
> > password authentication failed for user "xxx"
> 
> 
> If you just entered "createdb mydb" that is not
> going to work unless 
> you are logged into a Windows account which has the
> same name as a 
> PostgreSQL user account that can create databases.
> If you really called 
> createdb with more options, please show us exactly
> what you typed and 
> exactly what the error output is.
> 
> You probably want something more like:
> 
> createdb.exe -h 127.0.0.1 -U postgres mydb
> 
> If you can do things OK with pgAdmin, then it is
> most likely there is 
> just some incorrect option in the command line.
> 
> John DeSoi, Ph.D.
> http://pgedit.com/
> Power Tools for PostgreSQL
> 
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
> majordomo@postgresql.org
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Postgres under Windows

От:
Tony Caduto <tony_caduto@amsoftwaredesign.com>
Дата:
Ah, I didn't catch the fact that you where not doing it as the super 
user (postgres)
For another account to work you need to grant that account the createdb 
right.

Look up in the docs about the grant command.

Glad to hear you have it working.

Tony Caduto
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql 8.x


>The command you gave createdb.exe -h 127.0.0.1 -U
>postgres mydb is working.
>
>The system gives me the result CREATE DATABASE.
>
>Looking into pgadminiii shows the database is created.
>
>Doing the same with my user account is not working.
>
>
>  
>


FAQ