Mysql 외부접속 허용방법 | Database

[상태확인]

1. root 계정의 host 를 알수있음.

SELECT Host FROM mysql.USER WHERE USER='root';

[변경방법]

1.모든 IP 허용
INSERT INTO mysql.USER (host,USER,password) VALUES ('%','root',password('패스워드'));
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;

2. IP 대역허용 

INSERT INTO mysql.USER (host,USER,password) VALUES ('111.222.%','root',password('패스워드'));
GRANT ALL PRIVILEGES ON *.* TO 'root'@'111.222.%';
FLUSH PRIVILEGES;

3. 특정 IP만 허용

INSERT INTO mysql.USER (host,USER,password) VALUES ('111.222.%','root',password('패스워드'));
GRANT ALL PRIVILEGES ON *.* TO 'root'@'111.222.%';
FLUSH PRIVILEGES;

[원래상태 복귀]

1. 모든아이피 허용했을경우 원래 복귀방법

DELETE FROM mysql.USER WHERE Host='%' AND USER='root';
FLUSH PRIVILEGES;

이상.


mysql,외부접속
Comment Write
Comment List
등록된 코멘트가 없습니다.