db/mysql
특정사용자 table 권한 주기
C/H
2015. 11. 24. 08:30
- 13.7.1.4 GRANT Syntax
- How To Create a New User and Grant Permissions in MySQL
- Remove Permissions for a MySQL User on Linux via Command Line
- MySQL에서 사용자 권한 주기 (grant 명령어)
권한설정
-- 문법 -- GRANT [type of permission] ON [database name].[table name] TO ‘[username]’@'localhost’; GRANT select ON dbname.tablename TO username; GRANT update ON dbname.tablename TO username; GRANT insert ON dbname.tablename TO username; GRANT delete ON dbname.tablename TO username; -- GRANT select, insert, update ON test.* TO username@localhost identified by 'password'; flush privileges;
설정해제
-- 설정된 GRANT 설정 보기 show grants for username; -- 문법 -- REVOKE permission ON database.table FROM 'user'@'localhost'; REVOKE INSERT, SELECT ON dbname.tablename FROM 'username';
반응형