본문 바로가기

Database

[MySQL] MySQL 유저 관리

반응형

mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
    ->     WITH GRANT OPTION;
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
    ->     WITH GRANT OPTION;
mysql> CREATE USER 'admin'@'localhost';
mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
mysql> CREATE USER 'dummy'@'localhost';


DROP USER 'jeffrey'@'localhost';
관련 사이트 : http://dev.mysql.com/doc/refman/5.6/en/adding-users.html



유저 생성 : create user '유저명'@'접속허용할 IP' identified by '유저비밀번호';


유저 권한 : grant all privileges on DB명.Table명 to '유저명'@'접속허용할 IP' with grant option;


유저 삭제 : drop user '유저명'@'접속허용한 IP';

반응형