Skip to content

[BUG]sqlalchemy报错,无法连接数据库 #138

@orange8882

Description

@orange8882

在一台服务器上,启动v1.1.3版本容器,在数据库初始化,开始uvicorn时,开始报错

sqlalchemy.exc.OperationalError: (psycopg.OperationalError) connection failed: connection to server at "127.0.0.1", port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
Multiple connection attempts failed. All failures were:

  • host: 'localhost', port: 5432, hostaddr: '::1': connection failed: connection to server at "::1", port 5432 failed: Connection refused
    Is the server running on that host and accepting TCP/IP connections?
  • host: 'localhost', port: 5432, hostaddr: '127.0.0.1': connection failed: connection to server at "127.0.0.1", port 5432 failed: Connection refused
    Is the server running on that host and accepting TCP/IP connections?
    (Background on this error at: https://sqlalche.me/e/20/e3q8)

确定服务器上没有其他在运行的postgresql服务,没有其他5432端口。

请教该如何排查这个问题

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions