Database

MariaDB 사용자 접근 권한 설정

kogun82 2022. 12. 27. 14:08

# 사용자 권한 설정

mysql> grant all privileges on dbname.table to userid@host identified by 'password';


## ## 모든 db 및 테이블에 접근권한 설정

mysql> grant all privileges on *.* to userid@host identified by 'password';


## 모든 db 및 테이블에 권한을 주고 로컬 및 리모트에서도 접속가능하도록 설정

mysql> grant all privileges on *.* to userid@'%' identified by 'password';


## 설정한 권한 적용

mysql> flush privileges;


## 권한 삭제

mysql> revoke all on dbname.table from userid@host


## 권한 조회

mysql> show grants for userid@host
반응형