MySQL ERROR 1051 (42S02): Unknown table 'x'
DROP TABLE targeted a table that doesn’t exist.
Seen on:
MySQL
Meaning
Migrations rolled back twice or scripts dropping tables in the wrong order.
Common causes
- Table already dropped
- Typo or wrong database
⚡ Quick fix
- Use DROP TABLE IF EXISTS
- Check SHOW TABLES
Detailed fix by platform
MySQL
DROP TABLE IF EXISTS tmp_import;
How to diagnose
- Table — SHOW TABLES lists it?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026