CertGrid CertGrid
Hands-on Lab·MySQL

MySQL Column-Level Privileges

Grant `SELECT` on three named columns and the account can read those three. Asking for a fourth returns 1143 - a third distinct denial, this time naming the column.

Users and Privileges Guide 18 of 45 Intermediate

Written against the versions above. Column-level grants are stored in `mysql.columns_priv` and have existed for a long time. They are checked per statement, so they cost a little more than table-level grants.

Every command on this page ran on db-a01.
Server NameIP AddressOSRolesCPURAMHDD
db-a01192.168.0.81Ubuntu 26.04 LTSPrimary / Source / Replica Set Member 12 Core4 GB50 GB

Before you start

  1. Grant three columns, not a table

  2. Read the granted columns

  3. Ask for a column outside the grant

Official sources