[My-sql] database user privileges(권한설정) Tip1

Global level


GRANT ALL ON *.* TO ‘someuser’@’somehost’;
GRANT SELECT, INSERT ON *.* TO ‘someuser’@’somehost’;


Database level


GRANT ALL ON mydb.* TO ‘someuser’@’somehost’;
GRANT SELECT, INSERT ON mydb.* TO ‘someuser’@’somehost’;


Table level


GRANT ALL ON mydb.mytbl TO ‘someuser’@’somehost’;
GRANT SELECT, INSERT ON mydb.mytbl TO ‘someuser’@’somehost’;


Column level


GRANT SELECT (col1), INSERT (col1,col2) ON mydb.mytbl TO ‘someuser’@’somehost’;


Routine level


GRANT CREATE ROUTINE ON mydb.* TO ‘someuser’@’somehost’;
GRANT EXECUTE ON PROCEDURE mydb.myproc TO ‘someuser’@’somehost’;



SET PASSWORD statement. For example:


GRANT … IDENTIFIED BY ‘mypass’;


GRANT …
IDENTIFIED BY PASSWORD ‘*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4’;

출처:http://www.ssial.com/entry/mysql-database-user-privileges권한설정

댓글 남기기