Page 1 of 1
PostgreSQL cannot connect to database
Posted:
Fri Apr 12, 2013 11:57 am
by madsenma
I have been using PT3 on my Mac and have the postgres database all set up for that. I am now trying to run the trial of PT4, and when the Configure PostgreSQL Server window comes up and I click Connect it says
"Unable to connect to this database. Please check the configuration."
Please advise!
Re: PostgreSQL cannot connect to database
Posted:
Fri Apr 12, 2013 12:36 pm
by kraada
Can you connect to PostgreSQL through PGAdmin? Double check your password options - that error can occur if you're using a different password and the passwords don't match.
Re: PostgreSQL cannot connect to database
Posted:
Fri Apr 12, 2013 12:42 pm
by madsenma
Sorry, I don't know what PGAdmin is. I'm not very familiar with how the whole PostgreSQL works to be honest.
Re: PostgreSQL cannot connect to database
Posted:
Fri Apr 12, 2013 2:02 pm
by madsenma
Ok, I have updated PostgreSQL to version 9.0, found PGAdmin and attempted to connect to the server. I have tried all possible passwords including the default 'dbpass' which I don't imagine I would have changed, and the message is always "Server doesn't listen.....Is the server running on host "localhost" and accepting TCP/IP connections on port 5432?"
If it is a problem of the username/password, is it possible to reset this? Or delete the whole thing and reinstall from fresh? I have tried looking for the uninstaller in the PostgreSQL 9.0 folder but there was none.
Re: PostgreSQL cannot connect to database
Posted:
Fri Apr 12, 2013 2:30 pm
by kraada
Let's check first to see if the server is running. Open Applications -> Utilities -> Terminal and at the terminal type:
ps auxw | grep -i postgres
and post the output here for me please.
Re: PostgreSQL cannot connect to database
Posted:
Sat Apr 13, 2013 2:10 am
by delwinloh
Hi,
I am facing the same issue - cannot connect to database.
This is what I get after keying in 'ps auxw | grep -i postgres'
postgres 55474 0.0 0.1 2471912 9220 ?? SN Thu08PM 0:12.71 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared
postgres 350 0.0 0.0 2465740 1156 ?? S Sat05PM 0:01.29 /usr/sbin/cfprefsd agent
postgres 344 0.0 0.0 2483820 1604 ?? S Sat05PM 0:00.46 /usr/sbin/distnoted agent
postgres 336 0.0 0.0 2471372 896 ?? Ss Sat05PM 0:00.81 /sbin/launchd
delwinloh 82229 0.0 0.0 2432768 600 s000 S+ 1:36PM 0:00.00 grep -i postgres
Please assist.
Thanks
Re: PostgreSQL cannot connect to database
Posted:
Sat Apr 13, 2013 9:23 am
by madsenma
This is what I get after entering 'ps auxw | grep -i postgres'
iMamo 41180 0.0 0.4 835124 35084 ?? S 6:59pm 0:01.79 /Library/PostgreSQL/9.0/pgAdmin3.app/Contents/MacOS/pgAdmin3 -psn_0_74278610
iMamo 41742 0.0 0.0 2432768 632 s000 S+ 2:22pm 0:00.00 grep -i postgres
Re: PostgreSQL cannot connect to database
Posted:
Sat Apr 13, 2013 11:39 am
by WhiteRider
Unfortunately Kraada isn't around this weekend and I'm not sure what this output means exactly.
madsenma wrote:This is what I get after entering 'ps auxw | grep -i postgres'
iMamo 41180 0.0 0.4 835124 35084 ?? S 6:59pm 0:01.79 /Library/PostgreSQL/9.0/pgAdmin3.app/Contents/MacOS/pgAdmin3 -psn_0_74278610
iMamo 41742 0.0 0.0 2432768 632 s000 S+ 2:22pm 0:00.00 grep -i postgres
That doesn't look as if any PostgreSQL processes are actually running.
Please read
this guide which walks you through the PostgreSQL installation, and how to fully uninstall first which is necessary if you have a partial installation which isn't working.
delwinloh wrote:Hi,
I am facing the same issue - cannot connect to database.
This is what I get after keying in 'ps auxw | grep -i postgres'
postgres 55474 0.0 0.1 2471912 9220 ?? SN Thu08PM 0:12.71 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared
postgres 350 0.0 0.0 2465740 1156 ?? S Sat05PM 0:01.29 /usr/sbin/cfprefsd agent
postgres 344 0.0 0.0 2483820 1604 ?? S Sat05PM 0:00.46 /usr/sbin/distnoted agent
postgres 336 0.0 0.0 2471372 896 ?? Ss Sat05PM 0:00.81 /sbin/launchd
delwinloh 82229 0.0 0.0 2432768 600 s000 S+ 1:36PM 0:00.00 grep -i postgres
Again Kraada may be able to tell more from your output when he returns, but without more information I'm not sure what to suggest. How did you install PostgreSQL on this machine? Depending on your situation you may want to follow the same guide as above.
Re: PostgreSQL cannot connect to database
Posted:
Mon Apr 15, 2013 1:02 pm
by kraada
It looks like you've been running some normal applications as the postgres user - did you log in as that user and try to do things that way? That should not be necessary - PostgreSQL runs as that user in the background.
Re: PostgreSQL cannot connect to database
Posted:
Tue Apr 16, 2013 6:27 am
by madsenma
Yea the previous PostgreSQL installation required me to change my username to postgres and did not create it as a separate user.
Anyway, managed to solve the problem as advised by WhiteRider - deleted the database and reinstalled postgres, now works a treat. Thanks