본문 바로가기
Programming

[MySql] 권한 주기

by Mizix 2014. 4. 1.
반응형

RANT문을 사용해 사용자를 추가하거나 권한을 부여할수도 있습니다.
GRANT ALL ON TO @ IDENTIFIED BY '비밀번호';


사용자 권한 삭제는 REVOKE문을 사용하시면 됩니다.
REVOKE ON FROM ;


1) user1에 모든 db의 권한을 줄때 ( root를 제외한 super user : dba ) 
localhost의 권한 
grant all privileges on *.* to user1@localhost identified by 'pass1'; 

%의 권한 
grant all privileges on *.* to user1 identified by 'pass1'; 

2) user1에 db1의 사용권한을 줄때 
localhost의 권한 
grant all privileges on db1.* to user1@localhost identified by 'pass1'; 

%의 권한 
grant all privileges on db1.* to user1 identified by 'pass1'; 

3) user1에 db1의 tb1의 권한을 줄때 
localhost의 권한 
grant all privileges on db1.tb1 to user1@localhost identified by 'pass1'; 

%의 권한 
grant all privileges on db1.tb1 to user1 identified by 'pass1'; 

권한 삭제는 
REVOKE all on *.* from user1

반응형