GRANT
GRANT is a SQL statement in the Administration category. Grants specific privileges (SELECT, INSERT, UPDATE, DELETE, ALL) to a user on a database/table. The syntax is GRANT privilege1, privilege2 ON database.table TO 'user'@'host';. It returns privileges granted. A typical example: GRANT SELECT, INSERT ON my_db.* TO 'app_user'@'localhost'; GRANT ALL PRIVILEGES ON my_db.* TO 'admin'@'localhost'; A close relative is CREATE USER, which creates a new database user account. A close relative is REVOKE, which removes previously granted privileges from a user. A close relative is SHOW TABLES, which lists all tables in the current or named database. More about this category: Database administration — CREATE DATABASE, GRANT, REVOKE, SHOW, DESCRIBE. Related Administration entries: CREATE USER, REVOKE, SHOW TABLES, DESCRIBE / DESC, SHOW INDEX, SHOW CREATE TABLE, SHOW DATABASES, SHOW PROCESSLIST. This page is part of the free SQL Reference documentation covering 762+ statements, functions, and clauses, each with syntax, parameters, return values, and examples for MySQL, PostgreSQL, SQL Server, and SQLite.