MySQL Privileges

MySQL provides privileges that apply in different contexts and at different levels of operation.
MySQL Privileges can be classified into five types.
1) Global Privileges
2) Database Privileges
3) Table Privileges
4) Column Privileges
5) Stored Routine Privileges

Information about account privileges is stored in the user, db, tables_priv, columns_priv, procs_priv and proxies_priv tables of the mysql database. TheĀ MySQL Server reads the contents of these tables into memory when it starts and reloads them. So access-control decisions are based on the in-memory copies of the grant tables. Read more about Privilege System Grant Tables.

 

1) Global Privileges

CREATE USER		Enable use of CREATE USER, DROP USER, RENAME USER, and REVOKE ALL PRIVILEGES
FILE			Enable the user to cause the server to read or write files
PROCESS			Enable the user to see all processes with SHOW PROCESSLIST
RELOAD			Enable use of FLUSH operations
REPLICATION CLIENT	Enable the user to ask where master or slave servers are
REPLICATION SLAVE	Enable replication slaves to read binary log events from the master
SHOW DATABASES		Enable SHOW DATABASES to show all databases
SHUTDOWN		Enable use of mysqladmin shutdown
SUPER			Enable use of other administrative operations such as CHANGE MASTER TO, KILL, PURGE BINARY LOGS, SET GLOBAL, and mysqladmin debug command

 

2) Database Privileges

CREATE			Enable database and table creation
DROP			Enable databases, tables, and views to be dropped
EVENT			Enable use of events for the Event Scheduler
GRANT OPTION		Enable privileges to be granted to or removed from other accounts
LOCK TABLES		Enable use of LOCK TABLES on tables for which you have the SELECT privilege

 

3) Table Privileges

ALTER			Enable use of ALTER TABLE
CREATE			Enable table creation
CREATE VIEW		Enable views to be created or altered
DELETE			Enable use of DELETE
DROP			Enable tables, and views to be dropped
GRANT OPTION		Enable privileges to be granted to or removed from other accounts
INDEX			Enable indexes to be created or dropped
INSERT			Enable use of INSERT
SELECT			Enable use of SELECT
SHOW VIEW		Enable use of SHOW CREATE VIEW
TRIGGER			Enable trigger operations
UPDATE			Enable use of UPDATE

 

4) Column Privileges

INSERT			Enable use of INSERT
SELECT			Enable use of SELECT
UPDATE			Enable use of UPDATE

 

5) Stored Routine Privileges

ALTER ROUTINE		Enable stored routines to be altered or dropped
CREATE ROUTINE		Enable stored routine creation
EXECUTE			Enable the user to execute stored routines
GRANT OPTION		Enable privileges to be granted to or removed from other accounts

 

 

 

You may go back to the following section.
Basics of working with MySQL Server