SQLite: no such table: X
The SQL refers to a table that doesn't exist in the database file you opened.
no such tablesqlite3.OperationalError: no such tableSQLITE_ERROR: no such tableSQLite no such table usersError: SQLITE_ERROR: no such table Meaning
Usually the wrong database file (relative path, new empty file created silently), migrations not run, a typo/case difference in the name, or a table living in an attached database/schema (main.t, other.t). Check .tables and the file path your app actually uses.
Common causes
- Wrong or empty database file (created silently)
- Migrations not applied
- Typo in the table name
- Table in an attached database
- Using a temp table after the connection closed
⚡ Quick fix
- Run
.tables/SELECT name FROM sqlite_master - Use an absolute path to the .db file
- Apply migrations before queries
Detailed fix by platform
Shell
- sql
sqlite3 app.db ".tables" sqlite3 app.db "SELECT name FROM sqlite_master WHERE type='table';"
How to diagnose
- File — Right path?
- Migrations — Applied?
- Name — Exact?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in SQL
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 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.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 18 Nov 2026