[질문] mysql사용합니다. localhost외에 외부 컴퓨터에서는 접근

kkumooli의 이미지

mysql(4.0.18)
ip 192.168.144

제 컴퓨터
ip 192.168.1.45

DB_URL = jdbc:mysql://app1.abc.com:3306/abc
DB_USER = abc
DB_PASSWORD = abc

conn = DriverManager.getConnection( DB_URL, DB_USER, DB_PASSWORD )

위와 같은 상황으로 192.168.1.44에서는 connection을 가져올 수 있습니다. 그런데 192.168.1.45에서는 connection을 못 가져옵니다.

mysql 설치나 설정중에 제가 잘못한 것이 있지 않나 싶은데..
무엇을 잘 못 했는지..

dsh의 이미지

유저 등록할 때 접속 호스트에 제한을 거는 부분을 확인하시면 될 듯 합니다.

mysql online manual 에서 grant 로 검색해 보세요.

M.W.Park의 이미지

#
# The skip-networking option will no longer be set via debconf menu.
# You have to manually change it if you want networking i.e. the server
# listening on port 3306. The default is "disable" - for security reasons.

skip-networking

데비안을 쓰신다면... my.cnf에 보시면 위와 같은 부분이 있을 겁니다.
주석처리 하셔야합니다.

-----
오늘 의 취미는 끝없는, 끝없는 인내다. 1973 法頂

kkumooli의 이미지

답변 감사드립니다.

grant all privileges on *.* to 아이디@localhost identified by '패스워드' with grant option;

grant all privileges on *.* to 아이디@"%" identified by '패스워드' with grant option;

grant all on db네임.* to 아이디;

gbkwon의 이미지

kkumooli wrote:
mysql(4.0.18)
ip 192.168.144

제 컴퓨터
ip 192.168.1.45

DB_URL = jdbc:mysql://app1.abc.com:3306/abc
DB_USER = abc
DB_PASSWORD = abc

conn = DriverManager.getConnection( DB_URL, DB_USER, DB_PASSWORD )

위와 같은 상황으로 192.168.1.44에서는 connection을 가져올 수 있습니다. 그런데 192.168.1.45에서는 connection을 못 가져옵니다.

mysql 설치나 설정중에 제가 잘못한 것이 있지 않나 싶은데..
무엇을 잘 못 했는지..

/etc/my.cnf 에서 다음과 같은 라인을 찾아보고 모두 주석 처리 하세요..

#bind-address = 127.0.0.1
#skip-networking

;