Sunday, January 5, 2020

How to create a new user and grant permissions in MySQL

In this post I will show you, how to create a new user and grant permissions in MySQL

Previously I had shown..

Continuing the previous POST login to MySQl from terminal using below command

sudo mysql -u root -p
























Create New User using below command

CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'user_password';

Create New DB

create database 'new_DB';

Grant Permissions on a particular DB for user

GRANT ALL PRIVILEGES ON new_DB.* TO 'user_name'@'localhost';

Grant Permissions on all DB'S for user

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

No comments:

Post a Comment