/* % : 모든 외부 접속 권한 허용 */

INSERT INTO mysql.user (host,user,password, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES ('%','아이디',password('비밀번호'),'','','','');


or


/* localhost : 내부 로컬만 접속 권한 허용 */

INSERT INTO mysql.user (host,user,password, ssl_cipher, x509_issuer, x509_subject) VALUES ('localhost','아이디',password('비밀번호'),'','','');



flush privileges;


/* jh명의 database명들에 관한 dbuser 권한 설정 (동시에 외부 접속허용 %) */

/* 주의해야할점 database명이 ' ' 가 아닌 ` */

grant all privileges on jh.* to jh@% identified by 'qwer' with grant option;



/* jh_ 이름들로 시작한 database명들 모두 */

`jh_%`


or


/* jh명의 database명들에 관한 dbuser 권한 설정 (동시에 로컬만 접속허용 localhost) */

grant all privileges on jh.* to jh@localhost identified by 'qwer' with grant option;




// 모든 grant 문에는 flush privileges 를 할 필요없다



/* 유저 삭제 */

drop user 'jh'@'localhost';


/* 권한 확인 */

show  grants for 사용자명;


+ Recent posts