致命:用户密码验证失败

时间:2016-12-24 19:23:38

标签: python django postgresql

我在Python 3.5,Django 1.9,Linux Mint和PostgreSQL 9.3中使用此tutorial。但是,当我尝试“manage.py migrate”时,我有一个错误:

django.db.utils.OperationalError: FATAL:  password authentication failed for user "myprojectuser"

我的数据库设置:

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'myproject',
    'USER': 'myprojectuser',
    'PASSWORD': 'xxxxx',
    'HOST': 'localhost',
    'PORT': '',
}}

1 个答案:

答案 0 :(得分:0)

它相当不言自明,是数据库密码设置和postgres用户设置相等吗?

打开终端并sudo -i -u postgres psql然后执行alter user myprojectuser with encrypted password xxxxx; 在您的设置dict中设置密码等于密码值

'default': {
'PASSWORD': 'xxxxx',
}
相关问题