상세 컨텐츠

본문 제목

mysql 계정 생성하고 권한 부여

mysql

by 2hansoul 2021. 11. 1. 17:03

본문

반응형

디비 접속후 

MariaDB [mysql]> select host,user,password from user;

계정생성

MariaDB [mysql]> create user 'id'@'%' identified by 'password';

확인해 보면 사용자가 추가 되었다 

 

모든 권한 부여

grant all privileges on *.* to 'id'@localhost identified by 'pass';

 

 

특정 디비에 부여 관여  (해당 디비에 접속 후)

grant all privileges on db이름.*to 'id'@localhost identified by 'pass';

 

모든 디비 테이블 DML권한 부여  

grant select, insert, update on test.* to user@localhost identified by '비밀번호'

 

권한 부여 하고 실행

flush privileges;

 

 권한이 잘 부여 됐는지 확인 

show grants for id@localhost';

 

반응형

관련글 더보기

댓글 영역