SQL: UPDATE

Grant and Revoke


The GRANT and REVOKE commands in SQL are DCL (Data Control Language) commands. They are focused on security, users, and permissions. The commands below are specific to the MySQL database.


Example: Grant (provide) all priviledges (permissions) to user dwsmitht to all databases that exist in the MySQL instance.


	GRANT ALL PRIVILEGES ON *.* TO 'dwsmith'@'localhost';
	

Example: Grant (provide) all priviledges (permissions) to user dwsmitht to the entire human_resources database.


	GRANT ALL PRIVILEGES ON human_resources.* TO 'dwsmith'@'localhost';
	

Example: Assign superuser/root priviledges to user dwsmith, i.e. all permissions on everything


	GRANT ALL PRIVILEGES ON *.* TO 'dwsmith'@'%';
	

Example: Grant Select Priviledges to the employees table in the human_resources database to user dwsmith


	GRANT SELECT ON human_resources.employees TO 'dwsmith'@'localhost;