anthony
anthony

Reputation: 25

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

Im trying to use PostgreSQL with django and I get that error when running python3 manage.py migrate: connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "TheGecko"

I was following this guide:https://djangocentral.com/using-postgresql-with-django/

Here is my settings.py:

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

Also, even though I entered that line: GRANT ALL PRIVILEGES ON DATABASE websitedb TO TheGecko;, when I do \l, I get this output. Shouldn't the owner be TheGecko?

I've looked over the web and nothing I could read worked for me. Please help.

Upvotes: 1

Views: 4962

Answers (1)

Shivam Mishra
Shivam Mishra

Reputation: 11

I also revieved same error and resolved by doing below changes:

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

Upvotes: 1

Related Questions