HostIP for geolocation

From Noah.org
Revision as of 18:11, 26 July 2007 by Root (talk | contribs) (New page: category:Engineering The hostip.info geolocation database appears to be gzipped multiple times. I don't know why, but if you have trouble opening it trying using the `file` command to...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


The hostip.info geolocation database appears to be gzipped multiple times. I don't know why, but if you have trouble opening it trying using the `file` command to see what format it is in. Keep gunzipping it until your get ascii text. I downloaded the bz2 version. Here is what I had to do:

 $ bunzip2 hostip_current.sql.bz2
 $ mv hostip_current.sql hostip_current.sql.gz
 $ gunzip hostip_current.sql.gz
 $ mv hostip_current.sql hostip_current.sql.gz # yes, do it again
 $ gunzip hostip_current.sql.gz

Create a database for hostip and load the data:

 $ mysql -u root -p ROOT_PASSWORD -e "create database hostip;"
 $ mysql -u root -p ROOT_PASSWORD hostip < hostip_current.sql