Postgres under Windows

Started by Danny Gaethofsalmost 21 years ago6 messagesgeneral
Jump to latest
#1Danny 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

#2Tony Caduto
tony_caduto@amsoftwaredesign.com
In reply to: Danny Gaethofs (#1)
Re: Postgres under Windows

Did you restart the service?

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

Show quoted text

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

#3Danny Gaethofs
dgaethofs@yahoo.com
In reply to: Tony Caduto (#2)
Re: Postgres under Windows

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 <tony_caduto@amsoftwaredesign.com>
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/

#4John DeSoi
desoi@pgedit.com
In reply to: Danny Gaethofs (#1)
Re: Postgres under Windows

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

#5Danny Gaethofs
dgaethofs@yahoo.com
In reply to: John DeSoi (#4)
Re: Postgres under Windows

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 <desoi@pgedit.com> 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

#6Tony Caduto
tony_caduto@amsoftwaredesign.com
In reply to: Danny Gaethofs (#5)
Re: Postgres under Windows

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

Show quoted text

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.