본문 바로가기

dev/MySQL

MySQL 계정 생성 및 권한 할당



CREATE USER '계정'@'localhost' IDENTIFIED BY '비밀번호'; #계정 생성, localhost 부분에 %를 적어주면 모든 경로에서 접근 가능

GRANT ALL ON 데이터베이스명.* TO '계정'@'localhost';


만약 mysql 8.0 이용시  java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.와 같은 에러가 난다면 

alter user '계정'@'localhost' identified with mysql_native_password by '비밀번호';

flush privileges;

'dev > MySQL' 카테고리의 다른 글

MySQL 날짜, 시간 관련 내용 정리  (0) 2019.03.19