Importing the latest MaxMind GeoLite2 database into MySQL
Asked Answered
C

3

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?

Chalcedony answered 21/10, 2013 at 16:4 Comment(4)
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.Chalcedony
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 directly. It does not have any external dependencies.Roter
Any particular feature you need in GeoIP2? If not, you can stay with GeoIP1 or look at other option such as IP2Location LITE lite.ip2location.comRegimen
thanks. the lite.ip2location.com databases are a good fit for now. i'll wait for the csv version to come from maxmind.Chalcedony
L
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

Lyly answered 17/2, 2014 at 9:6 Comment(0)
V
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
Volans answered 17/7, 2021 at 2:4 Comment(0)
A
0

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

Antecedency answered 15/3, 2014 at 20:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.