Re: "Connection refused" with backend psycopg2
On May 23, 8:41 am, Tanuva <tan...@googlemail.com> wrote:
> Am 22.05.2012 23:52, schrieb akaariai:
>
>
>
>
>
>
>
>
>
> > On May 22, 11:51 pm, Tanuva <tan...@googlemail.com> wrote:
> >> Moin,
>
> >> lately, I wanted to switch my database from the testing sqlite file to a
> >> more productive pgsql 8.4 server. Now I'm constantly getting a
> >> "connection refused" from the psycopg2 backend:http://dpaste.org/0Ezka/
> >> Database configuration:http://dpaste.org/QPjD2/(notthat verbose...)
>
> >> Funny enough, connecting manually using psycopg2 in a python2 shell and
> >> using pgadmin to confirm changes done there works just fine, so there
> >> must be something in between.
>
> >> What information might help you help me helping myself? ;)
>
> > I would take a wild guess that this is related to pg_hba.conf. Is the
> > database on the localhost? If so, can you connect to it using 'psql -d
> > thedb', but not with 'psql -d thedb -h www0.....com -U
> > the_user_in_settings'.
>
> > - Anssi
>
> No, the db is not running on localhost, the machine sits in some
> datacentre. On that db server, your first command indeed doesn't work.
> Sadly that doesn't tell us much now I guess. The second one works fine
> both on the machine and here on my local box.
Maybe the psql -d thedb should not work. On the db server you should
probably add -U <username> in there.
Maybe the 'sslmode': 'require' is causing this problem? You can try if
this is causing problem by:
export SSLMODE=required
psql -U<username> -h<hostname> -p 5432 <database>
or by just removing the sslmode from your database settings and trying
again.
The error you are getting is the same you get if you would try to
connect to a machine with no postgres installation at all. So, one
possibility is that your host or port are not correct for some reason.
- Anssi
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home