MySQL error 1143: Command denied to user for column
The account has column-level grants, and the statement used a column it has no privilege on for that command.
- Error number
1143- Name
ER_COLUMNACCESS_DENIED_ERROR- SQLSTATE
42000- Category
- Access and privileges
What it means
MySQL can grant privileges on individual columns. When an account's access to a table comes only from column grants, reading or changing any other column fails with 1143, which names the column.
Common causes
SELECT *on a table where the account may read only some columns.- An
UPDATEthat sets a column the account was not grantedUPDATEon.
How to fix it
-
List only the columns the account may use, or check its grants.
SHOW GRANTS FOR CURRENT_USER();
-
Grant the column privilege if it should be allowed.
GRANT SELECT (email) ON shop.customers TO 'app'@'%';
Related errors
More access and privileges errors
1045Access denied for user1044Access denied for user to database1130Host is not allowed to connect1698Access denied for user (no password)1227Access denied; you need a privilege1396Operation CREATE USER failed1419SUPER privilege needed with binary logging1449Definer user does not exist
The code and message text are from the MySQL 8.4 Error Message Reference. Browse the full MySQL error list or search every database error.
Work on MySQL in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for MySQL and the other databases you use.