How to Grant all permissions to user in MySQL Server - MySQL DBA Tutorial

How to Grant all permissions to user in MySQL Server 


If you would like to provide all permissions like root user to user account in MySQL Server, you can use below command.
First of all let's create a user by using below 


Syntax:

MySQL > Create User 'UserName'@'localhost';

To provide all permission including with GRANT , below syntax can be use


MySQL > GRANT ALL ON *.* To 'UserName'@'HostName'  With GRANT OPTION;

Example:
Let's say that you would like to create user Aamir and provide him all the permissions.



MySQL > Create user 'Aamir'@'localhost' Identified by 'Password'; 

 MySQL > GRANT ALL ON *.* to 'Aamir'@'localhost' With Grant Option;

Grant all privileges to user in MySQL Server by using MySQL Command line