MaxMind GeoIP Location from a MySQL database
Wednesday, August 29th, 2007Vincent de Lau wrote a great article on HOW-TO Import the MaxMind GeoIP Free Country CSV file into MySQL and save diskspace.
The process consists of a few steps.
- Step 0 is to download the CSV file from the MaxMind website.
- Step 1 is to make a MySQL database and set up some tables.
- Step 2 is to import the CSV file into MySQL
- Step 3 is to optimize the data
- Step 4 is our final clean-up step
Now for those who want to do this the non CSV way - follow every step but grab the CSV2SQL converter. After running the CSV file from MaxMind through this app you will then have all the sql code you could ever want (I think when I went through the steps it was somewhere around 64k queries).
To be prepared for this exercise make sure you visit the MaxMind website and get yourself a copy of the MaxMind GeoIP free country CSV. Save it in a location where you can find it again and unzip. http://www.maxmind.com/app/geoip_country