-
[MySQL] MySQL 5.7 user 생성, 권한 부여데이터베이스 2017. 11. 4. 20:51
localhost 기준으로,
insert into user(host, user, authentication_string, ssl_cipher, x509_issuer, x509_subject)
values('localhost', '계정', password('비밀번호'), '', '', '');
127.0.0.1 기준으로,
insert into user(host, user, authentication_string, ssl_cipher, x509_issuer, x509_subject)
values('127.0.0.1', '계정', password('비밀번호'), '', '', '');
외부접속을 기준으로,
insert into user(host, user, authentication_string, ssl_cipher, x509_issuer, x509_subject)
values('%', '계정', password('비밀번호'), '', '', '');
생성한 후, 아래 명령어로 flush.
flush privileges;
권한부여도 마찬가지로,
grant all privileges on _university.* to 계정@localhost identified by '비밀번호' with grant option;
grant all privileges on _university.* to 계정@127.0.0.1 identified by '비밀번호' with grant option;
grant all privileges on _university.* to '계정'@'%' identified by '비밀번호' with grant option;
flush privileges;
반응형'데이터베이스' 카테고리의 다른 글
[MySQL] MySQL 5.7 table 생성, record 삽입, select 출력 (0) 2017.11.04