无法连接到postgres数据库

时间:2018-04-17 22:50:46

标签: python postgresql sqlalchemy

我是新框架框架,当我尝试连接到终端上的数据库时出现错误,请帮忙。

{{1}}
  
    
      
        来自app import db的

        /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/flask_sqlalchemy/init.py:794:FSADeprecationWarning:SQLALCHEMY_TRACK_MODIFICATIONS会增加大量开销,将来默认会被禁用。将其设置为True或False以抑制此警告。           ' SQLALCHEMY_TRACK_MODIFICATIONS增加了显着的开销和'         db.create_all()         Traceback(最近一次调用最后一次):           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/engine/base.py" ;,第2158行,在_wrap_pool_connect中             return fn()           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/pool.py" ;,第403行,在连接中             return _ConnectionFairy._checkout(self)           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/pool.py" ;,第788行,在_checkout中             fairy = _ConnectionRecord.checkout(pool)           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/pool.py" ;,第532行,结帐时             rec = pool._do_get()           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/pool.py" ;,第1193行,在_do_get中             self._dec_overflow()           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py",第66行,退出             compat.reraise(exc_type,exc_value,exc_tb)           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/util/compat.py" ;,第187行,重新加入             提高价值           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/pool.py" ;,第1190行,在_do_get中             return self._create_connection()           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/pool.py" ;,第350行,在_create_connection中             return _ConnectionRecord(self)           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/pool.py" ;,第477行, init             自连接(first_connect_check =真)           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/pool.py" ;,第671行,在__connect中             connection = pool._invoke_creator(self)           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py" ;,第106行,在连接中             return dialect.connect(* cargs,** cparams)           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/sqlalchemy/engine/default.py" ;,第410行,在连接中             return self.dbapi.connect(* cargs,** cparams)           文件" /home/ifiok/.virtualenvs/favplaces/lib/python3.6/site-packages/psycopg2 / __ init .py",第130行,在连接中             conn = _connect(dsn,connection_factory = connection_factory,** kwasync)         psycopg2.OperationalError:无法连接到服务器:连接被拒绝             服务器是否在主机上运行" localhost" (127.0.0.1)并接受             端口5432上的TCP / IP连接?

      
    
  

0 个答案:

没有答案