데이터베이스에 접근하는 사용자를 먼저 등록한다. 요청하는 출발지에 따라 약간?씩 다르다.
mysql> insert into user(host, user, authentication_string, ssl_cipher, x509_issuer, x509_subject)
values('localhost', '계정', password('비밀번호'), '', '', '');
mysql> insert into user(host, user, authentication_string, ssl_cipher, x509_issuer, x509_subject)
values('127.0.0.1', '계정', password('비밀번호'), '', '', '');
mysql> insert into user(host, user, authentication_string, ssl_cipher, x509_issuer, x509_subject)
values('%', '계정', password('비밀번호'), '', '', '');
mysql> flush privileges;
사용자만 생성한다 해서 접속되지 않는다.
접속 권한을 부여해야 한다.
사용자 생성과 마찬가지로 출발지에 따라 약간?씩 다르다.
mysql> grant all privileges on _university.* to 계정@localhost identified by '비밀번호' with grant option;
mysql> grant all privileges on _university.* to 계정@127.0.0.1 identified by '비밀번호' with grant option;
mysql> grant all privileges on _university.* to '계정'@'%' identified by '비밀번호' with grant option;
그리고 마지막은
mysql> flush privileges;
!mysql
!grant
!권한
!사용자등록