외부 교육 정리/STAC
mysql useradd
kcrong
2015. 8. 4. 00:38
- mysql 서버 로그인하기
$ mysql -uroot -prootpassword 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';