【问题标题】:Connecting to postgresql gives password authentication failed连接到 postgresql 导致密码验证失败
【发布时间】:2013-02-02 11:53:06
【问题描述】:

0 嗨,我是 django 的新手。我正在server Webfaction 上构建一个 django 项目。当我执行“python manage.py sync”时出现错误:

 > Traceback (most recent call last): File "manage.py", line 10, in
 > <module> execute_from_command_line(sys.argv) File
 > "//home/xx/lib/python2.7/django/core/management/init.py", line 443, in
 > execute_from_command_line utility.execute() File
  "//home/xx/lib/python2.7/django/core/management/init.py", line 382, in
 > execute self.fetch_command(subcommand).run_from_argv(self.argv) File
 > "//home/xx/lib/python2.7/django/core/management/base.py", line 196, in
 > run_from_argv self.execute(*args, options.dict) File
 > "//home/xx/lib/python2.7/django/core/management/base.py", line 232, in
 > execute output = self.handle(*args, options) File
 > "//home/xx/lib/python2.7/django/core/management/base.py", line 371, in
 > handle return self.handle_noargs(options) File
 > "//home/xx/lib/python2.7/django/core/management/commands/syncdb.py",
 > line 57, in handle_noargs cursor = connection.cursor() File
 > "//home/xx/lib/python2.7/django/db/backends/init.py", line 306, in
 > cursor cursor = self.make_debug_cursor(self._cursor()) File
 > "//home/xx/lib/python2.7/django/db/backends/postgresql_psycopg2/base.py",
   > line 177, in _cursor self.connection = Database.connect(conn_params)
 > File "/usr/lib64/python2.6/site-packages/psycopg2/init.py", line 179,
 > in connect connection_factory=connection_factory, async=async)
 > 
  > psycopg2.OperationalError: FATAL: password authentication failed for
 > user "postgres"

实际上在我的数据库设置中,我使用的是另一个帐户(不是 postgres),为什么它要求postgres 的密码?

顺便说一句,我需要在webfaction 上安装psycopy2 吗? 以前它在我创建新数据库时起作用。但是现在当我尝试django auth 并创建一个新用户时,它会抛出这个错误。

【问题讨论】:

    标签: python django psycopg2 webfaction


    【解决方案1】:

    对不起,我笨。从 repo 中提取项目后忘记修改数据库设置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-17
      • 1970-01-01
      相关资源
      最近更新 更多