The COLUMN_PRIVILEGES table provides
information about column privileges. It takes its values from the
mysql.columns_priv system table.
The COLUMN_PRIVILEGES table has these
columns:
GRANTEEThe name of the account to which the privilege is granted, in
'format.user_name'@'host_name'TABLE_CATALOGThe name of the catalog to which the table containing the column belongs. This value is always
def.TABLE_SCHEMAThe name of the schema (database) to which the table containing the column belongs.
TABLE_NAMEThe name of the table containing the column.
COLUMN_NAMEThe name of the column.
PRIVILEGE_TYPEThe privilege granted. The value can be any privilege that can be granted at the column level; see Section 15.7.1.6, “GRANT Statement”. Each row lists a single privilege, so there is one row per column privilege held by the grantee.
In the output from
SHOW FULL COLUMNS, the privileges are all in one column and in lowercase, for example,select,insert,update,references. InCOLUMN_PRIVILEGES, there is one privilege per row, in uppercase.IS_GRANTABLEYESif the user has theGRANT OPTIONprivilege,NOotherwise. The output does not listGRANT OPTIONas a separate row withPRIVILEGE_TYPE='GRANT OPTION'.
Notes
COLUMN_PRIVILEGESis a nonstandardINFORMATION_SCHEMAtable.
The following statements are not equivalent:
SELECT ... FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES
SHOW GRANTS ...