// MySQL error reference

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
Error message
%s command denied to user '%s'@'%s' for column '%s' in table '%s'

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 UPDATE that sets a column the account was not granted UPDATE on.

How to fix it

  1. List only the columns the account may use, or check its grants.

    SHOW GRANTS FOR CURRENT_USER();
  2. Grant the column privilege if it should be allowed.

    GRANT SELECT (email) ON shop.customers TO 'app'@'%';

Related errors

More access and privileges errors

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.

// fewer errors, faster fixes

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.