http://www.maxmind.com/download/geoip/database/GeoLiteCity_CSV/
geoip 지역까지 정보를 보여주는것.
설명페이지
http://www.maxmind.com/app/city
—=—–
DB구조
Database Fields
<tbody><tr bgcolor="#EADCBF">&lt;td align="middle" nowrap="" style="font-size: small; "&gt;**Field**&lt;/td&gt;&lt;td align="middle" nowrap="" style="font-size: small; "&gt;**Data Type**&lt;/td&gt;&lt;td align="middle" nowrap="" style="font-size: small; "&gt;**Field Description**&lt;/td&gt;</tr><tr>&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Start IP Number&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;unsigned int&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;First IP in netblock, [numeric representation](http://www.maxmind.com/app/csv). (Only in CSV format)&lt;/td&gt;</tr><tr>&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;End IP Number&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;unsigned int&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Last IP in netblock, [numeric representation](http://www.maxmind.com/app/csv). (Only in CSV format)&lt;/td&gt;</tr><tr>&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Location ID&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;unsigned int&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Location ID used to join netblock and location tables (CSV Only).&lt;/td&gt;</tr><tr>&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Country Code&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;char(2)&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;[ISO 3166](http://www.maxmind.com/app/iso3166) Country Code, with the addition of- A1 for [Anonymous Proxies](http://www.maxmind.com/app/faq#anonproxy). More comprehensive [Open Proxy](http://www.maxmind.com/app/ipauthentication#open) detection is available through the [minFraud](http://www.maxmind.com/app/ccv_overview) or [proxy detection](http://www.maxmind.com/app/proxy) web service.&amp;#xD;
- A2 for [Satellite Providers](http://www.maxmind.com/app/faq#satellite)&amp;#xD;
- EU for [Europe](http://www.maxmind.com/app/faq#EUAPcodes)&amp;#xD;
- AP for Asia/Pacific Region&amp;#xD;
- In addition, we map overseas military bases to US&amp;#xD;
&amp;#xD;
&lt;/td&gt;</tr><tr>&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;State/Region&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;char(2)&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;For US/Canada, [ISO-3166-2](http://www.maxmind.com/app/iso3166_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-4](http://www.maxmind.com/app/fips10_4)code. Region name lookups are available in [selected APIs](http://www.maxmind.com/app/faq#fips)&lt;/td&gt;</tr><tr>&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;City Name&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;varchar(255)&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Name of city or town in ISO-8859-1 encoding. A [list of cities](http://www.maxmind.com/GeoIPCity-534-Location.csv) contained in GeoIP City is available. A localized [CSV file](http://www.maxmind.com/app/faq#localization) containing city names in various languages is available.&lt;/td&gt;</tr><tr>&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Postal Code&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;varchar(6)&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;For US, Zipcodes, for Canada, postal codes. [More info.](http://www.maxmind.com/app/faq#postalcode)&lt;/td&gt;</tr><tr>&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Latitude&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;numeric (float)&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Latitude of city where IP is located&lt;/td&gt;</tr><tr>&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Longitude&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;numeric (float)&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Longitude of city where IP is located&lt;/td&gt;</tr><tr>&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Metro Code&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;unsigned int&lt;/td&gt;&lt;td class="Fields" id="" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;[Metropolitan Area](http://www.maxmind.com/app/metro_code) (US Only).&lt;/td&gt;</tr><tr>&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Area Code&lt;/td&gt;&lt;td class="Fields" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;unsigned int&lt;/td&gt;&lt;td class="Fields" id="" style="font-size: small; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgb(234, 220, 191); text-align: justify; " valign="top"&gt;Three digit telephone prefix (US Only).&lt;/td&gt;</tr></tbody>
ㄴ
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
🔗original-link