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; '__init__': 0.09; 'ignoring': 0.09; 'postgres': 0.09; 'skip:" 80': 0.09; 'subject:skip:a 10': 0.09; 'subtle': 0.09; 'python': 0.10; 'accordingly.': 0.13; 'output': 0.13; 'appropriate': 0.14; "skip:' 30": 0.15; 'thu,': 0.15; '60,': 0.16; '64,': 0.16; 'command,': 0.16; 'ends,': 0.16; 'executor': 0.16; 'instance:': 0.16; 'iterator': 0.16; 'manage.py': 0.16; 'means.': 0.16; 'postgres,': 0.16; 'received:206.46': 0.16; 'received:206.46.173': 0.16; 'row': 0.16; 'settings.py': 0.16; 'skip:" 100': 0.16; 'subject:failed': 0.16; 'sudo': 0.16; 'wrote:': 0.16; 'archive': 0.18; '2015': 0.20; 'permission': 0.20; "aren't": 0.22; 'denied': 0.22; 'users,': 0.22; 'am,': 0.23; 'skip:( 40': 0.23; 'this:': 0.23; 'tried': 0.24; '(most': 0.24; 'unix': 0.24; 'header:User-Agent:1': 0.26; 'chris': 0.26; 'appreciated.': 0.27; 'skip:m 30': 0.27; 'error': 0.27; 'skip:e 30': 0.27; 'regular': 0.29; 'archives': 0.29; 'invoke': 0.29; "i'm": 0.30; 'users.': 0.31; 'skip:s 30': 0.31; 'role': 0.32; 'changed': 0.33; 'usually': 0.33; 'instead,': 0.33; 'passwords': 0.33; 'traceback': 0.33; 'file': 0.34; 'handle': 0.34; 'running': 0.34; 'done': 0.35; 'nothing.': 0.35; 'but': 0.36; 'should': 0.36; 'instead': 0.36; 'created': 0.36; 'lines': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'skip:s 50': 0.37; 'difference': 0.38; 'sure': 0.39; 'whatever': 0.39; 'received:192': 0.39; 'skip:e 20': 0.39; 'to:addr:python.org': 0.40; 'easy': 0.60; 'header:MIME-version:1': 0.60; 'waiting': 0.60; 'your': 0.60; "you'll": 0.61; 'skip:u 10': 0.61; 'charset:windows-1252': 0.62; 'more': 0.63; 'necessarily': 0.63; 'received:206': 0.63; 'results': 0.66; 'user,': 0.67; 'sincerely': 0.67; 'jul': 0.72; 'prompt': 0.79; 'chrisa': 0.84; 'header:In-reply-to:1': 0.84; 'you.)': 0.84; 'received:192.168.1.7': 0.91; 'safer': 0.91 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=btqxfxui c=1 sm=1 tr=0 a=AstGAA2XJoPAehtj9MTdvA==:117 a=o1OHuDzbAAAA:8 a=oR5dmqMzAAAA:8 a=zKzDOiuOpD0A:10 a=-9mUelKeXuEA:10 a=N659UExz7-8A:10 a=zOBTXjUuO1YA:10 a=i3d3bHR-dDBerlNUxxoA:9 a=pJYs_f8zZMGrY_ks:21 a=yotPwE_Ng8qhqKQ-:21 a=pILNOxqGKmIA:10 Date: Thu, 16 Jul 2015 16:34:43 -0700 From: Gary Roach User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-version: 1.0 To: python-list@python.org Subject: Re: password authentication failed References: <55A694AB.2020408@verizon.net> In-reply-to: Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit 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: 143 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1437089703 news.xs4all.nl 2908 [2001:888:2000:d::a6]:45376 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!news.stben.net!border1.nntp.ams1.giganews.com!border2.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:93970 On 07/15/2015 11:25 AM, Chris Angelico wrote: > 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 I really appreciate the help Chris. I created a user archive with password 'xxxxxx' and changed the settings.py file accordingly. When I tried python manage.py migrate I got the following error with it's traceback: (archivedb)root@supercrunch:~/archivedb# python manage.py migrate Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line utility.execute() File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv self.execute(*args, **cmd_options) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute output = self.handle(*args, **options) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 93, in handle executor = MigrationExecutor(connection, self.migration_progress_callback) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__ self.loader = MigrationLoader(self.connection) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__ self.build_graph() File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 180, in build_graph self.applied_migrations = recorder.applied_migrations() File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 60, in applied_migrations return set(tuple(x) for x in self.migration_qs.values_list("app", "name")) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/models/query.py", line 162, in __iter__ self._fetch_all() File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/models/query.py", line 965, in _fetch_all self._result_cache = list(self.iterator()) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/models/query.py", line 1220, in iterator for row in compiler.results_iter(): File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 783, in results_iter results = self.execute_sql(MULTI) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 829, in execute_sql cursor.execute(sql, params) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute return super(CursorDebugWrapper, self).execute(sql, params) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "/root/.virtualenvs/archivedb/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: permission denied for relation django_migrations (archivedb)root@supercrunch:~/archivedb# I'm not at all sure what this means. Any help will be sincerely appreciated. Gary R.