go network_error ai_generated true

error: dial tcp 127.0.0.1:3306: connect: connection refused

ID: go/database-sql-connection-refused

Also available as: JSON · Markdown · 中文
80%Fix Rate
89%Confidence
0Evidence
2024-07-12First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
1.20 active

Root Cause

The database server is not running or is unreachable at the specified address and port.

generic

中文

数据库服务器未运行或在指定地址和端口上不可达。

Workarounds

  1. 95% success
    Ensure the database server is running and accessible from the application's network.
  2. 85% success
    Use a connection retry mechanism with backoff.

Dead Ends

Common approaches that don't work:

  1. 90% fail

    If the server is down, retrying without fixing the server will not help.

  2. 70% fail

    The driver is not the issue; the server is unreachable.