即使使用正确的密码

时间:2017-02-02 13:24:33

标签: django postgresql heroku

由于Heroku的要求,我正在为我的Django项目使用Postgres 9.5 SQL,但是我遇到了无法解决的情况,并希望寻求您的建议。

具体来说,使用Postgres几天后,即使使用正确的密码,系统也无法让我登录(数据库postgres)。当我尝试登录时,我收到以下消息:

'The server doesn't accept connections: the connection library reports

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?'

老实说,我没有改变任何事情。我已经在互联网上寻找资源并尝试了以下方法但是徒劳无功:

  1. 重置pg_hba.conf以信任所有主机。完成但不工作。以下是我目前的设置:
  2. # TYPE  DATABASE        USER            ADDRESS                 METHOD
    
    # IPv4 local connections:
    host     all     all     127.0.0.1/32    trust
    # IPv6 local connections:
    host     all     all     ::1/128     trust
    # Allow replication connections from localhost, by a user with the
    # replication privilege.
    # host   replication     postgres    127.0.0.1/32    trust
    # host   replication     postgres    ::1/128     trust
    
    1. 查找postmaster.pid并将其删除。我搜索了我的驱动器但无法识别该文件。另一方面,我查看了日志文件,似乎没问题。以下是pg_log中的日志文件:
    2. 的PostgreSQL-2017-01-31_135615.log

      2017-01-31 23:52:52 HKT LOG:  aborting any active transactions
      2017-01-31 23:52:52 HKT LOG:  autovacuum launcher shutting down
      2017-01-31 23:52:52 HKT ERROR:  canceling statement due to user request
      2017-01-31 23:52:52 HKT LOG:  autovacuum launcher shutting down
      2017-01-31 23:52:52 HKT LOG:  shutting down
      2017-01-31 23:52:53 HKT LOG:  database system is shut down
      

      的PostgreSQL-2017-02-01_203503.log

      2017-02-01 20:35:06 HKT LOG:  database system was shut down at 2017-01-31 23:52:52 HKT
      2017-02-01 20:35:06 HKT FATAL:  the database system is starting up
      2017-02-01 20:35:06 HKT LOG:  could not receive data from client: An established connection was aborted by the software in your host machine.
      
      2017-02-01 20:35:06 HKT LOG:  MultiXact member wraparound protections are now enabled
      2017-02-01 20:35:07 HKT LOG:  database system is ready to accept connections
      2017-02-01 20:35:07 HKT LOG:  autovacuum launcher started
      

      的PostgreSQL-2017-02-02_000000.log:

      2017-02-02 00:06:09 HKT LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.
      2017-02-02 00:06:09 HKT LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.
      2017-02-02 00:06:19 HKT LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.
      2017-02-02 01:48:20 HKT LOG:  received fast shutdown request
      2017-02-02 01:48:20 HKT LOG:  aborting any active transactions
      2017-02-02 01:48:20 HKT LOG:  autovacuum launcher shutting down
      2017-02-02 01:48:20 HKT LOG:  shutting down
      2017-02-02 01:48:20 HKT LOG:  database system is shut down
      

      另一方面,我也检查了监听设置,看起来也没问题,如下面postgresql.conf中所示:

      listen_addresses = '*'      # what IP address(es) to listen on;
      

      那么,任何人都可以建议如何恢复sql服务?由于此问题,我不想一次又一次地重新安装和重新导入数据库。非常感谢!

0 个答案:

没有答案