How to provide full permissions on a database to user in MySQL Server - MySQL DBA Tutorial

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:
MySQL > GRANT ALL ON DatabaseName.* TO 'UserName'@'Host' WITH GRANT OPTION;

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:
 
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";

Grant full permissions on TechBrothers Databases to user account TB.

MySQL > GRANT ALL ON TechBrothers.* TO 'TB'@'localhost' With GRANT OPTION; 

5 comments:

  1. It seems that the internet is very much interested in creating a fiction-based story like a Slender Man and other repeated ghost stories. Among all those false stories Teresa fidalgo ghost is one of them that gets hyped on the internet in a different way. I recommend this article for detailed information.

    ReplyDelete
  2. Amazing article. Thanks for sharing with us.
    visit our website for Dutch hormone Test

    ReplyDelete
  3. you are providing a Technical knowledge for whom who need this. Thank you for sharing with us. huntsville al therapist

    ReplyDelete
  4. Amazing article. Thanks for sharing with us.
    visit our website for Commercial painting services boston

    ReplyDelete