Hi,
I am encountering the exact same problem as mentioned by Lucas in one the
earlier threads :
msql db_name -U user_name -h localhost
*works*
*
*
import psycopg2
psycopg2.connect
*works*
*
*
python web2py.py -S app_name
DAL(...) works too
But, still I get error
> RuntimeError: Failure to connect, tried 5 times:
Also, it might help that I was working on mysql and have now shifted to
postresql. Please tell me how can I debug it or if any other information is
needed as well.
On Tuesday, 27 September 2011 13:06:04 UTC+5:30, lucas wrote:
>
> hello Mariano,
>
> i have made progress. i was editting the wrong pg_hba.conf and
> postgresql.conf files. the proper location under centos6.0 was under /
> var/lib/pgsql/9.1/data. once i editted those conf files there,
> everything started working better, but not completely. let me
> summarize:
>
> #testing python and psycopg2 under lucas login worked well:
> > python
> >>>import psycopg2
> >>>psycopg2.connect(database="prac2", user="lucas",
> password="passwdnotposted", host="localhost")
> <connection object at 0x1780650; dsn: 'dbname=prac2 host=localhost
> user=lucas password=xxxxxxxxx', closed: 0>
> #which looks like it worked
>
> #testing psql under lucas loging with authentication worked well:
> > psql prac2 -h localhost
> Password:
> psql (9.1.1)
> Type "help" for help.
>
> prac2=#
> #and if a wrong password is entered, psql gives a fatal error and
> exits back to bash.
>
> #testing web2py under root (under lucas did not work) login worked
> well also:
> > python2.6 web2py.py -S welcome -N -a 'nonane939'
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2011
> Version 1.98.2 (2011-08-04 00:47:09)
> Database drivers available: SQLite3, pymysql, PostgreSQL
> WARNING:web2py:import IPython error; use default python shell
> Python 2.6.5 (r265:79063, Jun 25 2011, 08:36:25)
> [GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>>import psycopg2
> >>>DAL('postgres://lucas:passwdnotposted@localhost/prac2')
> <DAL {'_migrate_enabled': True, '_lastsql': 'SET
> standard_conforming_strings=on;', '_db_codec': 'UTF-8', '_timings':
> [('BEGIN;', 0.00039315223693847656), ("SET CLIENT_ENCODING TO
> 'UNICODE';", 0.00017309188842773438), ('SET
> standard_conforming_strings=on;', 0.00014185905456542969)],
> '_fake_migrate': False, '_dbname': 'postgres', '_request_tenant':
> 'request_tenant', '_adapter': <gluon.dal.PostgreSQLAdapter object at
> 0x15aac50>, '_pending_references': {}, '_fake_migrate_all': False,
> 'check_reserved': None, '_uri': 'postgres://lucas:nonane939@localhost/
> prac2', 'tables': [], '_migrate': True, '_pool_size': 0,
> '_common_fields': [], '_uri_hash': '623031fe80a4c6f15d3e4616f2919fb6'}
> >
> #which as you can see the db instance was created fine.
>
> however, when i try the last step, in my mind, which is use this in
> the db.py model file:
>
> db = DAL('postgres://lucas:passwdnotposted@localhost/prac2')
>
> i still get the Permission denied problem when i try to access the
> "database administration" button on the sites main edit page. does
> this make sense?
>
> thank you in advance. lucas
>
--