How to Grant Update, Insert and Delete Permissions on a Table in MySQL Database - MySQL DBA Tutorial

How to provide Update, Delete and Insert Permissions to User on Table or Tables in MySQL Database


Below Syntax can be used to provide UPDATE, Delete and Insert permission on table/s in MySQL .

Syntax:

If you would like to provide update, delete and insert permission on single table in MySQL database, you can use below statement

MySQL > GRANT select, update, insert, delete ON tableName to 'UserName'@'Host' 


On all the tables in a database
 MySQL > GRANT select, update, insert, delete ON DatabaseName.* to 'UserName'@'Host' 

Example :
Let's say that if we have table "test" in Techbrothers Database and we would like to provide Update permission to user "Aamir" in MySQL. we can use below statement

MySQL > GRANT select, update, insert, delete ON Techbrothers.test to 'Aamir'@'localhost' 
If we would like to provide UPDATE,DELETE and INSERT permissions on all the tables in Techbrothers Database to user account Aamir in MySQL, we can use below statement

MySQL > GRANT select, update, insert, delete ON Techbrothers.* to 'Aamir'@'localhost' 

How to grant select, update, insert and delete permission to user in MySQL Server

2 comments: