geoip 지역까지 정보를 csv, 국가 도시별 IP대역

http://www.maxmind.com/download/geoip/database/GeoLiteCity_CSV/

geoip 지역까지 정보를 보여주는것.

설명페이지
http://www.maxmind.com/app/city
---=-----
DB구조
Database Fields
FieldData TypeField Description
Start IP Numberunsigned intFirst IP in netblock, numeric representation. (Only in CSV format)
End IP Numberunsigned intLast IP in netblock, numeric representation. (Only in CSV format)
Location IDunsigned intLocation ID used to join netblock and location tables (CSV Only).
Country Codechar(2)ISO 3166 Country Code, with the addition of
State/Regionchar(2)For US/Canada, ISO-3166-2 code for the state/province name, with the addition of AA, AE, and AP for Armed Forces America, Europe and Pacific. Outside of the US and Canada, FIPS 10-4code. Region name lookups are available in selected APIs
City Namevarchar(255)Name of city or town in ISO-8859-1 encoding. A list of cities contained in GeoIP City is available. A localized CSV file containing city names in various languages is available.
Postal Codevarchar(6)For US, Zipcodes, for Canada, postal codes. More info.
Latitudenumeric (float)Latitude of city where IP is located
Longitudenumeric (float)Longitude of city where IP is located
Metro Codeunsigned intMetropolitan Area (US Only).
Area Codeunsigned intThree digit telephone prefix (US Only).




CREATE TABLE `geo_block` (
  `startIpNum` INT(10) UNSIGNED DEFAULT NULL COMMENT '시작IP숫자',
  `endIpNum` INT(10) UNSIGNED DEFAULT NULL COMMENT '종료IP숫자',
  `locId` INT(10) UNSIGNED DEFAULT NULL COMMENT '지역ID',
  KEY `idx_startIpNum` (`startIpNum`)
) ENGINE=MYISAM DEFAULT CHARSET=utf8

CREATE TABLE `geo_location` (
  `locId` INT(11) NOT NULL COMMENT '지역ID',
  `country` CHAR(2) DEFAULT NULL COMMENT '국가코드',
  `region` CHAR(2) DEFAULT NULL COMMENT '지역코드',
  `city` VARCHAR(255) DEFAULT NULL COMMENT '도시명',
  `postalCode` VARBINARY(6) DEFAULT NULL COMMENT 'For US, Zipcodes, for Canada, postal codes.',
  `latitude` FLOAT DEFAULT NULL COMMENT '위도 : Latitude of city where IP is located',
  `longitude` FLOAT DEFAULT NULL COMMENT '경도 : Longitude of city where IP is located',
  `metroCode` INT(10) UNSIGNED DEFAULT NULL COMMENT 'Metropolitan Area (US Only).',
  `areaCode` INT(10) UNSIGNED DEFAULT NULL COMMENT 'Three digit telephone prefix (US Only).',
  PRIMARY KEY  (`locId`)
) ENGINE=MYISAM DEFAULT CHARSET=utf8




LOAD DATA LOCAL INFILE 'D:/work/homepage/html/web_work/geolitecity/file/data/GeoLiteCity-Location.csv' INTO TABLE geo_location 
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n' 
IGNORE 2 LINES


LOAD DATA LOCAL INFILE 'D:/work/homepage/html/web_work/geolitecity/file/data/GeoLiteCity-Blocks.csv' INTO TABLE geo_block
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n' 
IGNORE 2 LINES



참고
키사에서 제공하는 국내 IP주소 대역.(XML)
http://ip.kisa.or.kr/ipas/jsp/api/ipv4list.jsp



댓글
  • No Nickname
    No Comment
  • 권한이 없습니다.
    {{m_row.m_nick}}
    -
제목 작성자 날짜
공대여자
공대여자
mins01
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자
공대여자