Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '16,': 0.03; 'root': 0.04; 'subject:password': 0.05; "'default':": 0.07; '(of': 0.07; '*not*': 0.07; 'postgresql': 0.07; 'cc:addr:python-list': 0.09; 'ignoring': 0.09; 'postgres': 0.09; 'subject:skip:a 10': 0.09; 'subtle': 0.09; 'python': 0.10; 'appropriate': 0.14; "skip:' 30": 0.15; 'thu,': 0.15; 'command,': 0.16; 'ends,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'instance:': 0.16; 'manage.py': 0.16; 'postgres,': 0.16; 'subject:failed': 0.16; 'sudo': 0.16; 'wrote:': 0.16; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; "aren't": 0.22; 'users,': 0.22; 'am,': 0.23; 'this:': 0.23; 'unix': 0.24; 'header :In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'regular': 0.29; 'archives': 0.29; 'invoke': 0.29; 'users.': 0.31; 'role': 0.32; 'usually': 0.33; 'instead,': 0.33; 'passwords': 0.33; 'running': 0.34; 'received:google.com': 0.35; 'done': 0.35; 'nothing.': 0.35; 'but': 0.36; 'should': 0.36; 'instead': 0.36; 'lines': 0.36; 'subject:: ': 0.37; 'difference': 0.38; 'sure': 0.39; 'whatever': 0.39; 'easy': 0.60; 'waiting': 0.60; 'your': 0.60; "you'll": 0.61; 'more': 0.63; 'necessarily': 0.63; 'user,': 0.67; 'jul': 0.72; 'prompt': 0.79; 'chrisa': 0.84; 'you.)': 0.84; 'to:none': 0.91; 'safer': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=gupGtTAZKuKwz4bSk5DYgGQ6mjsALozk8gnGGNEOvDc=; b=FyKLpe3Fa7kcV2nAiYX+wUZnRFXROJUKDhdRsUwkgHsZC82Y6vz/ha78E3xzPew4/1 zbEVdUB4CtP72P3um0NZKrqLonqUtobNboih0I3IQH6k4cTQjfWauPlpTlsLvrK8z+Zp /Jq4MOiRGQZKBC21Xp0u7LCtkmlk6gB26wK7fIYd+OaPkNjnphV+TK4+kSKqV67vmGxK C3pDUMA+j3T3JXdc3XB7LV/bcSdeua0E1bEYaMbgBRAW7u2+Rdpq+M8W3uNGrCR4sqNg HGccdAEGFPoKoR+ZRHLz8t4E1QNNhvrBOWjhA8rxhuoHbnzWLah1U4XdBd2sYtY/JMPD IAIw== MIME-Version: 1.0 X-Received: by 10.107.9.142 with SMTP id 14mr7523326ioj.142.1436984702098; Wed, 15 Jul 2015 11:25:02 -0700 (PDT) In-Reply-To: <55A694AB.2020408@verizon.net> References: <55A694AB.2020408@verizon.net> Date: Thu, 16 Jul 2015 04:25:02 +1000 Subject: Re: password authentication failed From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 51 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1436984705 news.xs4all.nl 2928 [2001:888:2000:d::a6]:46160 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:93878 On Thu, Jul 16, 2015 at 3:13 AM, Gary Roach wrote: > Every time I try to do a python manage.py migrate I get: > django.db.utils.OperationalError: FATAL: password > authentication failed for user "postgres" > FATAL: password authentication failed for user "postgres" > > > DATABASES = { > 'default': { > 'USER': 'postgres', > 'PASSWORD': 'xxxxxx', # A valid debian pw > } > } PostgreSQL users are not the same as Unix users, and their passwords aren't necessarily the same. I would recommend *not* using the postgres user, which is the database superuser; instead, create a new user explicitly. On most Debian PostgreSQL installations, you should be able to invoke 'psql' while running as user 'postgres', either by su'ing to postgres or with sudo, for instance: $ sudo sudo -u postgres psql That should get you into a database CLI as superuser. Your prompt should look like this: postgres=# You should then be able to create a regular user, and grant appropriate permissions: postgres=# create user archives password 'traded-links-linguistics-informal'; CREATE ROLE postgres=# grant all on database archivedb to archives; GRANT (Make sure you have the semicolons at the ends, otherwise you'll think it's done nothing. It's actually waiting for you to type more lines for the same command, but the prompt difference is so subtle that it's easy to think it's silently ignoring you.) Then you should be able to use user name 'archives' and password 'traded-links-linguistics-informal' (of course, you don't want to use that; that's just what my password generating parrot came up with) instead of 'postgres' and whatever the Unix password was. Incidentally, I usually don't have any password on my postgres Unix user, nor on the corresponding database users. Safer to use sudo, eg to root and then down to postgres, as shown above. ChrisA