簡體   English   中英

Postgresql 中的錯誤:連接到“localhost”(127.0.0.1)的服務器,端口 5432 失敗:致命:用戶“TheGecko”的密碼驗證失敗

[英]Error in Postgresql: connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "TheGecko"

我嘗試將 PostgreSQL 與 django 一起使用,並且在運行python3 manage.py migrate時出現該錯誤: connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "TheGecko"

我正在關注本指南: https://djangocentral.com/using-postgresql-with-django/

這是我的settings.py:

DATABASES = {
  'default': {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'websitedb',
    'USER':'TheGecko',
    'PASSWORD':'xx',
    'HOST':'localhost',
    'PORT':5432,
  }
}

此外,即使我輸入了該行: GRANT ALL PRIVILEGES ON DATABASE websitedb TO TheGecko; ,當我做 \l 時,我得到這個output 所有者不應該是TheGecko嗎?

我查看了 web 並沒有任何我能讀到的東西對我有用。 請幫忙。

我還檢查了相同的錯誤並通過以下更改解決:

DATABASES = { 'default': { 'ENGINE':
    'django.db.backends.postgresql', 'NAME': 'websitedb',
    'USER':'postgres', 'PASSWORD':'xx', 'HOST':'localhost',
    'PORT':'5432', } }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM