How to provide full permissions to user in MySQL Database
To provide full permissions on a Database to user in MySQL Server, you will be using below syntax.
Syntax:
WITH GRANT OPTION, user will be able to provide permissions to other users on the database. If you don't want that then remove the "With GRANT OPTION" from above statement.
Example:
Syntax:
MySQL > GRANT ALL ON DatabaseName.* TO 'UserName'@'Host' WITH GRANT OPTION;
Example:
Let's create user TB and provide full permissions on Database name "TechBrothers" , We also want the TB user to have permissions to GRANT permissions on "TechBrothers" databases to other users.
MySQL > Create User 'TB'@'localhost' Identified by "Password123";
MySQL > GRANT ALL ON TechBrothers.* TO 'TB'@'localhost' With GRANT OPTION;
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.