Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unable to connect database to server

Status
Not open for further replies.

smasherino

Technical User
Aug 17, 2004
3
DE
Hi, my English is not so well, but i hope you will understand anyway.
i have an apache2 server on my pc, and i have successfully installed and started a postgresql-database. i now have a standard database called template1. i tried to connect the database with the server using the command:
psql -h localhost -U postgres template1
but if i enter that command nothing happens.what have i done wrong?
i'm grateful for any advice, thanks, smash
 
what do you mean - nothing happen :) at least some kind of error should appear - say what is it?
or the commant prompt of psql should appear

(is it on windows, and what is the version of postgresql, probably pg_hba.conf is not configured properly, try
psql -U postgres template1
)

(by the way it this case scenario, apache2 is not used at all ;-) why do you mention it?)
 
by nothing i actually meant nothing. i pressed enter and nothing happend, no error, nothing. I am running on Suse Linux, the psql-version is 7.4.3

i've tried psql -U postgres template1
the answer was
psql: could not connect to the server: l@y@
is the server running and does it accept connections on the Unix-Domain-Socket >>/temp/.s.PGSQL.5432<<?
(translated from German)

i used the standard configuration of pg_hba.conf, as it was after the installation. what might be wrong?

thanks for your time

(apache2 is the server I'm using, and since the word 'server' comes up here and there, i thought it might be important)
 
again :)

nothing means just the next command prompt? as like just pressing "ENTER"!

when I type this

ceco@base:~$ psql -U postgres template1
__________
I get
__________
Welcome to psql 8.0.0beta1, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

template1=#
__________

what does your command prompt look like (if you don't see anything it should be in my case again
ceco@base:~$
)
 
nothing doesn't mean, just as if I pressed enter.
the cursor jumps to the beginning of the next line, nothing more.
like this
smash@linux: psql -U postgres template1 #press enter
#now the cursor is here, nothing else

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top