DB

MySQL 접근 ID, IP 설정

Lawmin 2021. 7. 6. 13:28

1. 접근 권한 부여

create user '[ID]'@'[IP]' identified by '[PW]';
grant all privileges on [ID].* to '[ID]'@'[IP]';

또는

grant all privileges on [ID].* to '[ID]'@'[IP]' identified by '[PW]';
flush privileges;

 

2. 접근 권한 해제

 revoke all privileges on [ID].* from '[ID]'@'[IP]';

 

3. 계정 삭제

DROP USER '[ID]'@'[IP]';