psycopg2.OperationalError:FATAL:role" postgresql"不存在

时间:2017-12-15 15:09:58

标签: django postgresql

我是postresql新手。 当我准备好在'设置中迁移INSTALLED_APPS时到数据库,出现了以下错误:

psycopg2.OperationalError: FATAL:  role "postgresql" does not exist

我已经显示了完整的异常消息:

c:\fanhuaxiu\Scripts>activate
(fanhuaxiu) c:\fanhuaxiu\Scripts>cd ..

(fanhuaxiu) c:\fanhuaxiu>cd fhx

(fanhuaxiu) c:\fanhuaxiu\fhx>python manage.py migrate
Traceback (most recent call last):
  File "C:\fanhuaxiu\lib\site-packages\django\db\backends\base\base.py", line 216, in ensure_connection
    self.connect()
  File "C:\fanhuaxiu\lib\site-packages\django\db\backends\base\base.py", line 194, in connect
    self.connection = self.get_new_connection(conn_params)
  File "C:\fanhuaxiu\lib\site-packages\django\db\backends\postgresql\base.py", line 168, in get_new_connection
    connection = Database.connect(**conn_params)

  File "C:\fanhuaxiu\lib\site-packages\psycopg2\__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  role "postgresql" does not exist

我花了将近2个小时才找到解决方案而233333失败了。 提前谢谢。

0 个答案:

没有答案