postgresql: FATAL: password authentication failed for user “douglas”











up vote
5
down vote

favorite
1












in first: sorry for this duplicate, but the others similar questions related for this issue always tell the same method to fix this problem, but did don't works for me.I trying to migrate a DB from sqlite to postgresql...so I type:



sudo -u postgres psql
postgres=# ALTER USER postgres WITH PASSWORD 'newpassword';


and the output return: "ALTER ROLE"



but when I type "python manage.py migrate" I receive always the same error:




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




settings.py:



# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'site_.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'site_.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases

"""
DATABASES = {
#'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#}
'default': dj_database_url.config(default='postgres://localhost:5432/postgres_db_name'),
}
"""


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'douglas_db',
'USER': 'douglas',
'PASSWORD': 'vamointer',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators

#DATABASES = {'default': dj_database_url.config(default='postgres://127.0.0.1:5432/postgres_db_name')}

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/

LANGUAGE_CODE = 'pt-br'

TIME_ZONE = 'America/Sao_Paulo'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')


ps: When I run the 'ALTER USER postgres WITH PASSWORD' I put the same password defined in the settings.py.



Thanks!










share|improve this question
























  • The error mentions the user account user but your alter statement is changing the password of the user postgres. Lastly, your settings.py references yet another user; douglas. Which user do you actually want to use, and are you running commands that reference just this user?
    – Shadow
    Mar 28 '17 at 4:58






  • 2




    Fair enough. What about the SQL query? You should be running ALTER USER douglas WITH PASSWORD 'vamointer';
    – Shadow
    Mar 28 '17 at 5:28












  • Sorry, I don't understand what you mean by that. Did you run the the query I wrote on the postgres database before attempting to run migrations?
    – Shadow
    Mar 28 '17 at 5:32










  • Now this error: "ERROR: role "douglas" does not exist" =[
    – Douglas da Silva
    Mar 28 '17 at 5:33






  • 1




    That's more like it :D I'll add an answer below.
    – Shadow
    Mar 28 '17 at 5:34















up vote
5
down vote

favorite
1












in first: sorry for this duplicate, but the others similar questions related for this issue always tell the same method to fix this problem, but did don't works for me.I trying to migrate a DB from sqlite to postgresql...so I type:



sudo -u postgres psql
postgres=# ALTER USER postgres WITH PASSWORD 'newpassword';


and the output return: "ALTER ROLE"



but when I type "python manage.py migrate" I receive always the same error:




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




settings.py:



# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'site_.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'site_.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases

"""
DATABASES = {
#'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#}
'default': dj_database_url.config(default='postgres://localhost:5432/postgres_db_name'),
}
"""


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'douglas_db',
'USER': 'douglas',
'PASSWORD': 'vamointer',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators

#DATABASES = {'default': dj_database_url.config(default='postgres://127.0.0.1:5432/postgres_db_name')}

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/

LANGUAGE_CODE = 'pt-br'

TIME_ZONE = 'America/Sao_Paulo'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')


ps: When I run the 'ALTER USER postgres WITH PASSWORD' I put the same password defined in the settings.py.



Thanks!










share|improve this question
























  • The error mentions the user account user but your alter statement is changing the password of the user postgres. Lastly, your settings.py references yet another user; douglas. Which user do you actually want to use, and are you running commands that reference just this user?
    – Shadow
    Mar 28 '17 at 4:58






  • 2




    Fair enough. What about the SQL query? You should be running ALTER USER douglas WITH PASSWORD 'vamointer';
    – Shadow
    Mar 28 '17 at 5:28












  • Sorry, I don't understand what you mean by that. Did you run the the query I wrote on the postgres database before attempting to run migrations?
    – Shadow
    Mar 28 '17 at 5:32










  • Now this error: "ERROR: role "douglas" does not exist" =[
    – Douglas da Silva
    Mar 28 '17 at 5:33






  • 1




    That's more like it :D I'll add an answer below.
    – Shadow
    Mar 28 '17 at 5:34













up vote
5
down vote

favorite
1









up vote
5
down vote

favorite
1






1





in first: sorry for this duplicate, but the others similar questions related for this issue always tell the same method to fix this problem, but did don't works for me.I trying to migrate a DB from sqlite to postgresql...so I type:



sudo -u postgres psql
postgres=# ALTER USER postgres WITH PASSWORD 'newpassword';


and the output return: "ALTER ROLE"



but when I type "python manage.py migrate" I receive always the same error:




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




settings.py:



# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'site_.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'site_.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases

"""
DATABASES = {
#'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#}
'default': dj_database_url.config(default='postgres://localhost:5432/postgres_db_name'),
}
"""


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'douglas_db',
'USER': 'douglas',
'PASSWORD': 'vamointer',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators

#DATABASES = {'default': dj_database_url.config(default='postgres://127.0.0.1:5432/postgres_db_name')}

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/

LANGUAGE_CODE = 'pt-br'

TIME_ZONE = 'America/Sao_Paulo'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')


ps: When I run the 'ALTER USER postgres WITH PASSWORD' I put the same password defined in the settings.py.



Thanks!










share|improve this question















in first: sorry for this duplicate, but the others similar questions related for this issue always tell the same method to fix this problem, but did don't works for me.I trying to migrate a DB from sqlite to postgresql...so I type:



sudo -u postgres psql
postgres=# ALTER USER postgres WITH PASSWORD 'newpassword';


and the output return: "ALTER ROLE"



but when I type "python manage.py migrate" I receive always the same error:




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




settings.py:



# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'site_.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'site_.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases

"""
DATABASES = {
#'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#}
'default': dj_database_url.config(default='postgres://localhost:5432/postgres_db_name'),
}
"""


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'douglas_db',
'USER': 'douglas',
'PASSWORD': 'vamointer',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators

#DATABASES = {'default': dj_database_url.config(default='postgres://127.0.0.1:5432/postgres_db_name')}

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/1.10/topics/i18n/

LANGUAGE_CODE = 'pt-br'

TIME_ZONE = 'America/Sao_Paulo'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')


ps: When I run the 'ALTER USER postgres WITH PASSWORD' I put the same password defined in the settings.py.



Thanks!







python django postgresql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 '17 at 5:28

























asked Mar 28 '17 at 4:53









Douglas da Silva

1501210




1501210












  • The error mentions the user account user but your alter statement is changing the password of the user postgres. Lastly, your settings.py references yet another user; douglas. Which user do you actually want to use, and are you running commands that reference just this user?
    – Shadow
    Mar 28 '17 at 4:58






  • 2




    Fair enough. What about the SQL query? You should be running ALTER USER douglas WITH PASSWORD 'vamointer';
    – Shadow
    Mar 28 '17 at 5:28












  • Sorry, I don't understand what you mean by that. Did you run the the query I wrote on the postgres database before attempting to run migrations?
    – Shadow
    Mar 28 '17 at 5:32










  • Now this error: "ERROR: role "douglas" does not exist" =[
    – Douglas da Silva
    Mar 28 '17 at 5:33






  • 1




    That's more like it :D I'll add an answer below.
    – Shadow
    Mar 28 '17 at 5:34


















  • The error mentions the user account user but your alter statement is changing the password of the user postgres. Lastly, your settings.py references yet another user; douglas. Which user do you actually want to use, and are you running commands that reference just this user?
    – Shadow
    Mar 28 '17 at 4:58






  • 2




    Fair enough. What about the SQL query? You should be running ALTER USER douglas WITH PASSWORD 'vamointer';
    – Shadow
    Mar 28 '17 at 5:28












  • Sorry, I don't understand what you mean by that. Did you run the the query I wrote on the postgres database before attempting to run migrations?
    – Shadow
    Mar 28 '17 at 5:32










  • Now this error: "ERROR: role "douglas" does not exist" =[
    – Douglas da Silva
    Mar 28 '17 at 5:33






  • 1




    That's more like it :D I'll add an answer below.
    – Shadow
    Mar 28 '17 at 5:34
















The error mentions the user account user but your alter statement is changing the password of the user postgres. Lastly, your settings.py references yet another user; douglas. Which user do you actually want to use, and are you running commands that reference just this user?
– Shadow
Mar 28 '17 at 4:58




The error mentions the user account user but your alter statement is changing the password of the user postgres. Lastly, your settings.py references yet another user; douglas. Which user do you actually want to use, and are you running commands that reference just this user?
– Shadow
Mar 28 '17 at 4:58




2




2




Fair enough. What about the SQL query? You should be running ALTER USER douglas WITH PASSWORD 'vamointer';
– Shadow
Mar 28 '17 at 5:28






Fair enough. What about the SQL query? You should be running ALTER USER douglas WITH PASSWORD 'vamointer';
– Shadow
Mar 28 '17 at 5:28














Sorry, I don't understand what you mean by that. Did you run the the query I wrote on the postgres database before attempting to run migrations?
– Shadow
Mar 28 '17 at 5:32




Sorry, I don't understand what you mean by that. Did you run the the query I wrote on the postgres database before attempting to run migrations?
– Shadow
Mar 28 '17 at 5:32












Now this error: "ERROR: role "douglas" does not exist" =[
– Douglas da Silva
Mar 28 '17 at 5:33




Now this error: "ERROR: role "douglas" does not exist" =[
– Douglas da Silva
Mar 28 '17 at 5:33




1




1




That's more like it :D I'll add an answer below.
– Shadow
Mar 28 '17 at 5:34




That's more like it :D I'll add an answer below.
– Shadow
Mar 28 '17 at 5:34












2 Answers
2






active

oldest

votes

















up vote
5
down vote



accepted










The SQL you are running does not match the user you are attempting to use.



You will need to create the user if it does not exist



CREATE USER douglas WITH PASSWORD 'vamointer';


or if it does exist, change that users password instead.



ALTER USER douglas WITH PASSWORD 'vamointer';


Once you have done that you should have more luck. You may need to assign permissions to that user as well.






share|improve this answer




























    up vote
    0
    down vote













    Special characters in postgresql are converted to different characters while execution. Make sure you do not have special characters (#,$,etc..) in your password.



    If you do, change the postgresql password as follows:



    sudo -u postgresql psql
    postgresql=#alter yourusername with password
    'set_new_password_without_special_character';


    Make sure you do not forget the ; at the end of postgresql command.
    Then run python manage.py and it should work!






    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














       

      draft saved


      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43060857%2fpostgresql-fatal-password-authentication-failed-for-user-douglas%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      5
      down vote



      accepted










      The SQL you are running does not match the user you are attempting to use.



      You will need to create the user if it does not exist



      CREATE USER douglas WITH PASSWORD 'vamointer';


      or if it does exist, change that users password instead.



      ALTER USER douglas WITH PASSWORD 'vamointer';


      Once you have done that you should have more luck. You may need to assign permissions to that user as well.






      share|improve this answer

























        up vote
        5
        down vote



        accepted










        The SQL you are running does not match the user you are attempting to use.



        You will need to create the user if it does not exist



        CREATE USER douglas WITH PASSWORD 'vamointer';


        or if it does exist, change that users password instead.



        ALTER USER douglas WITH PASSWORD 'vamointer';


        Once you have done that you should have more luck. You may need to assign permissions to that user as well.






        share|improve this answer























          up vote
          5
          down vote



          accepted







          up vote
          5
          down vote



          accepted






          The SQL you are running does not match the user you are attempting to use.



          You will need to create the user if it does not exist



          CREATE USER douglas WITH PASSWORD 'vamointer';


          or if it does exist, change that users password instead.



          ALTER USER douglas WITH PASSWORD 'vamointer';


          Once you have done that you should have more luck. You may need to assign permissions to that user as well.






          share|improve this answer












          The SQL you are running does not match the user you are attempting to use.



          You will need to create the user if it does not exist



          CREATE USER douglas WITH PASSWORD 'vamointer';


          or if it does exist, change that users password instead.



          ALTER USER douglas WITH PASSWORD 'vamointer';


          Once you have done that you should have more luck. You may need to assign permissions to that user as well.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 28 '17 at 5:36









          Shadow

          4,42222237




          4,42222237
























              up vote
              0
              down vote













              Special characters in postgresql are converted to different characters while execution. Make sure you do not have special characters (#,$,etc..) in your password.



              If you do, change the postgresql password as follows:



              sudo -u postgresql psql
              postgresql=#alter yourusername with password
              'set_new_password_without_special_character';


              Make sure you do not forget the ; at the end of postgresql command.
              Then run python manage.py and it should work!






              share|improve this answer



























                up vote
                0
                down vote













                Special characters in postgresql are converted to different characters while execution. Make sure you do not have special characters (#,$,etc..) in your password.



                If you do, change the postgresql password as follows:



                sudo -u postgresql psql
                postgresql=#alter yourusername with password
                'set_new_password_without_special_character';


                Make sure you do not forget the ; at the end of postgresql command.
                Then run python manage.py and it should work!






                share|improve this answer

























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Special characters in postgresql are converted to different characters while execution. Make sure you do not have special characters (#,$,etc..) in your password.



                  If you do, change the postgresql password as follows:



                  sudo -u postgresql psql
                  postgresql=#alter yourusername with password
                  'set_new_password_without_special_character';


                  Make sure you do not forget the ; at the end of postgresql command.
                  Then run python manage.py and it should work!






                  share|improve this answer














                  Special characters in postgresql are converted to different characters while execution. Make sure you do not have special characters (#,$,etc..) in your password.



                  If you do, change the postgresql password as follows:



                  sudo -u postgresql psql
                  postgresql=#alter yourusername with password
                  'set_new_password_without_special_character';


                  Make sure you do not forget the ; at the end of postgresql command.
                  Then run python manage.py and it should work!







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 2 days ago









                  public static void main

                  7081321




                  7081321










                  answered 2 days ago









                  HAL 9000

                  313




                  313






























                       

                      draft saved


                      draft discarded



















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43060857%2fpostgresql-fatal-password-authentication-failed-for-user-douglas%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                      Alcedinidae

                      RAC Tourist Trophy