我在使用POSTGRESQL的Django項目設置中遇到問題。Django設置:psycopg2.OperationalError:致命:用戶「indivo」的同級身份驗證失敗
這裏是我的setting.py數據庫中設置
DATABASES = {
'default':{
'ENGINE':'django.db.backends.postgresql_psycopg2', # '.postgresql_psycopg2', '.mysql', or '.oracle'
'NAME':'indivo', # Required to be non-empty string
'USER':'indivo', # Required to be non-empty string
'PASSWORD':'ritvik',
'HOST':'', # Set to empty string for localhost.
'PORT':'', # Set to empty string for default.
},
}
現在Postgres後端我做了什麼是。
[email protected]:~$ sudo su - postgres
[email protected]:~$ createuser --superuser indivo # create a super user indivo
[email protected]:~$ psql # open psql terminal
psql (9.1.8)
Type "help" for help.
postgres=# \password indivo # set the password ritvik
Enter new password:
Enter it again:
postgres=# \q #logout
[email protected]:~$ createdb -U indivo -O indivo indivo #create db indivo
不幸的是,當我試圖syncdb我收到錯誤。
psycopg2.OperationalError: FATAL: Peer authentication failed for user "indivo"
請幫我看看我在這裏做錯了什麼。
重複回答過的問題在這裏:Django的連接到PostgreSQL:「對等身份驗證失敗」] [1] [1]:http://stackoverflow.com/questions/ 8167602/Django的連接到PostgreSQL的對等實體認證失敗 – user3404455 2014-07-22 23:59:25