The column named in the statement is not found in that table (error 1054)
ERROR 1054 (42S22): Unknown column 'Maaz' in 'field list'Short answer
Error 1054 means the server read a word as a column name and found no such column in that place. The second part of the message says where: field list, where clause, on clause. Usual causes are a text value without quotes, a name that differs from the table, or double quotes read as identifiers under ANSI_QUOTES.
Fix it fast
1Find out which cause you have
List the real column names of the table named in the statement and compare them with the name in the error.
SHOW COLUMNS FROM customers;2Match what you see, then jump to its fix
- 1
The unknown 'column' is actually a value from your data, in 'field list'A text value is written without quotesFix - 2
Values in double quotes fail on one server but worked on anotherDouble quotes are read as identifiers (ANSI_QUOTES)Fix - 3
The name in the error is a column you expected to exist, in 'where clause' or 'field list'The column name differs from the table definitionFix
- 1
What does the error look like?
ERROR 1054 (42S22): Unknown column 'Maaz' in 'field list'ERROR 1054 (42S22): Unknown column 'email' in 'where clause'SQLSTATE[42S22]: Column not found: 1054 Unknown column
Cause 1 of 3
A text value is written without quotes
1Check
In an INSERT, a word without quotes is read as a column name. The word in the error is the value you meant.
INSERT INTO customers (name, city) VALUES (Maaz, Leeds);2Fix
Put string and date values in single quotes. Numbers stay bare.
INSERT INTO customers (name, city) VALUES ('Maaz', 'Leeds');3Verify
The row is inserted.
SELECT name, city FROM customers ORDER BY id DESC LIMIT 1;Confirmed by mariadb.com
Cause 2 of 3
Double quotes are read as identifiers (ANSI_QUOTES)
1Check
With the ANSI_QUOTES SQL mode, double quotes mark identifiers, not strings, so a quoted value becomes a column name.
SELECT @@sql_mode;2Fix
Use single quotes for values. They are strings in every mode.
SELECT * FROM customers WHERE city = 'Leeds';3Verify
The query returns rows instead of the error.
SELECT @@sql_mode;Confirmed by mariadb.com
Cause 3 of 3
The column name differs from the table definition
1Check
Compare spelling, underscores and plural forms with SHOW COLUMNS. A column added in a migration that has not run on this server gives the same error.
SHOW COLUMNS FROM customers;2Fix
Use the exact name from the table, quoted with backticks if it holds special characters. Run the missing migration if the column should exist.
SELECT `full_name` FROM customers;3Verify
The statement runs and returns the column.
SHOW COLUMNS FROM customers LIKE 'full_name';Confirmed by mariadb.com
How do I stop it coming back?
- Build SQL with parameters or prepared statements so values are never typed as bare words.
- Keep the sql_mode the same on every environment.
- Run migrations in order and check the schema version before deploying code that uses a new column.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- ShopGoAn e-commerce aggregator with a Python scraping engine behind its catalog, past 10K Google Play downloads.
Related fixes
Databases
The server could not parse an SQL statement (error 1064)
ERROR 1064 (42000): You have an error in your SQL syntax; ... near '' at line 1
Error 1064 means the parser stopped at a place where the statement made no sense to it.
3 causes, each with a fixDatabases
Installing the Airflow MySQL provider fails on pkg-config or mysqlclient
Building the mysqlclient wheel fails during the install
The Airflow MySQL provider depends on mysqlclient, which pip compiles against the MySQL C client library.
2 causes, each with a fixDatabases
A query on Aurora MySQL dies with 'table /rdsdbdata/tmp/#sql... is full'
ERROR 1114 (HY000): The table '/rdsdbdata/tmp/#sqlfd_1586_2' is full
In Aurora MySQL 3, internal temporary tables share one pool, and when that pool and the memory-mapped overflow file are used up, a reader instance ends the query with error 1114.
3 causes, each with a fixDatabases
Azure Database for MySQL refuses a connection that does not use SSL
ERROR 3159 (HY000): Connections using insecure transport are prohibited while --require_secure_transport=ON.
Azure Database for MySQL Flexible Server requires encrypted connections by default (require_secure_transport = ON, TLS 1.2).
4 causes, each with a fixDatabases
Compiling a C or C++ program that includes mysql.h fails
undefined reference to `mysql_init'
The compiler only finds mysql.h when the MySQL client development files are installed and their folder is on the include path.
3 causes, each with a fixDatabases
DBeaver fails to resolve Maven dependencies when downloading a database driver
A driver library does not download automatically
DBeaver downloads driver jars from a Maven repository.
3 causes, each with a fix