# MySQL 服务器已断开：错误 1114 (HY000) 表 '/rdsdbdata/tmp/#sql_xxx' 已满

- **ID:** `aws/rds-storage-full`
- **领域:** aws
- **类别:** runtime_error
- **错误码:** `1114`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

RDS 实例存储已耗尽，导致临时表或数据文件写入失败；通常是由于分配的存储不足或未优化的查询生成了大量临时表。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| rds-mysql-8.0.35 | active | — | — |
| rds-mariadb-10.6.16 | active | — | — |

## 解决方案

1. ```
   修改 RDS 实例以增加分配的存储：`aws rds modify-db-instance --db-instance-identifier mydb --allocated-storage 200 --apply-immediately`
   ```
2. ```
   清理旧数据或日志：删除未使用的表，使用 `CALL mysql.rds_rotate_binlog;` 轮换二进制日志或减少 binlog 保留时间。
   ```
3. ```
   优化查询以使用索引并避免大型临时表；设置 tmp_table_size 和 max_heap_table_size 以允许内存临时表。
   ```

## 无效尝试

- **Restart the RDS instance to clear temporary tables** — Restarting may free temp space temporarily, but if storage is full, the root cause (disk space) persists and queries will fail again. (70% 失败率)
- **Increase innodb_buffer_pool_size to reduce disk I/O** — Buffer pool size affects memory, not disk storage; it won't free up space on the volume. (85% 失败率)
