- 정보공유
[SQL] mysql 외부아이피 허용하기.
허용아이피가 어떻게 되는지 확인
select host from user where user='root';
모든 아이피 허용.
insert into user (host,user,password) values ('%','root',password('패스워드')); grant all privileges on *.* to 'root'@'%'; flush privileges;
ip대역으로 허용.
insert into user (host,user,password) values ('555.501.%','root',password('패스워드')); grant all privileges on *.* to 'root'@'555.501.%'; flush privileges;
특정아이피 허용
insert into user (host,user,password) values ('555.501.502.18','root',password('패스워드')); grant all privileges on *.* to 'root'@'555.501.502.18'; flush privileges;
원래상태로 복원
delete from mysql.user where host='%' and user='root'; flush privileges;