Linux Views 6

Creating MySQL and MariaDB users and grants

Short commands

BASH
create user 'root'@'%' identified by 'root';
grant all privileges on *.* to 'root'@'%';

Creating a user

BASH
create user '사용자'@'localhost' identified by '비밀번호';
create user '사용자'@'192.168.0.1' identified by '비밀번호';
create user '사용자'@'192.168.0.%' identified by '비밀번호';

Database privileges

BASH
grant all privileges on *.* to '사용자'@'localhost';
grant all privileges on DB이름.* to '사용자'@'192.168.0.%';
grant all privileges on DB이름.TABLE이름 to '사용자'@'192.168.0.%';


Dropping a user

BASH
drop user '사용자'@'localhost';
drop user '사용자'@'192.168.0.%';

Reactions

Comments 0

A nickname and a password are required. The same password edits or deletes the comment later. Comments appear after a review.

Comments appear after a review. The password is used again to edit or delete.