카테고리 없음

MySQL 계정 생성 (v8.0 이상)

건덕지만세 2022. 7. 6. 09:41
반응형

https://fruitdev.tistory.com/206

 

MySQL8.0 계정생성 및 DB 권한 주기

MySql5.7 까지만 하더라도 아래와 같이 계정 생성과 동시에 DB에 권한을 부여할 수 있었다. mysql> grant all privileges on DB이름.* to 계정ID@'%' identified by '계정비밀번호' with grant option..

fruitdev.tistory.com

MySQL 5.x는 아래와 같이

mysql> grant all privileges on DB명.* to 계정ID@'호스트명' identified by '(신규/기존)비밀번호' with grant option;
mysql> flush privileges;

MySQL 8 이상에서는 아래와 같이

mysql> CREATE USER 계정ID@'호스트명' identified by '(신규/기존)비밀번호';
mysql> grant all privileges on DB명.* to 계정ID@'호스트명' with grant option;
mysql> flush privileges;