5

MaxMind is now offering a GeoLite2 DB as described on their site.

The trouble is that they no longer offer CSV download, only a binary MMDB binary database format.

I can't find anything online about how to unmangle the MMDB format and install it into my local MySQL database.

When I open the MMDB file in Notepad+, it's just a binary mess.

How can I use this MMDB file to populatte my local MySQL database?

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
xeo
  • 807
  • 2
  • 7
  • 25
  • i don't want to use their mmdb format. i'd like to use it in a mysql database. is this not possible anymore? using composer, guzzle, and all the other plugins they require is way more complex than just getting the csv formats installed. – xeo Oct 21 '13 at 16:21
  • 3
    MaxMind will be releasing a CSV version of the database, although there isn't a specific timeline. The binary database with the GeoIP2 package will generally provide a better experience and installing it with composer is pretty simple. Alternatively, you could use the [MaxMind DB reader](https://github.com/maxmind/MaxMind-DB-Reader-php) directly. It does not have any external dependencies. – Greg Oschwald Oct 21 '13 at 18:49
  • 3
    Any particular feature you need in GeoIP2? If not, you can stay with GeoIP1 or look at other option such as IP2Location LITE http://lite.ip2location.com – Michael C. Oct 22 '13 at 00:28
  • thanks. the lite.ip2location.com databases are a good fit for now. i'll wait for the csv version to come from maxmind. – xeo Oct 22 '13 at 17:32

3 Answers3

6

MaxMind is now offering a GeoLite2 DB as described on their site.

The trouble is that they no longer offer CSV download, only a binary MMDB binary database format.

They do, now:

Geolite2_city and Geolite2_country free CSV data bases

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
user19370
  • 116
  • 1
  • 3
1

I made a utility mmdb2csv that can convert 4 mmdb types to CSV. You can load the CSVs into MySQL and query from PHP.

  • GeoIP2City.mmdb
  • GeoIP2Connections.mmdb
  • GeoIP2Country.mmdb
  • GeoIP2ISP.mmdb
Kenji Noguchi
  • 1,752
  • 2
  • 17
  • 26
0

Import the CSV file instead of MMDB file, it works with MySQL.

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
vivex
  • 2,496
  • 1
  • 25
  • 30