The Information Schema COLUMN_PRIVILEGES table contains column privilege information derived from the mysql.columns_priv grant table.

It has the following columns:

ColumnDescription
GRANTEEIn the format user_name@host_name.
TABLE_CATALOGAlways def.
TABLE_SCHEMADatabase name.
TABLE_NAMETable name.
COLUMN_NAMEColumn name.
PRIVILEGE_TYPEOne of SELECT, INSERT, UPDATE or REFERENCES.
IS_GRANTABLEWhether the user has the GRANT OPTION for this privilege.

Similar information can be accessed with the SHOW FULL COLUMNS and SHOW GRANTS statements. See the GRANT article for more about privileges.

This information is also stored in the |columns_priv table, in the mysql system database.

For a description of the privileges that are shown in this table, see column privileges.

Example

In the following example, no column-level privilege has been explicitly assigned:

SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES;
Empty set

Comments

Comments loading...