mysql 유저 생성
- 다른 PC에서 mysql 서버로 접속을 하기 위한 사용자 추가
mysql> create user 'userId'@'%' identified by 'userpassword'; |
- 위 사용자에게 모든 것을 할 수 있는 권한 주기
mysql> grant all privileges on *.* to 'userid'@'%'; |
- 위 사용자에게 특정 DB를 관리할수 있는 권한 주기
mysql> grant all privileges on dbname.* to 'userid'@'%'; |
- 로컬PC에서 mysql로 접속하기 위한 사용자 추가
mysql> create user 'userId'@'localhost' identified by 'userpassword'; |
- 위 사용자에게 모든 것을 할 수 있는 권한 주기
mysql> grant all privileges on *.* to 'userid'@'localhost'; |
- 위 사용자에게 특정 DB를 관리할 수 있는 권한 주기
mysql> grant all privileges on dbname.* to 'userid'@'localhost'; |
출처:http://naleejang.tistory.com/59
사용자에게 주어진 권한 확인방법
mysql > show grants for test@localhost;
mysql > show grants for test@'%';
mysql > show grants for test@'ip명';
사용자 DB 사용권한 제거
mysql > revoke all on test.* from test@'%';
DB 유저 삭제
drop user user명@server명;
mysql > drop user user1@localhost;
'Mysql' 카테고리의 다른 글
mysql 환경설정 재시작없이 적용하기 (0) | 2015.12.22 |
---|---|
mysqldump 옵션 설명 (0) | 2015.11.05 |
mysql 사용법 (0) | 2015.09.04 |
mysql 프로시저,함수 생성 권한 주기 (0) | 2015.08.21 |
innodb memcached 적용 (0) | 2015.07.15 |