본문 바로가기
IT/기타

Mysql 사용자 생성 권환 메모.

by JGSHIN 2025. 2. 19.
SMALL

create user 'jgshin'@'localhost' identified by 'Admin123!'; (localhost : 로컬 접속만 가능)
create user 'jgshin'@'10.22.1.13' identified by 'Admin123!';                                -------- 1

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

grant all privileges on *.* to 'jgshin'@'%';

GRANT ALL PRIVILEGES ON *.* TO 'jgshin'@'10.22.1.13' IDENTIFIED BY 'Admin123!';             -------- 2

drop user 'jgshin'@'10.22.1.13';

alter user 'jgshin'@'%' identified with mysql_native_password by 'Admin123!';

show grants for jgshin;                                                                     -------- 3
ddd

grant usage on *.* to 'jgshin'@'%' identified by 'Admin123!';

grant all privileges on *.* to 'jgshin'@'localhost' with grant option;

grant all privileges on *.* to 'jgshin'@'localhost' with grant option;

grant process on *.* to 'jgshin'@'%';

flush privileges;                                                                           -------- 4


 Db별 권한확인

>Select * from [mysql].db;

 모든 user 보기 , mysql DB의 user table

use mysql; 

select user from user;

SELECT Host,User,plugin,authentication_string FROM mysql.user;                               ------- 5

 


## 유저 ACL 리스닝 권한 열기

GRANT ALL PRIVILEGES ON *.* TO 'jgshin1'@'112.175.119.%' IDENTIFIED BY '1123';
GRANT ALL PRIVILEGES ON *.* TO 'jgshin2'@'112.175.119.%' IDENTIFIED BY '2123';
mysql> flush privileges;

## ACL 확인
SELECT Host,User,plugin,authentication_string FROM mysql.user;      

LIST
📧 이메일 문의
by @ 2025 JGSHIN