ERROR 1109 occurs when MySQL cannot find a referenced table in your query. This is usually due to typos, incorrect database context, or table aliases. Fix it by verifying table names, checking your database context, and confirming the table exists.
ERROR 1109 (ER_UNKNOWN_TABLE with SQLSTATE 42S02) is thrown when MySQL cannot locate the specified table in the context where you're trying to use it. The error message format is "Unknown table '%s' in %s", where the first placeholder is the table name and the second is the clause where the error occurred (FROM, JOIN, DELETE, UPDATE, etc.). This error indicates a mismatch between what you're asking MySQL to find and what actually exists in the database or is currently accessible in your session.
First, confirm you are connected to the correct database by running:
SELECT DATABASE();If the output is NULL or shows the wrong database, switch to the correct one:
USE your_database_name;Ensure the database name in your connection string or client configuration matches where your table actually exists.
Verify the table is present in your database:
SHOW TABLES LIKE 'your_table_name';You can also list all tables in the database:
SHOW TABLES;If the table doesn't appear, it either doesn't exist, was dropped, or is in a different database. Create it if necessary or adjust your query to point to the correct table.
Review your query carefully for spelling mistakes. MySQL table names are case-sensitive on Linux/Unix systems but case-insensitive on Windows/macOS. Common mistakes include:
-- WRONG: typo in table name
SELECT * FROM userss WHERE id = 1;
-- CORRECT: correct spelling
SELECT * FROM users WHERE id = 1;If you're unsure of the exact table name, use SHOW TABLES to find the correct spelling.
If you assigned an alias to a table, you must use the alias when referencing columns from that table, not the original table name:
-- WRONG: using original table name after alias assignment
SELECT products.id FROM products AS p WHERE p.price > 100;
-- CORRECT: use the alias consistently
SELECT p.id FROM products AS p WHERE p.price > 100;Also, when using HANDLER statements, open the table before trying to read from it:
HANDLER products OPEN;
HANDLER products READ FIRST;
HANDLER products CLOSE;When working with multiple databases or in shared environments, explicitly specify the database name:
-- WRONG: ambiguous in shared environments
SELECT * FROM my_table;
-- CORRECT: fully qualified
SELECT * FROM database_name.my_table;This prevents errors when the same table exists in multiple databases or when the connection defaults to the wrong database.
If you're getting "Unknown table 'COLUMN_STATISTICS' in information_schema" when using mysqldump 8+ to export from MySQL <8.0, add the --column-statistics=0 flag:
mysqldump --column-statistics=0 -u root -p database_name > backup.sqlThe COLUMN_STATISTICS table was introduced in MySQL 8.0, so mysqldump 8+ tries to export it by default. This flag disables that behavior for compatibility with older MySQL versions.
Replication lag can cause "Unknown table" errors on replicas: DDL operations may not have been applied yet if the replica is behind the primary. Wait for the relay log to catch up or resynchronize the replica. Temporary tables (prefixed with # in some databases) are session-specific and disappear when the connection closes—they cannot be accessed by other connections. When diagnosing Error 1109, check your query logs and client configuration to ensure statements are reaching the correct database instance. On case-sensitive systems (Linux), MySQL table names follow the filesystem case sensitivity rules, while on case-insensitive systems (Windows/macOS), MySQL treats them case-insensitively by default.
EE_WRITE (3): Error writing file
How to fix "EE_WRITE (3): Error writing file" in MySQL
CR_PARAMS_NOT_BOUND (2031): No data supplied for parameters
How to fix "CR_PARAMS_NOT_BOUND (2031): No data supplied for parameters" in MySQL
CR_DNS_SRV_LOOKUP_FAILED (2070): DNS SRV lookup failed
How to fix "CR_DNS_SRV_LOOKUP_FAILED (2070): DNS SRV lookup failed" in MySQL
ERROR 1146: Table 'database.table' doesn't exist
How to fix "ERROR 1146: Table doesn't exist" in MySQL
ERROR 1040: Too many connections
How to fix "ERROR 1040: Too many connections" in MySQL