# 错误：拨号 tcp 127.0.0.1:3306：连接被拒绝

- **ID:** `go/database-sql-connection-refused`
- **领域:** go
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.20 | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   Ensure the database server is running and accessible from the application's network.
   ```
2. **** (85% 成功率)
   ```
   Use a connection retry mechanism with backoff.
   ```

## 无效尝试

- **** — If the server is down, retrying without fixing the server will not help. (90% 失败率)
- **** — The driver is not the issue; the server is unreachable. (70% 失败率)
