http://www.maxmind.com/download/geoip/database/GeoLiteCity_CSV/
geoip 지역까지 정보를 보여주는것.
설명페이지
---=-----
DB구조
Database Fields
Field | Data Type | Field Description |
Start IP Number | unsigned int | First IP in netblock, numeric representation. (Only in CSV format) |
End IP Number | unsigned int | Last IP in netblock, numeric representation. (Only in CSV format) |
Location ID | unsigned int | Location ID used to join netblock and location tables (CSV Only). |
Country Code | char(2) | ISO 3166 Country Code, with the addition of |
State/Region | char(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 Name | varchar(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 Code | varchar(6) | For US, Zipcodes, for Canada, postal codes. More info. |
Latitude | numeric (float) | Latitude of city where IP is located |
Longitude | numeric (float) | Longitude of city where IP is located |
Metro Code | unsigned int | Metropolitan Area (US Only). |
Area Code | unsigned int | Three 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)