Issue
I've written a simple sqlalchemy-django model, according to this manual: http://lethain.com/replacing-django-s-orm-with-sqlalchemy/, which worked for me pretty well.
My Django is connected to a remote postgresql database, with this settings:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'wetlab_dev', # Or path to database file if using sqlite3.
'USER': 'limlim', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': 'cab-27', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
It worked for me a few days ago, but now when I try to load the 'homepage' again, it shows me the following error message:
(OperationalError) FATAL: Ident authentication failed for user "limlim"
The sqlalchemy engine-configuration is:
CONNECTION_STR = 'postgresql://limlim:@cab-27/wetlab_dev'
engine = sqlalchemy.create_engine(CONNECTION_STR)
It seems like I haven't changed anything that is related to the database configurations, but still I get this error message.
Also, when I try to connect to the database on the remote server with my username, I succeed doing it, so I guess it's not a problem of permissions for my username to get to this database.
What can be done to overcome this error?
Solution
Your pg_hba.conf
is configured to use 'ident' authentication for connections from localhost (127.0.0.1). You need it to be changed to md5
for your database and user combination.
Answered By - Craig Ringer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.