Disk full — MySQL is waiting for space to be freed
Production Risk
Critical — all write operations are blocked; the server may hang until space is freed.
ER_DISK_FULL (1021, SQLSTATE HY000) is raised when the disk holding MySQL data files has no free space. MySQL will retry writes for a configurable period before aborting the query.
- 1Data volume or partition is completely full
- 2Temporary files from large sorts or joins have consumed remaining space
- 3Binary logs or undo logs have grown without bound
-- No SQL trigger; occurs when underlying filesystem is full
expected output
ERROR 1021 (HY000): Disk full (/tmp/#sql_1234.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Fix
Free disk space immediately
WHEN Disk is full and MySQL is waiting.
-- From OS shell: -- df -h # confirm which volume is full -- du -sh /var/lib/mysql/* | sort -rh | head -20 -- PURGE BINARY LOGS BEFORE DATE_SUB(NOW(), INTERVAL 3 DAY);
Why this works
Purging old binary logs is often the fastest way to reclaim space without touching application data.
✕ Kill the waiting MySQL process immediately
MySQL retries writes hoping space will free up; killing it mid-write can corrupt the table. Free space first, then let the operation complete.
MySQL 8.0 — 1021 ER_DISK_FULL
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev