geolite2

Query by city name on geolite2 .mmdb file (JAVA)

狂风中的少年 提交于 2021-01-27 17:02:01
问题 I am using GeoLite2 to get Location by IP address for my java appliccation. I want to get country by city from GeoLite2-City.mmdb file. This is my reader : DatabaseReader reader = new DatabaseReader.Builder(dbFileStream).withCache(new CHMCache()).build(); I am getting CityResponse by IP address like below : CityResponse cityResponse = reader.city(InetAddress.getByName("an IP address")); But I want to get Country name by city like this : String countryName = reader.getCountryByCity("Paris”);

Importing MaxMind's GeoLite2 to MySQL

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 05:52:56
问题 MaxMind's GeoLite2 is a wonderful database and is very useful if you want to map IP addresses to countries . To do this efficiently, I want to import it into a MySQL database with a scheme like this: I remember writing an import script for the CSV database long time ago, but the CSV as you can download it today has a very difficult to understand format, at least to me: network,geoname_id,registered_country_geoname_id,represented_country_geoname_id,is_anonymous_proxy,is_satellite_provider 1.0

Importing MaxMind's GeoLite2 to MySQL

本秂侑毒 提交于 2019-11-28 01:45:10
MaxMind's GeoLite2 is a wonderful database and is very useful if you want to map IP addresses to countries . To do this efficiently, I want to import it into a MySQL database with a scheme like this: I remember writing an import script for the CSV database long time ago, but the CSV as you can download it today has a very difficult to understand format, at least to me: network,geoname_id,registered_country_geoname_id,represented_country_geoname_id,is_anonymous_proxy,is_satellite_provider 1.0.0.0/24,2077456,2077456,,0,0 1.0.1.0/24,1814991,1814991,,0,0 1.0.2.0/23,1814991,1814991,,0,0 1.0.4.0/22