{
  "id": "go/sql-connection-refused",
  "signature": "dial tcp 127.0.0.1:3306: connect: connection refused",
  "signature_zh": "拨号 tcp 127.0.0.1:3306: 连接被拒绝",
  "regex": "dial\\ tcp\\ 127\\.0\\.0\\.1:3306:\\ connect:\\ connection\\ refused",
  "domain": "go",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "Database server is not running or not listening on the specified port.",
  "root_cause_type": "generic",
  "root_cause_zh": "数据库服务器未运行或未在指定端口监听。",
  "versions": [
    {
      "version": "1.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If server is down, it blocks forever.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Server may not use default port.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Check if server is up before connecting: net.DialTimeout(\"tcp\", addr, 5*time.Second)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Use connection retry with backoff: for i:=0; i<5; i++ { db, err := sql.Open(...); if err==nil { break }; time.Sleep(time.Duration(i)*time.Second) }",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-11-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}