새소식

Database

MariaDB 사용자 접근 권한 설정

  • -

# 사용자 권한 설정

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
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.