본문 바로가기
Programming/SQL

mysql 사용자/권한 관리

by Chan_찬 2016. 1. 13.
728x90
사용자 입력

> use mysql;
> insert into user(host,user,password,ssl_cipher,x509_issuer,x509_subject)
values('%','test',password('world!@#'),'','','');

> flush privileges;

권한 설정

> grant all privileges on test.* to 'test'@'%' identified by 'world!@#';
or
> grant select, insert, update, delete on test.* to 'test'@'%' identified by 'world!@#';

> flush privileges;

권한 확인

> show grants for test@'%';

권한 삭제

> REVOKE ALL PRIVILEGES ON test.* FROM test@'%';

사용자 삭제 - 권한(GRANTS)까지 모두 삭제

> drop user test@'%'



728x90
728x90
Buy me a coffeeBuy me a coffee

댓글